Welcome to WebmasterWorld Guest from 54.221.9.209

Forum Moderators: not2easy

Message Too Old, No Replies

Body margins

table color/body width and N4.7 headache

     
4:32 pm on Jan 4, 2003 (gmt 0)

New User

10+ Year Member

joined:Jan 4, 2003
posts:7
votes: 0


Is there some way to make N4.7 have a color run across
top of page 100%? This works in IE:

body { margin:0; padding:0; height:100%; width:100% }

then within the body is a two row table:

<table width="100%" height="10%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000" summary="">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>

suggestions greatly appreciated!

4:37 pm on Jan 4, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


It depends on the entire layout, but when you can do it the surest way is a tiled background-image for <body>. No funky space to deal with!
4:42 pm on Jan 4, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


Good call tedster, I'd just given up trying to get a border to work on it ;)

Nick

4:52 pm on Jan 4, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 14, 2002
posts:157
votes: 0


jfcates, NN4 adds declared values to its default margins. To eliminate body margin at all, you have to define:

body {
margin: -10px 0 0 -10px;
}

for NN4 only and for other browsers:

body {
margin: 0;
}

5:46 pm on Jan 4, 2003 (gmt 0)

New User

10+ Year Member

joined:Jan 4, 2003
posts:7
votes: 0


Well, I tried this:
body { margin: -10px 0 0 -10px; }

and this:
html {
margin: 0;
padding: 0;
border: none;
}
neither one does the trick.

how do i do a tiled background-image for <body>;
more precisely, what's the code?

5:50 pm on Jan 4, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member nick_w is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Feb 4, 2002
posts:5044
votes: 0


[w3.org...]

Nice to have you onboard jfcates, check your sticky mail ;)

Nick

5:54 pm on Jan 4, 2003 (gmt 0)

New User

10+ Year Member

joined:Jan 4, 2003
posts:7
votes: 0


Hmmm... I'm half way there.
I type something in one of the table cells (same font
color as bgcolor table color), and now the color on the top shows up in N4,
but still won't run off the right edge?
6:05 pm on Jan 4, 2003 (gmt 0)

Preferred Member

10+ Year Member

joined:June 21, 2000
posts:626
votes: 0


<table width="100%" height="10%" border="0" cellpadding="0" cellspacing="0"
bgcolor="#FF0000" summary="">
<tr>
<td></td>
</tr>
<tr>
<td></td>
</tr>
</table>

With the above code the table cell will not show. For NN 4.X to show this cell you need something in the <td></td>. Just place a clear GIF image and the table cell should show up.

Brian

6:15 pm on Jan 4, 2003 (gmt 0)

New User

10+ Year Member

joined:Jan 4, 2003
posts:7
votes: 0


thanks brian, I've got some copy in the td tag, but it still
won't run off the right side?
2:03 am on Jan 5, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
posts:37301
votes: 0


how do i do a tiled background-image for <body>; more precisely, what's the code?

body {
background-image:url(background.gif);
}

Note - no quotes around the path for the image. If you want to tile in just one direction, you also use

background-repeat:repeat-x; [or repeat-y or no-repeat]

2:07 pm on Jan 5, 2003 (gmt 0)

New User

10+ Year Member

joined:Jan 4, 2003
posts:7
votes: 0


thanks tedster! :) that was a fix, and one i won't forget.