Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,20 +470,30 @@ The HTML:
Here is the CSS:

```css
/* Style the direct sibling anchor tag when a list item is hovered */
ul li:hover + a {
color: red;
/* The following example selects the first p element that immediately follows a div, and share the same parent: */
div + p {
background-color: yellow;
}
```

The HTML:

```html
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li><a href="#">Link</a></li>
</ul>
<div>
<p>Paragraph 1 in the div.</p>
<p>Paragraph 2 in the div.</p>
</div>

<p>Paragraph 3. After a div. This will be selected</p>
<p>Paragraph 4. After a div.</p>

<div>
<p>Paragraph 5 in the div.</p>
<p>Paragraph 6 in the div.</p>
</div>

<p>Paragraph 7. After a div. This will be selected</p>
<p>Paragraph 8. After a div.</p>
```

### Case Study: Practical Applications
Expand Down