I can't figure out what I am doing wrong on the Can You Swing It? lesson

I am not sure how to make just the synopsis and the introduction bold, and I cannot seem to get the code right no matter what I have tried. I think I got very turned around. Can someone please correct my code? Thank you.

p {
font-family: Garamond;
}
body > p {
font-weight: bold;
}

div > p {
color: #7AC5CD;

div ul < p {
color: #000000;
text-decoration: underline;

you are missing a closing bracket in the div > p :relaxed:

beside what cssblaster already set, < is valid in this line: div ul < p . remove it

this code is NOT correct, it will make all paragraphs bold, not just introduction and summary like the exercise wants

Only managed to work it out, after properly getting to grips with the child parent thing This is what I went with

p {
font-family: Garamond;
font-weight: Bold;
}

p {
color: #7AC5CD
}

li > p {
color: #000000;
text-decoration: underline;
}

Idk. This worked for me… Several ways to do it?

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

1 Like

@nocolong and @tagsurfer10592 there is one to do this exercise prefect, but i am afraid both your ways aren’t perfect, let me explain why (i know, the codes will pass the exercise, i already complained that SCT needs to be improved)

nocolong, let’s start with your code:

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

first off, all your paragraphs are bold now, the introduction and summary paragraph are direct children of body (so you need body > p as css selector)

now, div p { color: #7ac5cd; ) will also color the paragraphs in the list (this will be overwritten by ul p {color: #000000;} but lets say we want to target the synopsis paragraph, which is a direct child of div, what is the css selector we need? You are going to need the > symbol.

tagsurfer, your code has the exact same problem, except that p { color: #7AC5CD} will color all paragraphs, so introduction, summary and synopsis (and the paragraphs in the list will have color: #7AC5CD except it is overwritten by color: #000000)

1 Like

Thanks for talking the time to reply and also for the explanation much appreciated. It’s also helped to make the parent and child stuff clearer

Thank you the" >" solved my problem!

On the CSS tab, select only the h3 header nested inside three

s and change its color to red.
div
h3 {
color:red;
}
plzzz…help me out.

this question is related to exercise 8. Anyway, your h3 is nested in 3 divs, so you need 3 divs in your css selector as well

I don’t understand why i’m still getting this error??
please help me out :frowning:

I see multiply problems, but the error message is caused by the fact that you make your font-family Garamond, but on the next line, you make your font-family bold, but font-family is not the right property for the value bold

1 Like

Thanx buddy, I understood my mistake.
I missed all those tags in a hurry… :yum:

this code is working properly.
but i want to know if this is the right code what is asked in question?

This is exactly the code as required by the exercise

the very first instruction to this problem is
1.Make all p tags have a font-family of Garamond. (Do NOT use the universal selector for this! There’s a better way; see the Hint for help.)

and the code i have written

p{
font-family:Garamond;
}

now here is questions related to this.

1). Is the p i have used in this css is not a universal selector?
2) same program has given me error message many times (i.e font-family not set to Garamond) but after trying many time is got accepted. why?

no, * is the universal selector, that will select all elements.Don’t know, i would have to see the failure codes, but i assume you didn’t save those?

ok thank you for your help…!!!

I can’t just understand why my code is not working.

Can you advise?