8. Can you swing it?


#1

Hi,

I'm not sure that I correctly understood the aim of the div > p thing.

Could you please elaborate in order to me to have it clear

How can I select only the "synopsis" and "summary" section because they are as well as outside of the div (above and below)

My CSS code
p
{
font-family: Garamond
}

div p
{
font-weight:bold;
color:#7ac5cd
}
ul p
{
color:#000000;
text-decoration: underline
}

Thanks for your help


#2

Using .container > h1 makes your CSS more specific and as a result of the Cascading nature would provide further weight to this styling.. Such as :

.container > h1 { background-color: Blue; }


h1 { background-color: Red; }

Even tho h1 {...} is after.container > h1{...} ; because it is a direct child of it's parent ( We know this because you're using selector > selector ) the background of the h1 would be Blue :school_satchel:

The > tells CSS to only target h1's that are a direct child of the .container.. Thus your CSS won't effect h1's later down your page :smiley:


#3

Can you link me to the challenge so I can see what you mean specifically re

How can I select only the "synopsis" and "summary" section because they are as well as outside of the div (above and below)


#4

Here's the link:
https://www.codecademy.com/courses/web-beginner-en-WF0CF/1/4?curriculum_id=50579fb998b470000202dc8b

But I still have the error message
could you please help, I try to type the ">" for H1 that I added to my Html but still not
p
{
font-family: Garamond
}

div p
{
font-weight:bold;
color:#7ac5cd
}
h1 > p
{
font-weight:bold;
color:#7ac5cd
}
ul p
{
color:#000000;
text-decoration: underline
}


#5

You have 3 children under <body>. 1st is your Introduction, 2nd is your div that contains the Synopsis, and 3rd is your Summary.
This lesson tells you to target your Synopsis (which I see you did) and your Introduction/Summary needs to be bolded. Since both your paragraphs (p) for your Introduction/Summary are direct children of body, simply do this:

body > p {
    /*insert style here*/;
}

If you really want to just target Summary(3rd child of body), this is the selector to use:

body > :nth-child(3){
     /*insert style here*/;
 }

And Introduction would be:

body > :nth-child(1){
     /*insert style here*/;
 }

Psst You don't need that h1>p part.


#6

Thanks, I think that I got it now


#7

Let me know if you have any other questions.


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.