Thread: Underlining
View Single Post
Old 11-23-2015, 11:05 AM   #15
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,561
Karma: 20150435
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by GrannyGrump View Post
Can't you declare "u" in your css? I often do that for "em" and "strong"

u {text-decoration: underline}
No, you can't create new elements in CSS, you can only define the formatting for existing ones. And <u> is not an existing element in XHTML.

But you can re-define <em>, for example (if you are underlining, it is probably because you want to emphasize), or give it a class:

Code:
em {text-decoration: underline; font-style: normal}

em.u {text-decoration: underline; font-style: normal}
In the second case, you'd use <em class="u">like this</em>.
Jellby is offline   Reply With Quote