Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you style html form buttons with css?

Tags:

html

css

forms

I don't like the default button style. It's really boring. I am using

<input type="submit"> 

type buttons. Can I style these somehow in css? If not, the other way of doing it i guess would be to use a div instead, and make it a link. How do you make those work with forms?

like image 458
Alex Mohr Avatar asked Feb 19 '13 05:02

Alex Mohr


People also ask

Can you style a button in HTML?

A style attribute on a <button> tag assigns a unique style to the button. Its value is CSS that defines the appearance of the button.

How do you customize a button in CSS?

This can be done by navigating to Appearance » Customize » Additional CSS. Then just click Save & Publish, and you're done.

Can I add a button with CSS?

You can also add buttons to your websites with the anchor tag. The anchor tag is primarily used to add links to your websites, but you can style it with CSS to look like an actual button. The advantage of this is approach is that you can link to a page without any JavaScript.


1 Answers

You can achieve your desired through easily by CSS :-

HTML

<input type="submit" name="submit" value="Submit Application" id="submit" /> 

CSS

#submit {     background-color: #ccc;     -moz-border-radius: 5px;     -webkit-border-radius: 5px;     border-radius:6px;     color: #fff;     font-family: 'Oswald';     font-size: 20px;     text-decoration: none;     cursor: pointer;     border:none; }    #submit:hover {     border: none;     background:red;     box-shadow: 0px 0px 1px #777; } 

DEMO

like image 52
Shailender Arora Avatar answered Sep 30 '22 05:09

Shailender Arora