Top "Css-selectors" questions

Selectors are patterns that match against elements in a document tree.

Why does document.querySelectorAll return a StaticNodeList rather than a real Array?

It bugs me that I can't just do document.querySelectorAll(...).map(...) even in Firefox 3.6, and I still can't find an …

javascript dom css-selectors
CSS:after encoding characters in content

I am using the following CSS, which seems to be working: a.up:after{content: " ↓";} a.down:after{content: " ↑";} The …

css unicode css-selectors pseudo-element css-content
CSS attribute selector for non-empty attributes

Is there a CSS selector that applies to non-empty attributes? Using :not([Data-Attribute='']) matches if the attribute is non-existing, …

css css-selectors
Why use an attribute selector to match classes?

I have found an example of responsive email templates where there are such CSS selectors such as the following: a[…

css css-selectors
Differences between CSS3 :hover and :focus?

The CSS3 doc talks about :hover and :focus, which seem exactly the same to me. What are the differences between …

css focus hover css-selectors pseudo-class
Can you target an element with CSS only if 2 classes are present?

As you probably already know, you may have multiple classes on elements separated by a space. Example <div class="…

css css-selectors
Why does .class:last-of-type not work as I expect?

Why does this not work? http://jsfiddle.net/84C5W/1/ In fact, none of my <p> elements are …

html css css-selectors
IE: nth-child() using odd/even isn't working

My table (that works perfectly on Chrome, FireFox and Opera) is not displaying correctly on Internet Explorer. The background remains …

css internet-explorer css-selectors css-tables
Selenium Compound class names not permitted

I have the below code that clicks on an element to pop up a screen and copy the text in …

python selenium xpath css-selectors class-names