Log in

View Full Version : <hr> css



jm7166
05-24-2008, 02:50 PM
Hi,

I'd like to use an image instead of the standard horizontal bar in the <hr> tag. Would I use a code like this:

.hr
{background:url('/graphics/website/spacerbtn.gif') no-repeat;}

I've tried it, but it hasn't worked. I know there is a way to do it, but I haven't done css in such a long time. I do believe I am having css amnesia.

anyhelp is appreciated!

Thanks! :)

boogyman
05-24-2008, 03:25 PM
you are assigning a class with that code

get rid of the dot at the beginning and you should be able to see yourbackground image



hr {background:url('/graphics/website/spacerbtn.gif') no-repeat;}


you may need to explicitly set the height property depending on the image you wish to use though, so just test it out


// 1500th Post

jm7166
05-24-2008, 04:28 PM
:)

Thanks for the help. I'll give it a shot!!

sandyk3
05-26-2008, 12:20 AM
I guess I've never called in my image for the HR using background image. It's easier to just use
<img src="images/picname.jpg> alt="name" width="80%" height="3" />

You can also assign a class to it for centering if you'd like.

Sandy K