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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

line in html

Status
Not open for further replies.

DeSn

Programmer
Nov 20, 2001
111
BE
Hi,

i've created a gray line like this:
<tr>
<td colspan=&quot;4&quot; bgcolor=&quot;gray&quot; height=&quot;2&quot;></td>
</tr>


in IE this works fine, in NN (4.79) not. When I place &nbsp; in the td I get a thick line, which isn't ok.
Can anyone help me?
 
NN 4 doesn't support the height attribute in the <td> tag (as far as I recall). If you are looking for a cross browser solution that degrades nicely, you are better off using an image to do the job.

Even using an image there are several solutions!
- You can use an image the exact width and height of the line.
- You can use a 1x1 pixel image (of the colour you want the line to be) and then set the width and height attributes of the img tag to be the exact width and height of the line.
- You could use a 1x1 pixel transparent gif, set the width and height attributes of the img tag to be the exact width and height of the line, and then define a background colour on the td tag.
- You could use the
Code:
<spacer type=&quot;block&quot; width=&quot;XXX&quot; height=&quot;2&quot;>
Netscape only tag to force the width and height of the td (and use a background image in the td as above) -- IE will ignore the spacer tag, so leave in the height attribute for the td.

Just some ideas to get things rolling,
Jeff
 
Thanks, but I've used <hr>
 
You're better off using an image for your dynamic lines. Create a 1 pixel x 1 pixel GIF in the color of your choice. In your img tag, you can specify the desired height & width.

FYI - less than 1% of all users worldwide use NN4+, and this number is getting smaller each month. If you don't have to satisfy a specific client, I wouldn't bother trying to support it in your code.

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top