1

Is it possible (and if so, how) to target only the text in an <a> tag? When I inspect it and hover over it it show #text even if I didn't assign any ID. But also I can't figure out how to target this #text.

What I want to achieve: On hover underline only the text, but not the arrow next to it. I also tried the not selector but had no luck with it.

The has to be in the <a> so the user can also click the arrow. Unfortunately I have no access to wrap the text in a span or something else.

.class_A {
  text-decoration: none;
}
.class_A:hover {
  text-decoration: underline;
}
.class_B:before {
  content:">"
}
<a href="#" class="class_A">Some Text
  <i class="class_B">
  </i> 
 </a>
  
jona
  • 354
  • 4
  • 17
  • you can span your tag –  Nov 24 '20 at 13:47
  • A solution without moving out the `` tag will always be a little hacky imo. Why can't you move it out? Maybe work on this? – Deitsch Nov 24 '20 at 13:50
  • @ShayanKanwal I can't edit the html. It's cms generated content and I don't have access to the core files, only css, js etc. – jona Nov 24 '20 at 13:56

0 Answers0