3 replies [Last post]
The Saint
Offline
newbie
Last seen: 18 years 15 weeks ago
Joined: 2004-04-26
Posts: 2
Points: 0

I want to style a submit button without adding any extra code in the input tag which creates the submit button.

The button is generated from an element in a content management and i can't add any code to it.
The closest option I have is putting a class in the td where it appears

I can change all input styles but that is not what I want.

Isn't there an option to do this: For example something like

input.submit { etc...

(only the code above doesn't work)

thanx for any help...

Tony
Tony's picture
Offline
Moderator
Brisbane
Last seen: 1 week 3 days ago
Brisbane
Timezone: GMT+10
Joined: 2003-03-12
Posts: 5344
Points: 2965

Styling a submit button without adding class or style in tag

Hi The Saint,
You could use Attribute Selectorsinput[type="submit"]{color:red;}
The only problem is the lack of support by most browsers.
So we need to find another method.
Is the button contained by anything apart from the form?
Or are the other input fields contained by something different?

co2
co2's picture
Offline
Leader
UK
Last seen: 14 years 17 weeks ago
UK
Joined: 2003-09-17
Posts: 721
Points: 0

Styling a submit button without adding class or style in tag

If you give its immediate parent element a class or id, such as the td, then you can use:

td.blah input
{
...
}

On the HTML:

<td class="blah">
<input type="submit" />
</td>

The next sentence is true. The previous sentence is false. Discuss...

The Saint
Offline
newbie
Last seen: 18 years 15 weeks ago
Joined: 2004-04-26
Posts: 2
Points: 0

Styling a submit button without adding class or style in tag

I think this is getting me somewhere... Laughing out loud

thanx for the fast respond.