Suppose an HTML page contains this following style specification: div.special >
ID: 3864964 • Letter: S
Question
Suppose an HTML page contains this following style specification:
div.special > p {font-style: italic;}
Tell what elements, if any, in the example below will be formatted as italic because of this style rule. Explain why.
<div class=special” id=”e1>
<p id=e2>Little Red Riding Hood was walking through the
woods.</p>
<div id=e3>
<p id=e4>Little did she know the wolf was around the
bend.</p>
</div>
<p id=e5>Little Red Riding Hood continued to Grandma's
house.</p>
</div>
Explanation / Answer
Paragraphs with ids - e2 and e5 will be in italics.
Let's break down the css style applied to understand why, div.special selects all the div tag elements which also have class special attached to them. Secondly '>' is used to specify direct children. Therefore div.special > p selects all p tag elements which are direct children of div tags having class special which are p tags of id e2 and e5.
P.S. - the quotes used while specifying class class=special” do not match kindly correct that.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.