I need to add a selector in css to bold the paragraph adjacent to the goals_container id.
Html code looks like:
<body>
<main>
<div id="goals_container">
</div>
<p> This is what I want to access </p>
</main>
</body>
I need to add a selector in css to bold the paragraph adjacent to the goals_container id.
Html code looks like:
<body>
<main>
<div id="goals_container">
</div>
<p> This is what I want to access </p>
</main>
</body>
You need the +
(adjacent sibling) selector:
#goals_container + p {
background: tomato;
}
<body>
<main>
<div id="goals_container">
</div>
<p> This is what I want to access </p>
</main>
</body>