input element css

In my css I've added a border to all input fields. This is fine for text input but if I want button input fields to retain their default styling is there anyway to do that after having set a border for all inputs?

I want to avoid having to add a class for text inputs, I just want to add a class for button inputs to reset their styling.
LVL 1
ncwAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ZadoConnect With a Mentor Commented:
Try this in your css:

input:not(input[type=button]) {
 // your code here
}

Open in new window


it will affect all input fields except buttons.
0
 
BadotzConnect With a Mentor Commented:
Use the <button> tag instead of <input type="button">
0
 
ZadoCommented:
...you can play with attribute selectors, you can style for example only text fields and textarea:

input[type=text],
textarea  {
 // your code here
}

Open in new window


etc...
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
scrathcyboyCommented:
CSS is cascading -- so put --

INPUT.TEXT first with border, then
INPUT.IMG second with no border
0
 
ncwAuthor Commented:
I didn't realise you could use this syntax in css, seems to work. Thanks.
0
 
BadotzCommented:
No worries - glad to help.
0
 
ZadoCommented:
No problem, thanks for points :-)
0
All Courses

From novice to tech pro — start learning today.