Home › Forums › Support › CSS to change appearance of internal links in specific blocks on a specific page
- This topic has 3 replies, 3 voices, and was last updated 3 years, 3 months ago by
Fernando.
-
AuthorPosts
-
July 9, 2022 at 2:58 pm #2278191
Alan
Hi,
I would like to change the appearance of the hyperlinks on the page linked to this topic without impacting hyperlinks throughout the rest of my site.
First, I would like the links in the section “Latest from the Blog” to be the same color as the header and not underlined.
Second, I would like the links in the section below that to be the same as the headers above those and not underlined.
Can this be achieved with custom CSS in each of the blocks? If so, could I have some help with what CSS to input into those?
Thank you!
July 10, 2022 at 4:19 am #2278388David
StaffCustomer SupportHi there,
for the colors first.
Each of those sections sits inside its own parent Container block. If you select that Container block you can set its Link Color to whatever you need. This will override the theme colors for those links.For the underline – whilst you have those Container blocks selected, go to Advacned > Additional CSS Class(es) and add:
remove_link_underlineThe you can use this CSS:
.remove_link_underline a { text-decoration: none; }You can then add the
remove_link_underlineto any Container block you want to remove its inside link underlines from .July 10, 2022 at 8:15 am #2278648Alan
Ahh, I didn’t realize you could change the link text within containers. That is simple. Thank you, David!
Regarding the link underlines:
I have added the additional CSS class
remove_link_underlineto both parent container blocks and implemented the CSS you provided, but they are still appearing.Any idea what I may be doing incorrectly?
July 10, 2022 at 6:05 pm #2278852Fernando Customer Support
You have a couple of missing
}in you Simple CSS. This syntax error is the cause why the code isn’t working.Try modifying your overall Simple CSS code to something like this:
@media (max-width: 300px) { .wp-block-image .alignright, .wp-block-image .alignleft { float: none; margin: 1em auto; } .wp-block-latest-posts li { text-align: center; text-decoration: none; } /* static color */ .wp-block-latest-posts li a { color: #1A1A1A; } /* hover color */ .wp-block-latest-posts li a:hover { color: #ccc; } } .remove_link_underline a { text-decoration: none; }Kindly let us know how it goes.
-
AuthorPosts
- You must be logged in to reply to this topic.