SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot lightwithoutheat's Avatar
    Join Date
    Feb 2002
    Location
    Washington DC
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    xhtml trans. won't validate my <hr> tag?

    I'm having trouble getting one of my pages validated xhtml transitional, and seeing that I am picky about every last bit of code, I need help with this one!

    This is the line that won't validate:
    <hr align="left" size="1" width="140" noshade />

    I keep getting this error:
    "the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified"

    Can anyone help? I'm sure its something simple.

    Thanks!

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Get rid of your alignment, use CSS to handle this. Get rid of the noshade element. Should probably just move the size and width to CSS while you are at it so you would have:

    hr {
    text-align: left;
    height:1px;
    width: 140px;
    }

    In your CSS and:

    <hr />

    in your HTML.
    Wayne Luke
    ------------


  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Attributes can't be minimized in XHTML. So for example,
    HTML Code:
    <hr noshade />
    Needs to be
    HTML Code:
    <hr noshade="noshade" />
    ...or...
    HTML Code:
    <input type="checkbox" checked />
    Needs to be:
    HTML Code:
    <input type="checkbox" checked="checked" />
    However, Wayne's idea of moving those attributes to your stylesheet is the best long-term solution for this particular problem.

  4. #4
    SitePoint Zealot lightwithoutheat's Avatar
    Join Date
    Feb 2002
    Location
    Washington DC
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys! I knew it was proably something easy. I appreciate it.


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
  •