Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a input submit button with flat look?

Tags:

Here I have a submit button:

<input type="submit" value="submit" /> 

The white button on the right side

And I want to add some additional styles to make it a flat look:

input {     border: 0;     background: none;     -webkit-appearance: none; } 

This is how it looks afterwards: The button has the same background-color as its background

However, if you look carefully, there is still some border on the top of the submit button...... Is there some way to remove the sunken or raised surface and make it a plain flat look?

like image 699
Karl Bao Avatar asked Dec 31 '15 08:12

Karl Bao


People also ask

How do you style a submit button?

you can style the Button as you wish. In the same way as in the previous answers, you can pimp your button selecting it using the input[type="submit"].

How do you make a button appear flat in CSS?

You will need to set border, box-shadow and background to 0/none to remove any greyish appearance as seen on button. Then to remove the rounded corners set border-radius to 0px. Show activity on this post.

How do you customize a submit button in CSS?

The simplest way to do this is by using the WordPress CSS Editor. To open this, go to Appearance » Customize and select Additional CSS. Once you've opened the Additional CSS section, you can paste in your new CSS, click the Save & Publish button, and you're all set!


2 Answers

You will need to set border, box-shadow and background to 0/none to remove any greyish appearance as seen on button. Then to remove the rounded corners set border-radius to 0px.

Rules are :

input[type="submit"]   /* Or better yet try giving an ID or class if possible*/ {  border: 0;  background: none;  box-shadow: none;  border-radius: 0px; } 
like image 59
HalfWebDev Avatar answered Oct 25 '22 14:10

HalfWebDev


outline: none; would be my first guess.

And also you would probably want to remove the :focus state and :hover state as so

input[type="submit"]:focus { background:none; outline: none; border:none; }   input[type="submit"]:hover { background: none; border: none; outline: none; box-shadow: none; } 

this makes it so when it is pressed, it won't have an emphasized outline.

if it doesn't work try removing other styles such as box-shadow:none;, border-radius:none;.

like image 43
Itamar Gronich Avatar answered Oct 25 '22 13:10

Itamar Gronich