Site logo

Archived topic

How to add css only for the post content

3 replies · Started by Ricardo on February 20, 2022

Viewing posts 1–4 of 4

Hi,

I'm a CSS noob and tried to read other topics here about this, but still don't know how should I proceed. If you could help me it would be fantastic.

I have a blog and I would like to style my articles hyperlinks this way:

p a, ul a, ol a {
color: #867946!important;
text-decoration: none;
padding-bottom: 1,5px;
border-bottom: 1px solid #b5a062;
}

I included ol and ul because I want to add hyperlinks to the list elements.

But menu links are also affected for this and links on other pages too.

You can check here:

https://wordpress-724192-2412533.cloudwaysapps.com/fado-porto/

Is there any way of limiting this css rules to the content of the articles?

Thank you!

Hi there,

Try this:

.entry-content p a, .entry-content ul a, .entry-content ol a {
    color: #867946!important;
    text-decoration: none;
    padding-bottom: 15px;
    border-bottom: 1px solid #b5a062;
}

Thank you so much! Got the idea too.

No problem :)

This archived topic is closed to new replies.