With the negation pseudo-class:
p:not(:first-child) { color: red; }
Browser support is very strong now, but alternatives include:
p { color: red; }
p:first-child { color: black; }
and:
* + p { color: red; }
More Related Contents:
- Is there a CSS parent selector?
- Complex CSS selector for parent of active child [duplicate]
- Select every Nth element in CSS
- CSS3 selector :first-of-type with class name?
- CSS Selector that applies to elements with two classes
- Why isn’t it possible to combine vendor-specific pseudo-elements/classes into one rule set?
- CSS selector based on element text? [duplicate]
- Should I avoid using !important in CSS?
- Pure CSS checkbox image replacement
- Handling a colon in an element ID in a CSS selector [duplicate]
- CSS selector for attribute names based on a wildcard
- IE8 :nth-child and :before
- CSS selector to select first element of a given class
- Can I use variables for selectors?
- What does the dot mean in CSS?
- CSS: styled a checkbox to look like a button, is there a hover?
- Are CSS3 ::before and ::after pseudo elements supported by IE9 or not?
- CSS Selector for
- How can I apply styles to multiple classes at once?
- Is it possible to select the last n items with nth-child?
- CSS property value from class name
- LESS CSS: abusing the & Operator when nesting?
- Angular 2: How to style host element of the component?
- How do I select an element only when inside another element?
- Should I use single colons (:) or double colons (::) for before, after, first-letter and first-line pseudo-elements?
- How do I apply a style to all children of an element
- What CSS selector can be used to select the first div within another div
- CSS Selector for not a child of element type?
- :last-child pseudo-class mixed with attribute selector not working
- Combine CSS Attribute and Pseudo-Element Selectors?