In Blogger, How Do I Make Links Underlined Only Inside Posts

1.8k views Asked by At

I see there's this tag in Blogger:

a:link {
  text-decoration:none;
  color: $(link.color);
}

a:visited {
  text-decoration:none;
  color: $(link.visited.color);
}

a:hover {
  text-decoration:underline;
  color: $(link.hover.color);
}

But if I change a:link to text-decoration:underline, then EVERY link in the entire blog becomes underlined which is not what I intended. I just need links inside articles/posts to be underlined. Everything else stays the same.

1

There are 1 answers

3
m4n0 On BEST ANSWER

You can target the links inside the posts using descendant selector.

.post-body a:link {
  text-decoration: underline;
}

In the above code, replace .post-body with the ID/Class of the article/post. Most probably it is .post-body by default.