One particular HTML block is causing me some trouble:
<h2><span class="numbers">1.1 </span>header text</h2>
It's important to note that I did not write this HTML code, so my options for changing it are limited. However, I can apply some CSS styling.
My goal is to underline the text "header text" without affecting the 1.1.
When attempting to achieve this with CSS and using
h2 {text-decoration: underline;}
The entire line gets underlined, which poses a challenge since I cannot override the text-decoration of h2. This has left me unsure how to proceed.
(An example of the issue is presented below)
h2 { text-decoration: underline; }
span { text-decoration: none; }
<h2><span class=numbers>1.2 </span>header text</h2>