CSS Code Challenge: Step 6

Hello, I have been using Codecademy for about 2 weeks now and I’m afraid there’s something I’m not seeing in the “CSS Code Challenge: Step 6/12”. Link:


My code snippet:

input[type=text] {
text-align: center;
width: 90%;
margin: 0 auto;

Doesn’t seem to be meeting the requirements for the challenge as I keep being returned a:
" Did you add a CSS input selector inside style.css ?"
Error when I attempt to run it. I’m not sure if there is some minor detail that is missing from my code to make the lesson accept it, or if I am fundamentally not grasping what the lesson is asking of me. I would appreciate any insight. Thank you.

It wants to restrict it to just text inputs? Or all inputs?

If the latter, try changing your selector to input{} (removing the text type).

From a style guide perspective, we should not center align input fields but leave them with the default alignment (left). This is a usability and accessibility concern.

Agree with the above reply that suggests not using the attribute selector. Moot, now.

I attempted your suggestions, but to no avail unfortunately. I appreciate the help. Also, the center alignment was part of the assignment. In the assignment you are to essentially surgically remove the style settings from an HTML document, and compensate for their removal via CSS.

1 Like

UPDATE: Still not sure exactly what happened, but I copied all of my code, closed the browser, then re-opened the exercise and pasted the code back. Low and behold, it worked. So I’m not sure what happened, but I thank you for your help.