Hyperlinks

Posted in: Newspaper
Post count: 497

Can we make underline in hyperlinks of the website? If yes, then guide me the code. Thanks

  • This topic was modified 8 years by great1212.
Post count: 22421

Hello,

You can use a code similar to this one that affects all the links on posts and pages.

.td-post-content a, .td-main-page-wrap a {
text-decoration:underline!important;
}

The problem with this however is that it will affect all links including blocks like so:
https://www.screencast.com/t/fXxnTeT7i71

That is why it is problematic changing link styles as there are lots of links all around a website.
In order to target just specific links, the proper way to do it is to wrap all the links you want affected by the change in a div tag like for example:

<div class="customlink"> --add link here--</div> and then you can use css like so to only target the specific links that have these tags:

.customlink a{
text-decoration:underline!important;
}

you can also add a background-color or a color to the link or a font size and it will only affect the links inside of the div.

Thank you!

Post count: 497

Can we use the code to just change the hyperlinks with underlines without the block content?

Post count: 22421

I already provided the solution. Please read my reply carefully. Use the div element to wrap your hyperlinks.

Thanks.

Post count: 11

If we use <div class=”customlink”> –add link here–</div> around the link it starts from the new line which we don’t need cause links are inside the text. Is it possible not to break the line somehow?

Post count: 20688

Hi,


@Denis
Ugryumov Then don’t use a div tag. WordPress ads span tags for links with style, you can use those instead of div tags and style the links as you want
https://www.screencast.com/t/PgLoOeJpcQ8A

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.