w3resource
HTML exercises

HTML CSS Exercise: Adjacent sibling selectors

Solution:

HTML Code:


<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>HTML CSS Exercises - Adjacent sibling selectors</title>
<style type="text/css">
h2 + h3 {
border-bottom:1px solid silver
}
</style>
</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>

Live Demo :

See the Pen adjacent-sibling-selectors-answer by w3resource (@w3resource) on CodePen.


Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
YesYesYesYesYes

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming