Archived topic
Cannot underline links
13 replies · Started by George on September 14, 2017
I changed the link color, however the links are not underlined. I read in another post that I should add this CSS: a,
a:visited {
text-decoration: underline;
}
I tried it but it doesn't work. This is a regular page, no page builder involved. How can I underline the links in posts and pages?
Try this:
a, a:visited, a:hover {
text-decoration: underline;
}
Unfortunately this doesn't work either.
Can you link me to the site?
Your CSS is broken. You need to close the block for your blockquote with a curly bracket: }
This is how I have it in my Simple CSS: a, a:visited, a:hover {
text-decoration: underline;
}
I also have this code in there to get rid of the post dates, but this doesn't work either:
.comment-meta {
display: none;
}
So from what I can see, the CSS is not broken.
Your blockquote CSS has an opening {, but no closing }.
Aha, thanks, I had missed that. Now the underline is working. However now the post titles are underlined as well:
https://www.screencast.com/t/OyXW6pxh
What can I do so that only the links in the post body are underlined?
Another question: Is there a way to only get rid of the post date, but not of the name of the poster. The CSS that I have gets rid of everything, but I just want to eliminate the post date:
.comment-meta {
display: none;
}
My second question is if there is a setting to eliminate the previous and next post links at the bottom of a post, or do I need CSS for that?
https://www.screencast.com/t/ksKP3anKOWW
By default Wordpress excerpt strips all HTML so the links underline won't work unless you use the more tag: https://docs.generatepress.com/article/using-the-more-tag/
You can try this to underline the content only:
.site-content a,
.site-content a:visited,
.site-content a:hover {
text-decoration: underline;
}
Date can be removed using the customizer already: https://docs.generatepress.com/article/blog-overview/#blog-content
Post navigation will be an option in the upcoming GP premium. For now try this CSS:
.post-navigation {
display: none;
}
Let me know.
The underlining works with this code, but still all the post titles are underlined as well when I click on the "Blog" link in the main menu. That's before I ever open a post and click on the 'more' tag.
If there is no solution for this issue, could this code be modified so that the underline only happens on hover?
Actually try this with more tag:
.entry-content a,
.entry-content a:visited,
.entry-content a:hover {
text-decoration: underline;
}
Let me know.
This one works, thank you!
No problem!