CSS

CSS Intro

CSS Intro Quiz

CSS Intro Exercise

CSS Basic

CSS Basic Quiz

CSS Basic Exercise

CSS Advance

CSS Advance Quiz

CSS Advance Exercise

CSS3

CSS3 Quiz

CSS3 Exercise

CSS Properties

CSS Functions

CSS Selectors

CSS element1~element2 Selector

CSS element1~element2 Selector

 

 

The element1~element2 selector is used to match the occurrence of element2 that is preceded by element1. Both should have the same parent. However, element2 does not have to be immediately preceded by element1.

 

Syntax:-

 

Its syntax is:-
element ~ element {
  css declarations;
}

Code Explanation

All Tutorials related to CSS Selectors

All Sections related to CSS