-2

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>
  • 1
    What have you tried ? This is extremely simple CSS 101 type of stuff, and sounds like homework – j08691 Sep 04 '20 at 19:17

1 Answers1

0

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>
Lionel Rowe
  • 5,164
  • 1
  • 14
  • 27