CSS attribute selector question

Tell us what’s happening:
So, the this step i was asked to create a css selector based on attribute. i chose the value attribute and i got an error and then it suggested me to use the type attribute. Is there a reason i shouldn’t have chosen the value instead of type?

Your code so far
my CSS folder

 input[value="submit"] {
  display: block;
  width: 60%;
}

the input in question

 <input type="submit" value="Submit" />

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.62 Safari/537.36

Challenge: Step 50

Link to the challenge:

Hi and welcome.

Pay attenttion to the value:

input[value="submit"] {
  display: block;
  width: 60%;
}
 <input type="submit" value="Submit" />

“Submit” and “submit” value are treated differently.

Although, the course suggested you to use type attribute instead of value.

Hello.
If you are reffering to the S being upper case it doesn’t matter, i tested it both ways. I rechecked the course and it doesn’t suggest anything.

Step 50Passed

To style the submit button, you can use an attribute selector, which selects an element based on the given attribute value. Here is an example:

input[name="password"]

The above selects input elements with a name attribute value of password .

Now, use the attribute selector to style the submit button with a display of block , and a width of 60% .

Thanks for your time :slight_smile:

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