Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

margin help with css

Status
Not open for further replies.

occas

Technical User
Jan 14, 2004
164
US
body {
font: 11pt "Times New Roman", serif;
margin-top: .10in;
margin-left: .10in;
margin-bottom: .10in;
margin-right: .10in;
}

i am using the code above in order to get a margin established. it is being ignored somehow. which bring me to maybe a not too bright question. i wonder if it is my doc type info. i am not totally sure if i am using what i should be.

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD XHTML 4.01 Transitional//EN&quot;
&quot;
<html xmlns=&quot;
ty.
 
i see my mistake with the doc type. should be 1.0 xhtml and xhtml1 respectively. but still same result. ty.
 
Well, it works ok for me in IE6 - though it's not immediately obvious because 0.1 inches seems to be about the same as the default size of the margin. Incidentally, you could get the same (non) effect from this:
[tt]
body {
font: 11pt &quot;Times New Roman&quot;, serif;
margin: 0.1in;
}
[/tt]
What problem are you getting? What browser are you using?

-- Chris Hunt
 
ie 6. i also view it with mozilla and no margin. ty.
 
Well, I see margin around that page that looks to be about 10 pixels - as you've specified. What do you see?

The first thing you need to do, however, is tidy up your XHTML code. You've got multiple <head> and <body> elements in there, the whole thing being so confused that it's hardly surprising if some browsers mangle it. Get your page to validate, then worry about the margins.

-- Chris Hunt
 
ty. just learning. admittedly.
 
this is strange. i am using html-kit, which i just downloaded a few days ago. i was looking to see where i have multiple head and body tags. i show none with this editor.
however, when i go to the link and view source, i see what you mean. in notepad. can somebody explain to me what could be going on here? i am positive that i am transferring that file to my server. ty.
 
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&quot;<%@ Register TagPrefix=&quot;uc0&quot; TagName=&quot;tigerheader&quot; Src=&quot;tigerheader23.ascx&quot; %>
<%@ Register TagPrefix=&quot;uc0&quot; TagName=&quot;tigerside&quot; Src=&quot;tigerside.ascx&quot; %>

<html xmlns=&quot;<head>
<link rel=&quot;stylesheet&quot; href=&quot;maintigercss.css&quot; type=&quot;text/css&quot; />
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
<!--
dayName = new Array (&quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;)
monName = new Array (&quot;January&quot;, &quot;February&quot;, &quot;March&quot;, &quot;April&quot;, &quot;May&quot;, &quot;June&quot;, &quot;July&quot;, &quot;August&quot;, &quot;September&quot;, &quot;October&quot;, &quot;November&quot;, &quot;December&quot;)
now = new Date
//-->
</script>

</head>
<body bgcolor=&quot;#aead99&quot;>
<table width=&quot;750&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot;>
<tr>
<td width=&quot;750&quot; colspan=&quot;2&quot;><uc0:tigerheader id=&quot;UserControl1&quot; runat=&quot;server&quot;></uc0:tigerheader></td>
</tr>
<tr>
<td width=&quot;150&quot; bgcolor=&quot;#b71000&quot;><uc0:tigerside id=&quot;UserControl2&quot; runat=&quot;server&quot;></uc0:tigerside></td>
<td width=&quot;600&quot; bgcolor=&quot;white&quot; valign=&quot;top&quot;><div align=&quot;center&quot;><h3>Welcome to Tiger Eye Sports</h3></div>
<script type=&quot;text/javascript&quot;>
<!--
document.write(&quot;Today is &quot; + dayName[now.getDay()] + &quot;,&quot; + monName[now.getMonth()] + &quot; &quot; + now.getDate() + &quot;.&quot;)
// -->
</script>
</td>
</tr>
</table>
</body>
</html>


the above is the code i have showing in my html-kit editor and notepad both. when i view the file at the server with my ftp program, this is it.
but when i view source of the file displayed on the web, i get that stuff with 2 head tags, etc.
i tried deleting the file at the server. when i did, the page became blank when trying to access on the web. i then replaced that file, figuring i may have corrected the situation. but i am truly lost here.
tyvm.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top