SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast polyhedra's Avatar
    Join Date
    Nov 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hr noshade with css

    Okay while validating my website I ran into the an error with the hr property "noshade". Is this essentially what
    the details of noshade does? I was successfully able to get it to look the same with css

    HTML Code:
    hr 
    {border-style: solid;}
    I have included the error from w3 validator seen below:
    The noshade attribute on the hr element is obsolete. Use CSS instead. <hr noshade/>

    Yours cordially,
    polyhedra (Daniel)

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,355
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Yes noshade is a deprecated presentational attribute and invalid in strict doctypes.

    You can use border as you mentioned above to get a similar effect but if you need ie7/6 support then use the following instead.

    Code:
    hr {
    	color:#808080;
    	background:#808080;
    	height:2px;
    	border:none
    }
    Note than in older versions of IE you can't reduce the vertical margins on the hr beyond a certain point which is why most people simply use the border on a div instead.

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,175
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    If you are looking for a line for visual styling, I'd suggest using a border on a block element rather than hr. <hr> is not really a presentational element. It has actual meaning in HTML.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •