Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HR Styling - Only working in Firefox, how to make it work for IE and Chrome

Tags:

html

css

I have this code

<hr style="margin-top: 5px; color: #ada95b; width: 500px;"/>

However this is only working in Firefox, and not working on my versions of Chrome and IE. What way is best to style them and they will work in all browsers?

like image 835
Ryan S Avatar asked Apr 11 '11 09:04

Ryan S


2 Answers

best way is removing the border and putting a color to background.. i.e.

<hr style="margin-top: 5px; height: 2px; border: none; background: #ada95b; width: 500px;"/>
like image 183
Alex K Avatar answered Nov 03 '22 01:11

Alex K


Regarding the color, browsers treat it differently, you should also set background-color.

This is a quite old article, but might still help.

http://www.sovavsiti.cz/css/hr.html

You can also get some ideas here:

http://webdesign.about.com/od/beginningcss/a/style_hr_tag.htm

like image 41
kapa Avatar answered Nov 03 '22 01:11

kapa