Forum Moderators: not2easy

Message Too Old, No Replies

Apply style(s) based on attribute value

         

YorkshireSteve

9:45 am on Jan 16, 2004 (gmt 0)

10+ Year Member



Hi,

I've been playing around with CSS and I've figured out that I can apply a certain style to all

div
's in a
td
, or to all elements with a particular
id
. I want to change the default cursor from the arrow to the hand for all form buttons - but not to text fields etc...

Can I apply a style to

<input type="submit" name="Submit" value="Submit">

but not to

<input type="text" name="email_address" value="">

-- Without giving all my buttons a seperate

class
or
id
attribute?

Thanks,

Steve.

dcrombie

10:33 am on Jan 16, 2004 (gmt 0)



You need to wait for CSS2 to be supported:

INPUT[type="text"] {
width: 200px;
}

YorkshireSteve

10:48 am on Jan 16, 2004 (gmt 0)

10+ Year Member



Oh well - never mind! Cheers, dcrombie

domokun

3:00 pm on Jan 16, 2004 (gmt 0)

10+ Year Member



you could alwyas out the button inputs inside a div and then style them that way

<div id="whatever">

<input ...>

</div>

div input
{
width: 200;
}

this way, at least, you could get the desired affct with the minimum amount of code. then, when css2 is fully supported, simply remove the style for the div.

BlobFisk

3:20 pm on Jan 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



As pointed out, you'll have to wait until CSS3 for this. Other then using a class, as has been pointed out, containing all the form buttons in a <div> or <span> is the way to go.

It's worth mentioning that support for cursor: is sporadic.