Solved

input element css

Posted on 2010-11-23
7
379 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
This article discusses how to create an extensible mechanism for linked drop downs.
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 embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

747 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

13 Experts available now in Live!

Get 1:1 Help Now