How do I select the first line of ::after (::before)?

Viewed 31

How do I make the first line of ::after in bold?

I'm making a CSS snippet for Obsidian. I want to make a Dropdown for tags that start with '#-'. How do I make the first line bold?

I can't change HTML code:

<p>
  <a href="#-Dropdown" class="tag" target="_blank" rel="noopener">
    #-Dropdown
  </a>
</p>

Those CSS blocks don't even appear in the devtools:

a.tag[href^='#-']::after::content {
    font-size: 20px;
}

a.tag[href^='#-']::after::first-line {
    color: red;
}

A jsfiddle if you're willing to try yourself

0 Answers
Related