JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<div>This div has no class, or id</div>
<div class="test">This div has a class, but no id</div>
<div id="testing">This div has no class, but has an id</div>
<span>This span has no class, or id</span>
<span class="moreTesting">This span has a class, but no id</span>
<span id="spanTesting">This span has no class, but has an id</span>

CSS

div, span {
    /* hides _all_ div and span elements */
    display: none;
}

div[id],
div[class] {
    /* shows those div elements that have an id or a class */
    display: block;
}

span[id],
span[class] {
    /* shows those span elements that have an id or a class */
    display: inline;
}