A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.w3resource.com/html-css-exercise/adjacent-sibling-selectors.php below:

Website Navigation


HTML CSS Exercise Sibling: Adjacent sibling selectors

HTML CSS Exercise - Adjacent sibling selectorsLast update on June 20 2025 13:03:11 (UTC/GMT +8 hours) HTML CSS Exercise - 33

In this exercise you will use CSS Adjacent sibling selectors.

Though the solution provided uses ul and ol element, you may use any element of your choice.

HTML Code:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>HTML CSS Exercises - Adjacent sibling selectors</title>
</head>
<body>
<h2>This is heading Two </h2>
<h3>This is heading Three </h3>
<p>This is a paragraph</p>
<h3>This is heading Three again</h3>
<p>This is a paragraph again</p>
</body>
</html>

CSS Code:

h2 + h3 {
border-bottom:1px solid silver
}

See the solution in the browser

Go to:

PREV : CSS Child selector.
NEXT : Style placeholder text.

Use the following editor to complete the exercise.

See the Pen html css common editor by w3resource (@w3resource) on CodePen.


What is the difficulty level of this exercise?

Test your Programming skills with w3resource's quiz.




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4