Jump to content

Recommended Posts

is it possible to apply style to objects that are of certain type?

 

So... if I only wanted to apply style to inputs, where the input type is a submit button, and NOT a checkbox, radio button, select box, and so on... How would I be able to do that?

 

I would also like to not use a class.

 

Is this even possible?

Link to comment
https://forums.phpfreaks.com/topic/55298-submit-button/
Share on other sites

this is called an attribute selector.  it will work, but only in those browsers that support it (it should be noted that IE does NOT support it, making it relatively useless):

 

input[type=submit]
{
  style here;
}

 

or

 

input[type=button]
{
  style here;
}

 

although you don't want to use a class, it might be your only option supported well enough to make it worthwhile.

Link to comment
https://forums.phpfreaks.com/topic/55298-submit-button/#findComment-273337
Share on other sites

you can give your inputs an id or class (class can be applied to mulitple elements on one page) and use that to style them. Admittedly its not as nice as the attribute selector but it does work in more browsers.

<input type="submit" class="bttn" name="submit" id="submit" value="Go" />

 

input.bttn
{
background: #ccc;
color: #333;
}

 

note that some browsers on mac os DON'T style buttons anything like what you'd expect!!!!

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/55298-submit-button/#findComment-273522
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.