Problem with id selector


#1

I was placing the id selector just where the comment said and it didn’t work then when I pressed get code it inserted the id selector and add some strange stuff inside it here is the code. In the isntructions we weren’t told to adjust the element we were told to just add an id selector and what is that top and width things ?

#header-text {
  margin: 0 auto;
  position: relative;
  text-align: center;
  top: 25%;
  width: 60%;
}

#2

Yes, we just needed to add the id selector to the unassigned CSS rule.

The MDN web docs should have some good information on that:

top CSS property

width property


#3

What about my main question ? I mean was these styles already there and I just should have added the #header-text {} before them just this or should I have added the styling too ?


#4

They were already there. We just needed to add the id selector to the unassigned CSS rule.


#5

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