3.ID Selectors: CSS

this what in index.html :

and i try to add a class selector for the ID " Header-text" i typed .header-text{} and #header-text {} and still have erorr please can you help me solve this ? how i can select class for ID header-text

I’m not sure what you are asking, but I’ll take a stab at it anyway.
If you’re asking how to target elements with a specefied id, format your CSS like this:

#yourID {

}

If you’re asking how to target elements with the class ‘header-text’ and a specified id, format your CSS like this:

.header-text#yourID {

}

I doubt this answered your question, please clarify it so I can give you a better response :slight_smile:

1 Like

thanks :slight_smile:
i solved it , the fault was in HTML code so instead we put

< div id="header-text > we must put : < div class="header"> < div class=header-text"> this website has too much faults in courses !

No problem, good luck with your future exercises!

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