" + html; } html = html.replace("",""); html = html.replace("",""); html = html.replace("",""); html = html.trim(); doc.innerHTML = html; return ( doc.innerHTML.toLowerCase() === html.toLowerCase() ); } function codeCheckWarningClose() { document.getElementById("codeCheckWarning").style.display = "none"; } function codeCheckCorrectClose() { document.getElementById("codeCheckCorrect").style.display = "none"; }
Menu
×
×
Correct!
Exercise:Change the color of the first <p> element that is directly after a <div> element, to "red".
<style>
@(7) {
color: red;
}
</style>
<body>
<div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
<style>
div + p {
color: red;
}
</style>
<body>
<div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
<style>
div+p {
color: red;
}
</style>
<body>
<div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
<style>
div+ p {
color: red;
}
</style>
<body>
<div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
<style>
div +p {
color: red;
}
</style>
<body>
<div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</div>
<p>This is a paragraph.</p>
<p>This is a paragraph.</p>
</body>
Not CorrectClick here to try again. Correct!Next ❯ |
This will reset the score of ALL 138 exercises.
Are you sure you want to continue?