Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Margins / padding on top and bottom of page that I can't get rid of
I want to have a colored stripe or some graphic along the very top and bottom of my webpage, but it seems textpattern inserts an automatic extra margin of 10 px or so on top, and about 20 px on the bottom. So I end up with a white gap before my stripe appears. Please see my page for a demo of what I mean (go to the photos page to see the bottom margin.)
Does anyone know how to get rid of this and where its coming from? Do you have it on your page? Thanks for any help.
Offline
Re: Margins / padding on top and bottom of page that I can't get rid of
try css
body, html {padding:0;margin:0;}
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: Margins / padding on top and bottom of page that I can't get rid of
Another alternative I use is to reset all padding and margins and then set them myself on individual elements:
* {padding:0; margin:0 }
See this discussion about why you would use this technique: Global Whitespace Rest .
If you read about this technique, you’ll find that every browser has its own defaults for paddings/margins on different elements. This approach removes all the defaults.
Last edited by aslsw66 (2006-12-03 05:54:46)
Offline
Re: Margins / padding on top and bottom of page that I can't get rid of
jayrope / aslsw66 – I know I tried html { padding: 0; margin: 0; } before and it didn’t help, but I just tried doing that with body and it worked. Thanks a lot, obviously I am very new to CSS. I did make the theme and did all the styling myself for my website though!
Last edited by aswihart (2006-12-03 15:09:57)
Offline