Site logo

Archived topic

Change CSS for link only inside post content

4 replies · Started by Nenad on September 12, 2021

Viewing posts 1–5 of 5

Hello,

I'd like to update CSS for links, but only links inside post content, not all of the links on site.

Tried this but it doesn't work:
.inside-article > entry-content > a

I understand that this may not be a GeneratePress issue - feel free to close it/delete if unappropriate.

P.S. It's a code of few lines, it's not only about colors, so I can't really update it in customizer. It does have :hover property also.

Thanks!

I used a solution from my other CSS issue, and it worked :D

Just if anyone else needs it, in order to update CSS of links in posts only you need to use:
div.entry-content > p > a

Sorry about spam and thanks!

If I get to the situation where this doesn't work, will reopen.

Hi there,

Consider avoiding > if you're not 100% sure the element is directly after a specified element.

Also make sure the selector syntax is correct. :)

This .inside-article > entry-content > a could work with a few fix into this - .inside-article .entry-content p a

but you seem to have already fixed it. Glad you got it sorted.

Thanks, Elvin. Will go with your version. :)

No problem. :D

This archived topic is closed to new replies.