SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2011
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    html5: <a> no longer on steroids?

    Hello,

    I thought it was ok to have the <a> element wrap, say, <li> element. It validated in december. Now it doesn't anymore.

    Has something changed?


  2. #2
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It's never validated in a normative markup language for LI and I cannot ever remember it being allowed in Fred either since UL contains zero or more LI elements anyway.

    However, if you are meaning the Anchor would be allowed around certain elements like P element; it may be wrapped around entire paragraphs within Fred, yes. Though obviously it depends on content type and contents, and LI obviously is an example of where you cannot wrap it around and never have been able to do.

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    39,868
    Mentioned
    159 Post(s)
    Tagged
    4 Thread(s)
    Note that although html5 allows anachors around certain elements as Robert mentions above most browsers still hate it and I'm seeing more and more bugs in the CSS forum where layouts are breaking because of this. I would recommend that you don't do it as in most cases there isn't really a need. If you do use it the at least set it to display:block to avoid some (not all) of the bugs.

  4. #4
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    Note that although html5 allows anachors around certain elements as Robert mentions above most browsers still hate it and I'm seeing more and more bugs in the CSS forum where layouts are breaking because of this. I would recommend that you don't do it as in most cases there isn't really a need.
    At which point take the next step and pretend the HTML 5 idiocy (at least so far as the actual HTML part is concerned) doesn't even exist... It's really for the better to stick with the current RECOMMENDATION, especially since it lacks all the bloat and nonsensical elements people are abusing for nothing as if it was the bleeding edge of 1998.

    HTML 5 -- setting coding practices back a decade or more...


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
  •