Which code segment should you add to the webpage?

You develop an HTML5 webpage. You have the following HTML markup:

You need to add a background color to the first article in each section.
Which code segment should you add to the webpage?

You develop an HTML5 webpage. You have the following HTML markup:

You need to add a background color to the first article in each section.
Which code segment should you add to the webpage?

A.
$ (“section article:first-child”).css(“background-color”, “#f2f2f2”);

B.
$ (“section:first-child”).ess ( “background-color”, “#f2f2f2”);

C.
$ (“article:first-of-type”) .css(“background-color”, “#f2f2f2”);

D.
$ (“section:first-of-type”).css(“background-color”, “#f2f2f2”);



Leave a Reply 7

Your email address will not be published. Required fields are marked *


anii

anii

And why is that? Why A doesn’t work? I think it should but it doesn’t. Why?

anii

anii

Oh, I think I know. H1 interrupts this

anii

anii

H1 is the first child.