Top "Css-selectors" questions

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

Determining whether jQuery has not found any element

I'm using jQuery's selectors, especially id selector: $("#elementId")... How should I determine whether jQuery has found the element or not? …

jquery css-selectors
Using querySelector with IDs that are numbers

From what I understand the HTML5 spec lets you use IDs that are numbers like this. <div id="1">&…

javascript html css-selectors selectors-api
Changing CSS pseudo-element styles via JavaScript

Is it possible to change a CSS pseudo-element style via JavaScript? For example, I want to dynamically set the color …

javascript css css-selectors pseudo-element selectors-api
IE8 :nth-child and :before

Here is my CSS: #nav-primary ul li:nth-child(1) a:after { } Works everywhere now (used this on my website) except Internet …

css internet-explorer-8 css-selectors
CSS Selector for not a child of element type?

I want to style code elements that are not inside a tags. What is the best approach to accomplish this? …

css css-selectors
:hover but :not on a specific class

How do I apply a hover effect on an a element, but not to an a element with the class …

html css css-selectors
css3 nth of type restricted to class

Is there any way to limit css3's nth-of-type to a class? I've got a dynamic number of section elements …

css css-selectors pseudo-class
Immediate Child selector in LESS

Is there anyway to have LESS apply the immediate child selector ( > ) in its output? In my style.less, I …

css css-selectors less
Vertically centering content of :before/:after pseudo-elements

I'm trying to achieve something similar to this picture: I have an image (as part of a slideshow) wrapped in …

css css-selectors pseudo-element
jquery selector can't read from hidden field

(answers aggregated into another question) The following jquery 1.3.2 code works: <input type="select" value="236434" id="ixd" name='ixd' /> &…

jquery forms css-selectors element hidden