Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-03 00:17:28

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

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

#2 2006-12-03 02:07:49

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

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

#3 2006-12-03 05:53:57

aslsw66
Member
From: Canberra, Australia
Registered: 2004-08-04
Posts: 342
Website

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

#4 2006-12-03 15:03:52

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

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

Board footer

Powered by FluxBB