Top "Css-selectors" questions

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

CSS negation pseudo-class :not() for parent/ancestor elements

This is driving me nuts: HTML: <div><h1>Hello World!</h1></div> …

html css css-selectors
Css specificity :last-child

I would like to use the following to target the last link (a) of the last ul inside my div. …

css css-specificity css-selectors
Hide element, but show CSS generated content

Is there a way of hiding an element's contents, but keep its :before content visible? Say I have the following …

html css css-selectors
Python Selenium - get href value

I am trying to copy the href value from a website, and the html code looks like this: <p …

python selenium xpath css-selectors webdriverwait
What is the difference between '>' and a space in CSS selectors?

What's the point using this syntax div.card > div.name What's the difference between this div.card div.name

css css-selectors
How to select all content between two tags in jQuery

I have a document with headings and unordered lists. How can I use JQuery to select a given heading (by …

jquery css-selectors traversal
Is :not(:hover) and :hover a safe way to hide accessible elements?

Sometimes it appears helpful to make certain page elements only visible on e.g. hovers. An example is stackoverflow's "feedback …

css hover css-selectors progressive-enhancement
Affecting parent element of :focus'd element (pure CSS+HTML preferred)

How can I change the background of a parent <div> when an <input> or <a&…

css focus css-selectors
how do I select a div with class "A" but NOT with class "B"?

I have some divs: <div class="A">"Target"</div> <div class="A B">"NotMyTarget"&…

css css-selectors