Top "Pseudo-class" questions

CSS pseudo-classes allow for more specific selection of elements within a document based upon an element's status, location in the DOM tree structure, user action, or other factors.

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
What is the difference between :focus and :active?

What is the difference between the :focus and :active pseudo-classes?

css css-selectors pseudo-class
How to select the first, second, or third element with a given class name?

How can I select a certain element in a list of elements? I have the following: <div class="myclass"&…

css css-selectors pseudo-class
CSS :selected pseudo class similar to :checked, but for <select> elements

Is there a way to style the currently selected <option> element in a <select> element? I …

html css css-selectors pseudo-class
Indent starting from the second line of a paragraph with CSS

How can I indent starting from the second line of a paragraph? I've tried p { text-indent: 200px; } p:first-line { text-indent: 0; } …

html css text pseudo-class indentation
CSS3 :unchecked pseudo-class

I know there is an official CSS3 :checked pseudo-class, but is there an :unchecked pseudo-class, and do they have the …

css css-selectors pseudo-class
Css pseudo classes input:not(disabled)not:[type="submit"]:focus

I want to apply some css for inputs elements and I want to do that only for inputs that are …

css css-selectors pseudo-class
How to position a CSS triangle using ::after?

I've created a div with a bottom arrow using ::after. Here is the HTML code: <div class="sidebar-resources-categories">…

css pseudo-class
CSS Pseudo-classes with inline styles

Is it possible to have pseudo-classes using inline styles? Example: <a href="http://www.google.com" style="hover:text-decoration:…

html css css-selectors pseudo-class inline-styles
heading with horizontal line on either side

I am working on some CSS where the design calls for page titles (headings) to be centered with horizontal lines …

html css pseudo-class