August 17, 201213 yr style.cssindex.htmlHi all not been on here for ages so let me first start by saying i do appreciate your help. Ok ive been working on a footer for my website for sometime trying to get the perfect one, but one problem i keep running into is positioning. I want a big fat footer that stuck to the bottom of the window but also scrolls with the rest of the content. I did initially go for a position: fixed footer but decided best to have a relative footer instead as this fits in with the rest of my site. The problem is when i try to have the footer span the whole width of the browser window. With fixed its ok but with relative it aint & i consider myself very css savvy But this annoyingly not working. PLEASE! help? ; With relative it just decreases in size & looks like it has 0 auto set to it.. which i aint. Thanks Edited August 17, 201213 yr by MixCreations
August 17, 201213 yr Do you have a link ? I downloaded the files but all the images are saved locally so I'm not able to see them.
August 17, 201213 yr You've set the <body> element to have a width of 952px. Naturally, since your footer element is a child of <body> and it has a width of "100%", it will only expand to the width of it's parent (body). When an element's position is "fixed", this is not it's behavior, which is why you didn't have the issue then. You'll find that many don't set the dimensions of the body tag. Instead, they create a "wrapper" div and place all necessary content within it. Then, if they need anything to extend the width of the body (what you need), they'll place that content outside of the wrapper (ex. your footer). This is the perfect solution to your issue. Kind Regards Edited August 17, 201213 yr by Pete Prosper
August 19, 201213 yr Author You've set the <body> element to have a width of 952px. Naturally, since your footer element is a child of <body> and it has a width of "100%", it will only expand to the width of it's parent (body). When an element's position is "fixed", this is not it's behavior, which is why you didn't have the issue then. You'll find that many don't set the dimensions of the body tag. Instead, they create a "wrapper" div and place all necessary content within it. Then, if they need anything to extend the width of the body (what you need), they'll place that content outside of the wrapper (ex. your footer). This is the perfect solution to your issue. Kind Regards Thanks plus i did work it out after.
Create an account or sign in to comment