• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / Archives for combinators

combinators

CSS Combinators

Child Combinators > Greater than

Direct children of the form element

form > a{ }

Adjacent sibling combinator + Plus sign

Paragraphs that come immediately after any image

The adjacent sibling combinator (+) separates two selectors and matches the second element only if it immediately follows the first element, and both are children of the same parent element.

img + p { }

General sibling combinator ~ sign

Paragraphs that are siblings of and subsequent to any image

The general sibling combinator (~) separates two selectors and matches the second element only if it follows the first element (though not necessarily immediately), and both are children of the same parent element.

img ~ p {
   color: red;
 }

Filed Under: CSS Tagged With: combinators

Primary Sidebar

  • angular.io
© 2026 WP Flames - All Right Reserved