Selectors


#1

After every "< head >", or just on the first line, do I have to add:
selector {
property: value;
}

For Example:

1. selector {
2.    property: value;
3. }
4.
5. h1 {
6.     color: #8B1C62;
7. }

1. <head>
2. selector {
3.    property: value;
4. }
5.
6. h1 {
7.     color: #8B1C62;
8. } 
9. </head>

#2

what is your question? And which exercise is this? selector, property and value is just general syntax to show you how the syntax works, it shouldn't actually be used

And the css syntax should be placed in the css file (stylesheet.css), not inside the head


#3

On question 12, to get to the next question, I had to add

selector {
property: value;
}

in the CSS file under the head to pass.


#4

Its best if you can explain which part you are confused or don't understand as it will be easier for us to help you :slight_smile:

In the head tags you will have a link tag which will link your CSS to the HTML like so:

<head>
     <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
</head>

*Inside your index.html file


In the stylesheet.css file you put in your CSS

selector {
property: value;
}

^The above shows the label and syntax, adding that to your code will do nothing,
lets go a step further example you wanted to add the background purple to a paragraph take the same syntax and apply it:

p {
   background: purple;
}

Hope this clears your confusion


#5

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