The Adjacent Sibling Selector : selector « Style Basics « HTML / CSS
HTML / CSS
The Adjacent Sibling Selector
An adjacent sibling selector matches an element type that is the next sibling of another.
h1 + p
Related examples in the same category
The Type Selector
The Class Selector
The ID Selector
The Child Selector
The Descendent Selector
Using Attribute Selectors to select different textfields
Using Attribute Selectors to choose anchor by link type
Using Attribute Selectors to choose only mailto anchor type
Using Attribute Selectors to choose linked file type for anchor
Using Attribute Selectors to choose php links
Using Dynamic Pseudo-Classes to change color
Using Dynamic Pseudo-Classes to add text decoration
Dynamic Pseudo-Classes: hover effect
Selectors and Grouping
Class Selectors: A class represents something that you can have more than one of.
chain together class names within the class attribute.
An id is used but once per document.
Universal selectors are wildcard selectors.
Next Sibling Selectors
Attribute Substring Selectors
Dynamic Pseudo-Class Selectors
Using Different Selectors to Apply Styles
First Child Pseudo-Selector
Before and After Pseudo Selectors
Style sheet for example demonstrating adjacent sibling and child selectors
paragraph with id selector
Direct Child Selectors
A specific selector wins, the last one wins
Select one item
direct adjacent sibling combinator
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.