Hi guys,
How would I define different break/hr styles in CSS and then call them all in various places in my HTML file?
Thanks,
Max
Hi guys,
How would I define different break/hr styles in CSS and then call them all in various places in my HTML file?
Thanks,
Max
Well, aside from the fact that the <hr> element is one of the less consistent across browsers (at least it tends to look OK in all of them), you would do it just the same as for any other element. That is to define several classes (as many as you need) for them or to select them in other ways (let's not worry about that now). So, you could have, say you need two kinds:
Put the above in your stylesheet and use them in your document like so:Code:.hr1 { height:4px; color:red; } .hr2 { width:70%; }
and:HTML Code:<hr class="hr1">
You could use each of these as many times as required in the body of your page.HTML Code:<hr class="hr2">
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
It should be noted, however, that use of the <hr> tag, as with <br>, is, while still valid, discouraged, as it is no longer necessary; a border should be used instead.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
What's next? Are they going to take the <p>?
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
Doubtful, but they might take my supply of commas if I keep abusing them like that.![]()
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks