Correct format for links in W3C


I have a site that has a footer where the following string is included to link internal links (I speak of an HTML document):

<a href="<?php echo url_for('nosotros/aviso-legal#top'); ?>" title="Aviso legal">

At the same time it has this parameter to reference the crumb:

<?php echo include_partial(
        'nombreSeccion'=> 'Términos de servicio',
        'tituloSeccion'=> 'Términos de servicio'
) ?>

Passing the validator W3C says that this format is not correct, but it does not tell me which would be the correct one.

Could someone tell me what would be the correct compatible format?

asked by J.Javier 21.01.2017 в 18:44

1 answer


The HTML Anchor (<a>) element defines a hyper link to a location on the same page or any other page on the Web. It can also be used (in an outdated way) to create a point-anchor point to a destination for hyperlinks within the content of a page, so that the links are not simply connected to the top of a page .


<a href="" title="Google">Google</a>
<!-- Obsoletos -->
<a id="ancla"></a>
<a href="#ancla">Ir al anclaje</a>

More examples here

answered by 21.01.2017 в 21:48