Pregunta

so here is the HTML code for this page, and I am trying to change the color of the "Comment" link, how do I target it ?

        <p>Phasellus tincidunt tristique elit, nec scelerisque ante egestas sit amet. Nulla eu diam turpis. Etiam ac arcu nec augue sollicitudin elementum. Duis congue mauris eu augue congue commodo. Vestibulum eleifend suscipit augue, non laoreet sem interdum id. Aenean tempus odio sit amet ante malesuada posuere. Fusce dolor justo, lacinia eu varius a, tempor et arcu. Aenean in massa blandit, cursus erat sed, adipiscing orci. Morbi in odio dignissim velit dictum molestie. Phasellus leo augue, tempor a tortor et, eleifend laoreet tellus. Maecenas vel velit at arcu condimentum lobortis facilisis eu ipsum. Sed sit amet volutpat eros. </p>
        <p><a href="#">Comment</a></p>
    </article>
</section>
¿Fue útil?

Solución

Three ways:

  1. Add an id to it. <a id="whatever">
  2. Go down the pattern: section article p a
  3. Add a class (similar to an ID) <a class="whatever">

I suggest that you use an ID. It is the best way to single out just this link. To select it with CSS by the id:

#your_id:hover {
    whatever-you: want;
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top