The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › Styling links in a paragraph
Hi,
When I want to style `` inside a paragraph (say just to underline it) what is the best way to do it?
If I use like;
.class-name p {font styles} .class-name p a {test-decoration:underline}
`` lose all `
` styles.
Thanks in advance.
If by losing all styles you mean the paragraph color, it’s because that’s the default behavior of `` elements. You can do something like:
.class-name p, .class-name p a { color: #333; /* perhaps other styles that aren’t inherited by default */ } .class-name p a { text-decoration: underline; /* isn’t that the default already? */ }
Thanks.
My post was not displayed the way I types it :(
It was my first post here anyway.
@CrocoDillon Thanks, that’s the way I use it too, but I was not sure about if that’s the best practice.
Yw :) About the post, you have to use backtick quotes (`) around tags.
You can also use border-bottom