I need to style h2 tags in HTML documents that have an id attribute, without styling the ones without an id. I want to achieve this using only CSS and not by modifying the HTML structure.
Specifically, I want to target these h2 elements with a CSS rule:
<h2 id="one">
<h2 id="two">
but I do not want to target h2 elements like this:
<h2>
Is there a CSS selector that would allow me to do this, such as:
h2#[*] { font-size: 12pt}
I've tried searching for a solution on various websites but haven't had any luck so far. Any help would be greatly appreciated. Thanks, MB