Jump to content

CSS Buttons


neex1233

Recommended Posts

I would like the following code to apply to all of the buttons on my page without having to use the class="button".

 

The code:

input:button {

  color:#050;

  font: bold 84% 'trebuchet ms',helvetica,sans-serif;

  background-color:#fed;

  border: 1px solid;

  border-color: #696 #363 #363 #696;

}

 

Thanks.

Link to comment
Share on other sites

by that do you mean that you only want the button styled, or do you want the forms styled as well ?

 

if you want all the form styled like the button, you can use

 

input {
  color:#050;
  font: bold 84% 'trebuchet ms',helvetica,sans-serif;
  background-color:#fed;
  border: 1px solid;
  border-color: #696 #363 #363 #696;
}

 

either that or you could use something like the <p> or <em> etc tags like this to be more specific to the form button

 

  p input {
  color:#050;
  font: bold 84% 'trebuchet ms',helvetica,sans-serif;
  background-color:#fed;
  border: 1px solid;
  border-color: #696 #363 #363 #696;
}

 

<p><input name="" type="button" /></p>

 

but in all honesty. I cannt think offhand of any good reason why someone would not want to use a class when it makes it easier on you, I can virtually guarantee one thing, how I have shown you there is quite possibly the only way to avoid a class as the 'type' cannot be referenced in the css unfortunately ( I could be wrong, but im sure im not )

Link to comment
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.