9. CSS selecteur - exercice 13/23 (.fr)


#1

Hello !
I did the right code and have a good result but I receive the following message : "Oups, merci de réessayer.
Dans le HTML, avez-vous associé la classe standout au premier titre h3 ? "
yes I did it, please just have a look,

Please, can you tell me what's wrong on my following code ?
1) html :
--! mon html ci-dessous:





<body>
    <h2 id="intro">Introduction</h2>    
    <h3 id="standout">Classes et ID en CSS</h3>
    <p id="standout">Les classes et ID sont super faciles en CSS. Vous les utilisez en ce moment même !</p>

    <h3>Sélecteurs HTML basiques</h3>
    <p>Si vous ne vous voulez pas vous embêter avec les classes et les ID, un élément HTML
       obtient le syle CSS pour cet élément, ou le style par défaut si vous ne définissez pas de style particulier dans votre CSS.
    </p>
</body>

2) css :
/*mon CSS ci-dessous :

intro {

color:#B83C3A;

}

standout {

color:#F7AC5F;
font-family:Verdana;

} */
thanks in advance for answer

OK I see : i only make id (.id) or class (#) onbthe other code sheeft.


#2

you got a id:

<div id="idname"></div>

which in css you use a pound/number sign:

#idname { property: value; }

and you got classes:

<div class="classname"></div>

and in css you use a dot:

.classname { property: value; }

this was covered in the last two exercise, now the exercise ask you to use a class for the h3 element and paragraph, not id


#3

In the html you give the h2 an id called intro and you give the h3 an id called standout.
But in this exercise the id standout should be a class.

And in your CSS you handle "intro" as an normal html tag instead of a id.

A friendly reminder:
Id's:
HTML:

<div id="hello">I have an ID</div>

CSS:

    #hello {
        color: red;
   }

Classes:
HTML:

<div class="hello">I'm a class</div>

CSS:

.hello {
   color: red;
}

#4

Damnit stetim, I was taking my time writing :expressionless:


#5

seems like you understand it, what is the question?


#6

Ho sorry, yes !
before a sleep I saw my wrong !
so I got it !

now I surely need another sleep because I don't see where is my error in this 9;17/23 exercise :smile: verification giving this : "Oups, merci de réessayer.
Vérifiez que le second paragraphe a bien Tahoma (avec T majuscule) pour police
"
my CSS code is :
/*01*/
p:2nd-child {
font-family: Tahorma;
}
/*02*/
p:3rd-child {
color: #CC0000;
}
/*03*/
p:4th-child {
background-color: #00FF00;
}
/*04*/
p:5th-child {
font-size: 22px;
}


#7

can you plz give me the code for html css selectors 4. rock up selectors


#8

what did you do? the psuedo-clas you need is nth-child(x), x being the number of which what you want to target. Then there are two special ones: first-child and last-child, what you did doesn't make any sense


#9

Thanks @stetim94
Yes, I actualy forgot to use .classname and/or #idname

:blush: I need to play HAPPYneuron lol :wink:)