[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

input element css

Posted on 2010-11-23
7
Medium Priority
?
391 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 400 total points
ID: 34198633
Use the <button> tag instead of <input type="button">
0
 
LVL 8

Accepted Solution

by:
Zado earned 1600 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Suggested Courses

834 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