Forum Moderators: open

Message Too Old, No Replies

how do you set page margins with this doctype?

         

Wozzzzza

12:18 pm on Jul 6, 2006 (gmt 0)



im using the below doctype for my site and im trying to set the page margins to zero but they wont budge. ive tried defining it in css and in the body tag in the page but they just wont move. if i take the doctype out i can set the margins where ever i like but with the doctype in the margins wont budge and i hate the border, it destroys the look of my site.
how do you set margins with this doctype?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

if i use other doctypes it stuffs my page up and puts like borders around some tables for what ever reason i dont know so that is why im using this doctype instead of others but this one gives me a margin problem.

penders

1:09 pm on Jul 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The following CSS does the trick:

body {
margin:0; /* IE5+, Firefox */
padding:0; /* Opera 8 */
}

Opera seems to be the odd-ball in this respect, the body margins are already zero, but it has padding.

Wozzzzza

3:00 pm on Jul 6, 2006 (gmt 0)



man im so stupid, i had all them margins and padding in my css file, i was about to post my body declaration here and i just noticed there was a letter in the top left corner of my browser stopping the top of my site from reaching the top of the page. look into the code i had a letter just below the body tag that i dont know how got there, now that i removed that letter my margins are once again 0.