× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Select element based on applied property

Zach Saucier
May 19, 2015
<p>You can't select non-inline properties in CSS, so something like <code>div[visibility:visible]</code> wouldn't work unless you explicitly stated the property inside the style attribute for the element.</p> <p>The best way to select an element like this is to select the <em>class</em> with the styles applied to it (if there is one).</p> <pre><code>.title + .visible { background-color:yellow; } </code></pre> <p>If this isn't the case, you should almost always use JavaScript.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/27139224/Select%20element%20based%20on%20applied%20property/27139245">Stack Overflow</a>.</p>
comments powered by Disqus