Support » Alpha/Beta/RC » Twenty Seventeen html validation errors

  • Resolved Galen Evans


    HTML Tidy gives the following error for Twenty Seventeen for every menu item that has children:

    Error: Attribute “href” not allowed on element “use” at this point.

    Changing line #105 of /inc/icon-functions.php from

    $svg .= ' <use href="#icon-' . esc_html( $args['icon'] ) . '" xlink:href="#icon-' . esc_html( $args['icon'] ) . '"></use> ';


    $svg .= ' <use xlink:href="#icon-' . esc_html( $args['icon'] ) . '"></use> ';

    fixes the error, and I am unable to see any side effects from the change.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sami Keijonen


    Thanks for noticing. The markup is related to new SVG specs. You can check more information from this ticket.

    David A. Kennedy


    Hey Galen,

    Thanks for the report! Sami is right – the offending markup is related to how Twenty Seventeen uses two methods to link to a SVG. One method is from version 1.1 of the SVG spec, and the other from version 2. We used both because of the way current browsers support one and not the other. It’s valid HTML though, even if some validators haven’t caught up yet. See this part of the spec.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Twenty Seventeen html validation errors’ is closed to new replies.