Click to See Complete Forum and Search --> : newbie question


yardleybates
06-27-2003, 02:02 PM
We are using stylesheets in our site.
We have a class set up that describes a particular type of page and currently sets the background and font color.
I want to add additional elements to this style definition for the input, select and textarea objects.
Can I do this? If so, how?
I have tried
input.font-family:arial;
etc
and no apparent affect.

If I add the style tags inline they work fine.

Charles
06-27-2003, 02:09 PM
You are confusing selectors with properties. See http://www.w3.org/TR/REC-CSS1.

toicontien
06-27-2003, 11:47 PM
You could try the following code:


input {
font-family: Arial, Helvetica, Sans-serif;
font-size: 80%;
color: #cfc;
background-color: black;
}


You kind of get the picture. You don't need the font-size, color and bgcolor properties in there if you don't want. To affect text areas, just add the bold face text:



input, textarea {
font-family: Arial, Helvetica, Sans-serif;
font-size: 80%;
color: #cfc;
background-color: black;
}


The link that Charles posted above really is the best place to learn CSS, though it's not geared for beginners. People with programming experience of some sort will catch on the quickest, though CSS doesn't really involve programming. You could also try http://www.w3schools.com/ for some of the beginning stuff, and even http://www.alistapart.com/ for more advanced CSS and its practical applications.