2 replies [Last post]
hira kumar
hira kumar's picture
Offline
Enthusiast
kathmandu
Last seen: 5 years 4 weeks ago
kathmandu
Timezone: GMT+5.75
Joined: 2007-09-12
Posts: 55
Points: 3

I am using FF3, IE7, and IE6. Background of hr element shows nice but IE7 and IE6 could not render hr element it shows unnecessary gray background. How could I make similar hr element's background.
HTML CODE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>hr</title>
 
</head>
<body>
<hr/>
</body>
</html>

CSS CODE

body{
background:#414142;
}
hr{
	background:#ff0000 url(hrBg.jpg) 0 0 repeat-x;
	height:3px;
	display:block;
	clear:both;
	border:none;
 
}

AttachmentSize
hrBg.jpg334 bytes
hr-screenshot.jpg58.95 KB

CSS 2.0 Creator

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 9 weeks 6 days ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

I don't think you'll be able

I don't think you'll be able to style s background in IE, but really for what you're doing, you're better off using a dotted/dashed CSS border instead.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

hira kumar
hira kumar's picture
Offline
Enthusiast
kathmandu
Last seen: 5 years 4 weeks ago
kathmandu
Timezone: GMT+5.75
Joined: 2007-09-12
Posts: 55
Points: 3

but again different border behavior in IE and FF

I was intending to take border on hr but it still give problem in IE and FF. It shows little bit different in multibrowser

CSS 2.0 Creator