Attribute selector styling

I need help styling using the attribute selector
Most browsers inject their own default CSS properties and values for different elements. If you look closely, you might be able to notice the file input is smaller than the other text input elements. By default, a padding of 1px 2px is given to input elements you can type in.

Using another attribute selector, style the input with a type of file to be the same padding as the other input elements.
This is my code

input[file]{padding:1px 2px;}

why is it not collect? Please help

You’re really close!

You’re missing something in the type selection so that the CSS knows what it’s looking for.

Try it with

input[type=file] {
   padding: 1px 2px;
}
1 Like

Here are some links as well:

1 Like

oooh those are nice, I’m gonna bookmark them, thanks!

MDN is amazing.

I added another one from w3schools which is a single page of the selectors. It can be handy for quickly finding the selector type you are looking for without having to dig for it.

1 Like

i love w3schools, it’s pretty much exclusively where i check when i am real confused. They have amazing breakdowns

It’s still not working please

@Dan2006 If this is for a challenge, please link to it and post all your code.

1 Like

Thanks for your resource input here @lasjorg ! I’m having the same problem with this challenge. https://www.freecodecamp.org/learn/2022/responsive-web-design/learn-html-forms-by-building-a-registration-form/step-55

“You should use an attribute selector to style the input element.” Here is my current code, if you have any advice:

input[type="file"]  {
  padding: 1px 2px;

}

The CSS you have posted passes the test for me.

1 Like

Interesting. Reset it. Thanks.