CSS Code


#1

Can someone please show the format or syntax for the code in: CSS Selectors - Can you swing it?
Apparently I'm stuck


#2

No, we can't. If you read the guidelines, you will find giving and posting full answers is not allowed, however, if you post your code we can help you


#3

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


#4

That's the CSS code. I think I got lost on what to do. I really need help...
These were the instructions:

01
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.)

02
Make the introduction paragraph and the summary paragraph have a font-weight of bold (this is a new property for you, but it works just like the others you've learned).

03
Make the synopsis paragraph have the color #7AC5CD.

04
Make the paragraphs in the unordered list have the color #000000 and text-decoration underline.


#5

(i know the instructions, i didn't have to look in the exercise). Give all paragraphs a font-family of Garamond, you did that nicely:

p {
    font-family: Garamond; 
}

now, i am going to strip the html code a bit:

<body>
  <p>introduction</p>
  <div>
    <p>synopsis</p>
    <ul><li><p>some text</p></li><!-- times 3 --><ul>
  </div>
  <p>summary</p>
</body>

if you look in the exercise, you will see that each word of the paragraph describes the paragraph. So, we can use > to select children, as you can see in this barebone version of the code, introduction and summary paragraph are direct child of body, synopsis paragraph is a direct child of div.

Your unordered list is not nested in a paragraph, you want to select the paragraphs inside your list tags. Hope this helps, try again, if you are still stuck, post a updated version of your code, i will help you further


#6

Sorry to disturb again but one more question.
If INTRODUCTION and SUMMARY are a direct child of the HTML BODY.

:evergreen_tree:and I set the tags like this:

body p{
font-weight: bold;
}
it affects the DIV tags as well, so how do I input it to prevent it from affecting the DIV tags?

:evergreen_tree: and I set the tags like this:

div p{
font-weight: bold:
}

everything but the INTRODUCTION and SYNOPSIS went bold.

This is the full code:
p {
font-family: Garamond;
}
body p {
font-weight: bold;
}

Please, pls help. I am really finding it frustrating.


#7

if you do:

body p { font-weight: bold; }

every paragraph nested somewhere in body will be bold, however if you do this:

body > p { font-weight: bold; }

only paragraph which are a direct child of body (nested directly in the body) will be affected, this explained in this exercise (read the left column), you will need > to select your introduction and summary paragraphs. You will also need > to target your synopsis paragraph


#8

Nevermind, nevermind! I've finaly gotten how to do it! Thanks for your time stetim94, I appreciate it!

I feel like I'm in heaven...
:fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::fireworks::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note::musical_note:


#9

That is even better, figuring out how things work yourself is even better. You're welcome :smile: