I'm using the below code to generate a horizontal bar. It works in older brower versions but not in the Internet explorer 9. It won't be visible until I click on 'Compatibility View'. Do we have an alternate for this or has it got replaced?
<hr style="color:#F87431 ; height:7px "/>
The width attribute on the hr element is obsolete. Use CSS instead. The noshade attribute on the hr element is obsolete. Use CSS instead.
Its simple to add a horizontal line in your markup, just add: <hr>. Browsers draw a line across the entire width of the container, which can be the entire body or a child element.
Try
<hr style="background:#F87431; border:0; height:7px" />
HR in its original form, like STRIKE, B etc. were far too layout and presentation oriented.
HTML 5 is moving the markup towards a more semantic structure with more emphasis the layout being placed on CSS and media elements.
From the W3C documentation:
In HTML 4.01, the <hr> tag represented a horizontal rule.
In HTML5, the <hr> tag defines a thematic break.
However, the <hr> tag may still be displayed as a horizontal rule in visual browsers, but is now defined in semantic terms, rather than presentational terms.
So you just need to style it up nicely.
I've also use div's for this, something like <div style="width: 100%; height: 7px; background: #F87431; overflow: hidden;">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With