Solved

input element css

Posted on 2010-11-23
7
381 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:ncw
7 Comments
 
LVL 29

Assisted Solution

by:Badotz
Badotz earned 100 total points
ID: 34198633
Use the <button> tag instead of <input type="button">
0
 
LVL 8

Accepted Solution

by:
Zado earned 400 total points
ID: 34200395
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
 
LVL 8

Expert Comment

by:Zado
ID: 34200451
...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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 44

Expert Comment

by:scrathcyboy
ID: 34201049
CSS is cascading -- so put --

INPUT.TEXT first with border, then
INPUT.IMG second with no border
0
 
LVL 1

Author Closing Comment

by:ncw
ID: 34201754
I didn't realise you could use this syntax in css, seems to work. Thanks.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 34201786
No worries - glad to help.
0
 
LVL 8

Expert Comment

by:Zado
ID: 34201839
No problem, thanks for points :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now