The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> CSS Help
|
CSS: 2 Input Styles
Discuss CSS: 2 Input Styles in the CSS Help forum on Dev Shed. CSS: 2 Input Styles Cascading Style Sheets (CSS) forum discussing all levels of CSS, including CSS1, CSS2 and CSS Positioning. CSS provides a robust way of applying standardized design concepts to your web pages.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

November 14th, 2002, 07:46 PM
|
|
|
|
CSS: 2 Input Styles
input{font-family: Arial; font-size: 14px; color: #000000; margin: 1px; padding: 2px; border: 1 solid #CCCCCC}
I want that for the submit buttons and radio buttons, and checkboxes and stuff. But I want
input{font-family: Arial; font-size: 14px; color: #000000; margin: 1px; padding: 2px; border: 1 dashed #CCCCCC}
for the textboxes... how do I do two?
|

November 14th, 2002, 07:54 PM
|
|
Senior Citizen
|
|
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019
Time spent in forums: < 1 sec
Reputation Power: 15
|
|
Read "The class Attribute" here.
|

November 15th, 2002, 08:28 AM
|
|
Contributing User
|
|
Join Date: Apr 2002
Location: Inside the GNU/Hurd kernel
Posts: 492
Time spent in forums: 2 h 1 m
Reputation Power: 12
|
|
|
It's very simple:
input[type="checkbox"]{font-family: Arial; font-size: 14px; color: #000000; margin: 1px; padding: 2px; border: 1 solid #CCCCCC}
input[type="submit"]{font-family: Arial; font-size: 14px; color: #000000; margin: 1px; padding: 2px; border: 1 solid #CCCCCC}
input[type="text"]{font-family: Arial; font-size: 14px; color: #000000; margin: 1px; padding: 2px; border: 1 dashed #CCCCCC}
|

November 15th, 2002, 11:00 AM
|
|
|
Are you sure Tuxie
Doesn't seem to work with IE6, Moz1.0 or NS7
It would be best to use classes anyway because most, probably all, browsers will support them.
|

November 15th, 2002, 12:08 PM
|
|
Contributing User
|
|
Join Date: Jan 2002
Location: Seattle WA
Posts: 863
  
Time spent in forums: 22 sec
Reputation Power: 13
|
|
|
It's important to note that Tuxie's example is proper, just that support for it still isn't exactly widespread. So for the mean time, it's a poor solution.
|

November 15th, 2002, 06:46 PM
|
|
CF sMod
|
|
Join Date: Jul 2000
Location: Maine, USA (a.k.a. Boonies)
Posts: 242
Time spent in forums: 6 m 43 sec
Reputation Power: 13
|
|
|
Tuxie's example works fine the in the following web browers:
Mozilla (Netscape 6+ and other similar browsers)
IE5/Mac
Opera 5+ (Maybe 6+)
and Konqueror (don't know version numbers)
|

November 15th, 2002, 07:56 PM
|
|
|
|
I tested Tuxies example in NS6.1, NS7 (Beta), Moz1.0 and it had no effect.
|

November 16th, 2002, 10:38 AM
|
|
Contributing User
|
|
Join Date: Apr 2002
Location: Inside the GNU/Hurd kernel
Posts: 492
Time spent in forums: 2 h 1 m
Reputation Power: 12
|
|
|
Like jkd and MJEggertson said,there's nothing wrong with my code,replace it with something like background-color:red and you will clearly see the input elements become red.
Also,all browsers,except for IE ofcourse,support this.
|

November 16th, 2002, 10:48 AM
|
|
|
Quote:
Also,all browsers,except for IE ofcourse,support this. |
Dosen't work in NS4.7 or Opera6 (identified as Opera or Moz5).
|

November 16th, 2002, 11:27 AM
|
|
|
|
.radio{font-size: 14px; margin: 1px; padding: 1px; border: 0}
.checkbox{font-size: 14px; margin: 1px; padding: 1px; border: 0}
.text{font-family: Arial; font-size: 14px; color: #000000; margin: 1px; padding: 2px; border: 1 dashed #CCCCCC}
But when I do the classes for each input thingy.. like for the textbox lets say. I would put class="text", and it doesn't work... why the hell not? LOL
|

November 16th, 2002, 12:53 PM
|
|
Contributing User
|
|
Join Date: Apr 2002
Location: Inside the GNU/Hurd kernel
Posts: 492
Time spent in forums: 2 h 1 m
Reputation Power: 12
|
|
Quote: Originally posted by degsy
Dosen't work in NS4.7 or Opera6 (identified as Opera or Moz5). |
NS4 doesn't support the W3C standards very well  Besides,we are talking about modern browsers,not browsers that are 4 years old.Or would you like to check if it works in Internet Explorer 2?
Opera has some quirks in the [attribute=value] thing,because only some attributes work.
|

November 16th, 2002, 12:54 PM
|
|
|
|
lol, but do you guys know my problem?
|

November 16th, 2002, 01:01 PM
|
|
|
|
oh.... so then, thats the image soruce.. nvm, thanks for the code!
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|