Top "Css-selectors" questions

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

How to write :hover condition for a:before and a:after?

How to write :hover and :visited condition for a:before? I'm trying a:before:hover but it's not working

css css-selectors pseudo-element pseudo-class
CSS selector for text input fields?

How can I target input fields of type 'text' using CSS selectors?

html css forms css-selectors html-input
How can I style even and odd elements?

Is it possible to use CSS pseudo-classes to select even and odd instances of list items? I'd expect the following …

html css css-selectors
How to write a CSS hack for IE 11?

How can I hack or write css only for IE 11? I have a website that looks bad in IE 11.I …

css css-selectors internet-explorer-11 css-hack
jQuery first child of "this"

I'm trying to pass "this" from a clicked span to a jQuery function that can then execute jQuery on that …

javascript jquery jquery-selectors css-selectors
CSS selector based on element text?

Is there a way to select an element in css based on element text? ie: li[text=*foo] <li&…

css css-selectors
Which characters are valid in CSS class names/selectors?

What characters/symbols are allowed within the CSS class selectors? I know that the following characters are invalid, but what …

css css-selectors
Is there a CSS selector for the first direct child only?

I have the following html <div class="section"> <div>header</div> <div> …

html css css-selectors
Select elements by attribute in CSS

Is it possible to select elements in CSS by their HTML5 data attributes (for example, data-role)?

css html css-selectors custom-data-attribute
Can I apply a CSS style to an element name?

I'm currently working on a project where I have no control over the HTML that I am applying CSS styles …

html css css-selectors