• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / CSS / CSS 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

About Gabor Flamich

I'm a web developer and designer based in Budapest, Hungary. In recent years, I've documented hundreds of solutions I came across during development. This site is an archive for useful code snippets on WordPress, Genesis Framework and WooCommerce. If You have any questions related to WordPress development, get in touch!

Primary Sidebar

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