Here are two details that I think those of us who want to follow best practices need to consider:
In regard to the Use the u Tag to Underline Text challenge, MDN has this to say:
This element used to be called the “Underline” element in older versions of HTML, and is still sometimes misused in this way. To underline text, you should instead apply a style that includes the CSS
text-decoration property set to “underline”.
Valid use cases for the
<u> element include annotating spelling errors, applying a proper name mark to denote proper names in Chinese text, and other forms of annotation.
You should not use
<u> to simply underline text for presentation purposes, or to denote titles of books.
Even though the challenge states:
To underline text, you can use the u tag, best practices according to Mozilla say that the
<u> tag is no longer used to underline text.
In the challenge example code, it’s easy to see why one doesn’t want to use the default styling for the
<u> tag (and probably why one doesn’t want to use the
<u> tag in this case in general) by comparing the underlined text to the two links. If I were looking at that page for the first time, I’d assume “Ph.D. students” was an anchor tag and I’d try to click on it because the other two underlined things in that example are clickable anchor tags. I might think something was wrong with my browser or the way the page is being rendered since one of the links doen’t seem to work.
Read more about when it’s ok to use the
Here’s a similar discussion (1 and 2) about the Use the em Tag to Italicize Text challenge.
CSS Styling of IDs
The Add a box-shadow to a Card-like Element challenge asks us to do something that many CSS developers would NEVER do … use an id to style an element! Even though it’s impossible to pass this challenge without styling the id, I recommend reading the following before doing something like this in your projects:
Interneting is Hard - CSS Selectors will help you learn more about all of the CSS selectors, showing when and how to use them in more detail.