Help me out in <hr> tag

Discussion in 'HTML & Website Design' started by marshalprince, Aug 24, 2009.

  1. #1
    Currently I am using <li><hr style="width=1px; background color:red"/></li>

    this <hr> is rendering itself as blue in IE6 while not showing in Mozilla

    What should I do?
     
    marshalprince, Aug 24, 2009 IP
  2. sudharsan

    sudharsan Active Member

    Messages:
    164
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #2
    the hr element were deprecated in HTML 4.01, and are not supported in XHTML 1.0 Strict DTD.

    you use styles-below is a example

    <li style="border-top:solid 1px;color:red;"/> Yout text </li>
     
    sudharsan, Aug 24, 2009 IP
  3. Webray

    Webray Active Member

    Messages:
    469
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Syntax is wrong.
    background color:red

    Should be:
    background-color:red;

    You're missing the dash/hyphen (-)
     
    Webray, Aug 24, 2009 IP
  4. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The hr element is NOT deprecated! However styling it with the attributes it originally came with IS.
    http://www.w3.org/TR/html401/present/graphics.html#edef-HR
    (scroll up to <font> to see where it states that <font> and <basefont> *are* deprecated. HR itself isn't, only its attributes.)

    The element itself is absolutely supported in the XHTML strict and HTML strict doctypes. They will NOT generate an error. However they need to be styled with CSS, and IE's usual cadre of bugs apply.

    That said, sudharsan's suggestion of a bottom border is a better idea 99% of the time. Use an hr only if that line is part of the content (which is sometimes but rarely is). In a list, it likely isn't.
     
    Stomme poes, Aug 24, 2009 IP
  5. anurag_notsocool

    anurag_notsocool Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    The <hr> tag, also called as the 'Hyperlink Reference', is used to link webpages in html.
    The tag used in this case is the anchor tag <a>.

    Syntax:

    <a href="navigate url">link text</a>

    Example:

    <a href="home.html">HOME</a>

    U can also set images in place of link texts. When u will click on the image, the linked page will open.
     
    anurag_notsocool, Aug 24, 2009 IP
  6. Webray

    Webray Active Member

    Messages:
    469
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #6
    Actually, HR stands for Horizontal Rule.

    You're talking about the a tag (Anchor).
     
    Webray, Aug 24, 2009 IP
  7. 1 FineLine

    1 FineLine Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    you can style an HR like this

    hr {color:#CCC;background-color:#CCC;height:1px;border:none; width: 96%; text-align: center;}

    If you want to style a list item the mentioned border-top or border-bottom is the way to go
     
    1 FineLine, Aug 24, 2009 IP
  8. marshalprince

    marshalprince Peon

    Messages:
    435
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks for all the suggestions. Work done. Great help.
     
    marshalprince, Aug 25, 2009 IP