adjacent sibling Combinator

adjacent sibling Combinator
CSS adjacent sibling Combinator reference
The CSS adjacent sibling combinator ( X + Y { } ) is used to target and style the first elements of a specified type if they happen to be preceeded by other specified elements.
CSS CODE EXAMPLE
<!DOCTYPE html>
<style type="text/css">
h3 + p {
    font-family:"Comic Sans MS", cursive;
    text-decoration:underline;
}
</style>
<h3>Some Stuff</h3>
<p>Stuff inside my paragraph...</p>
<p>Stuff inside my paragraph...</p>
<p>Stuff inside my paragraph...</p>
<h3>More Stuff</h3>
<p>Stuff inside my paragraph...</p>
<p>Stuff inside my paragraph...</p>
<p>Stuff inside my paragraph...</p>
 

Some Stuff

Stuff inside my paragraph...
Stuff inside my paragraph...
Stuff inside my paragraph...

More Stuff

Stuff inside my paragraph...
Stuff inside my paragraph...
Stuff inside my paragraph...

0 Response to "adjacent sibling Combinator"

Post a Comment