styling buttons without CLASS

W

W. Paulisse

hello!

Is there a way to style ONLY a specific item without using a CLASS? For
example the following styles all input types (submit,reset,text,password
etc)

input{color: #000000; font-family: tahoma;font-size: 8pt;}

i would like for example JUST to style the types submit and/or reset but i
don't want to define a CLASS in my CSS to use in every <input> tag.
something like:

input:submit{color: #000000; font-family: tahoma;font-size: 8pt;}

Thanks,
Wouter
 
S

Steve Pugh

W. Paulisse said:
Is there a way to style ONLY a specific item without using a CLASS? For
example the following styles all input types (submit,reset,text,password
etc)

input{color: #000000; font-family: tahoma;font-size: 8pt;}

i would like for example JUST to style the types submit and/or reset but i
don't want to define a CLASS in my CSS to use in every <input> tag.
something like:

input:submit{color: #000000; font-family: tahoma;font-size: 8pt;}

input[type=submit] { styles }

Guess what? No support in IE.

Steve
 
J

Jukka K. Korpela

W. Paulisse said:
Is there a way to style ONLY a specific item without using a CLASS?

Yes. The safest method is to use the ID attribute. But why wouldn't you
use CLASS?
For example the following styles all input types
(submit,reset,text,password etc)

input{color: #000000; font-family: tahoma;font-size: 8pt;}

Well, it does, with the usual caveats. Quite a problem, isn't it?
A font size of 8pt is unreadable to hundreds of millions of people.
i would like for example JUST to style the types submit and/or reset

For reset buttons, the only sensible CSS declaration is, almost always,
display: none. But it is simpler and safer to remove them.
but i don't want to define a CLASS in my CSS to use in every <input>
tag.

You don't need to do that. Just define CLASS for the very element to which
you wish to assign some properties. For example, <input type="submit"
class="submit" ...> in HTML and
input.submit { font-size: 120%; }
in CSS. Of course, the class name need not be "submit".
something like:

input:submit{color: #000000; font-family: tahoma;font-size:
8pt;}

Well, you could check the specifications (and Steve did that for you), but
for styling just one element, using CLASS is the practical way. (You could
alternatively use ID, but if you later wish to add another button on the
page to be styled the same way, it's a little easier if you have used
CLASS.)
 
W

W. Paulisse

input[type=submit] { styles }
Guess what? No support in IE.

Steve


well, classes it is then....

that is acctualy the first time if encounterd that IE does not support a
feature like that.....
 
A

Adrienne

input[type=submit] { styles }

Guess what? No support in IE.

Steve


well, classes it is then....

that is acctualy the first time if encounterd that IE does not support a
feature like that.....

Another one - position:fixed (although there are hacks to work around it)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top