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
https://forums.phpfreaks.com/topic/173998-css-buttons/
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
https://forums.phpfreaks.com/topic/173998-css-buttons/#findComment-917328
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.