Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Need Help With The HTML HR Tag
TavoxPeru
post May 3 2006, 05:42 AM
Post #1


Super Member
Group Icon

Group: [HOSTED]
Posts: 722
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



Hi, does anybody knows which is the equivalent tag in CSS of the HTML HR tag or how do i replace this. I need this because the HR tag is deprecated and i wanna validate a website.

The code that i need to replace is this:
QUOTE
<hr color='#663300' size='2'>

best regards,
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post May 3 2006, 06:33 AM
Post #2


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



That's quite easy in fact. You need to define a HR element in your CSS. Although note that there's some discrepancy in the CSS tags across different browsers. Somewhat like this:
CODE

hr {
height: 2px;
color: #663300;
width: 80%;
}


IE supports the color tag, while Mozilla and Opera support background-color. You can even use the tag background-image to replace the standard boring rule with some nice separator graphic.

Here's a page outlining all you need to know about the HR tag:
Styling HR
Go to the top of the page
 
+Quote Post
mastercomputers
post May 3 2006, 11:55 AM
Post #3


BUG.SWAT.PATROL
Group Icon

Group: Members
Posts: 624
Joined: 1-September 04
From: Auckland, New Zealand
Member No.: 27



HR has not been deprecated, but maybe the attributes for it has been. Unless this is XHTML 2.0, though I believe it still exists as well as new introductory tags like separator, etc.

If you're using XHTML, then the hr tag is <hr />

If you're using HTML then it's just <hr>

Cheers,


MC
Go to the top of the page
 
+Quote Post
jlhaslip
post May 3 2006, 07:03 PM
Post #4


Advanced Member
Group Icon

Group: Members
Posts: 179
Joined: 15-November 05
From: Inland from the Left Coast of Canada
Member No.: 9,627



Is the page uploaded for us to see and what (exactly) is the warning or error message when you try to validate?
Go to the top of the page
 
+Quote Post
TavoxPeru
post May 3 2006, 09:48 PM
Post #5


Super Member
Group Icon

Group: [HOSTED]
Posts: 722
Joined: 8-April 06
From: Lima - Peru
Member No.: 12,579



QUOTE(mastercomputers @ May 3 2006, 06:55 AM) *

HR has not been deprecated, but maybe the attributes for it has been. Unless this is XHTML 2.0, though I believe it still exists as well as new introductory tags like separator, etc.

If you're using XHTML, then the hr tag is <hr />

If you're using HTML then it's just <hr>

Cheers,
MC

Sorry folks i confused what is deprecated, so you are right, the HR has not been deprecated, some of its attributes has been.

regards,

QUOTE(jlhaslip @ May 3 2006, 02:03 PM) *

Is the page uploaded for us to see and what (exactly) is the warning or error message when you try to validate?

This is the code:
CODE
<hr color='#663300' size='2'>

And generate the following warning:
Warning: <hr> proprietary attribute "color"
The tag contains an attribute that is proprietary to Netscape or Internet Explorer.

The solution is this and works with IE and Firefox:
CODE
<hr style="color:#663300; height:2px; BACKGROUND-COLOR:#663300;">

regards,
Go to the top of the page
 
+Quote Post
Hercco
post May 4 2006, 08:53 AM
Post #6


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



I don't think color attribute for horizontal rule has never been in W3C recommendation. I could be wrong though.

If you don't use HR for some specific trick, I'd recommend setting a consistent style for it using CSS. In normal pages HR should be used in a quite same matter and when you want to differ from it you can use special classes.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Basic Tips and Tricks in HTML(15)
  2. Embedding XML into HTML(2)
  3. Rapid HTML code generation using simple PHP(8)
  4. HTML 101 - Web Design For Beginners(7)
  5. Force Object To Load Last(2)
  6. Web Browsing With Vim(2)
  7. Creating Tooltips(7)
  8. Free Shoutbox? HTML, Flash or PHP Code(24)
  9. Need Help On HTML Matrix(6)
  10. HTM vs HTML: Whats The Difference ?(22)
  11. HTML Tags(4)
  12. Tutorial: Dreamweaver, 3ds Max, Flash, Html, Css(8)
  13. 4 Html Based Website Tips(4)
  14. Html Basic Tutorial(8)
  15. Dir2html 1.1.0(4)
  1. Html Stats(3)
  2. About Html(15)
  3. Video Player(0)
  4. Html Table Issue.(18)
  5. Html Emails How?(12)
  6. Nvu(2)
  7. Html Table Rows Problem [solved](1)
  8. Sitepoint's Css And Html Reference Sites(2)
  9. W3 Schools(1)
  10. Increase Your Knowledge Of Html Language(11)
  11. Javascript Tutorial For Beginner(0)
  12. Yaml - (x)html/css Framework(2)
  13. Style P And H? Html Tags(2)


 



- Lo-Fi Version Time is now: 24th July 2008 - 08:53 PM