CSS customization of 'Submit' button vs. button - html

I am having problems. The CSS code is identical for these two buttons, but the appearance is completely different. I can't get the :hover or the :active to work either.
I am trying to get the left 'input type="submit' button to look exactly like the 'a href=""' button. Any ideas?
Code example problem at JSFiddle : http://jsfiddle.net/aL6M6/7/
The css is exactly the same for .button-big and for .button-big-submit
Thanks!
.button-big
{
display: inline-block;
background: #ed391b;
color: #fff;
text-decoration: none;
font-size: 1.75em;
font-weight: 300;
padding: 15px 45px 15px 45px;
outline: 0;
border-radius: 10px;
box-shadow: inset 0px 0px 0px 1px rgba(0,0,0,0.75), inset 0px 2px 0px 0px rgba(255,192,192,0.5), inset 0px 0px 0px 2px rgba(255,96,96,0.85), 3px 3px 3px 1px rgba(0,0,0,0.15);
background-image: -moz-linear-gradient(top, #ed391b, #ce1a00);
background-image: -webkit-linear-gradient(top, #ed391b, #ce1a00);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ed391b), to(#ce1a00));
background-image: -ms-linear-gradient(top, #ed391b, #ce1a00);
background-image: -o-linear-gradient(top, #ed391b, #ce1a00);
background-image: linear-gradient(top, #ed391b, #ce1a00);
text-shadow: -1px -1px 1px rgba(0,0,0,0.5);
}
.button-big:hover
{
background: #fd492b;
box-shadow: inset 0px 0px 0px 1px rgba(0,0,0,0.75), inset 0px 2px 0px 0px rgba(255,192,192,0.5), inset 0px 0px 0px 2px rgba(255,96,96,0.85), 3px 3px 3px 1px rgba(0,0,0,0.15);
background-image: -moz-linear-gradient(top, #fd492b, #de2a10);
background-image: -webkit-linear-gradient(top, #fd492b, #de2a10);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fd492b), to(#de2a10));
background-image: -ms-linear-gradient(top, #fd492b, #de2a10);
background-image: -o-linear-gradient(top, #fd492b, #de2a10);
background-image: linear-gradient(top, #fd492b, #de2a10);
text-decoration: none;
}
.button-big:active
{
background: #ce1a00;
box-shadow: inset 0px 0px 0px 1px rgba(0,0,0,0.75), inset 0px 2px 0px 0px rgba(255,192,192,0.5), inset 0px 0px 0px 2px rgba(255,96,96,0.85), 3px 3px 3px 1px rgba(0,0,0,0.15);
background-image: -moz-linear-gradient(top, #ce1a00, #ed391b);
background-image: -webkit-linear-gradient(top, #ce1a00, #ed391b);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ce1a00), to(#ed391b));
background-image: -ms-linear-gradient(top, #ce1a00, #ed391b);
background-image: -o-linear-gradient(top, #ce1a00, #ed391b);
background-image: linear-gradient(top, #ce1a00, #ed391b);
}

First off, why did you create 2 different styles if they are supposed to be identical?
I put a CSS reset at the beginning and changed the input to button. It's almost identical now, maybe modify the lineheight.
Anyway, I helped you half the way http://jsfiddle.net/aL6M6/9/
border: none;

i noticed four problems.
you need to disable the border. border: none;
you have a typo in your ..button-big-sumbit:hover (thats why the hover does not work)
your padding in .button-big and .button-big-submit is different.
you set some styles for all inputs.
here is a working version: fiddle
#import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,300,200);
body {
/*background: #D4D9DD url('images/bg03.jpg');*/
background: #31393c url('images/bg04.jpg');
}
body, input, textarea, select {
color: #373f42;
font-size: 1.125em;
font-family: 'Yanone Kaffeesatz', Tahoma, Arial, Sans-serif;
/* font-family: 'yanone_kaffeesatzlight';
*/
line-height: 1.85em;
font-weight: 300;
}
.button-big {
cursor: pointer;
display: inline-block;
background: #ed391b;
color: #fff;
text-decoration: none;
font-size: 1.75em;
font-weight: 300;
line-height : 1em;
font-family: inherit;
border: none;
padding: 15px 45px 15px 45px;
outline: 0;
border-radius: 10px;
box-shadow: inset 0px 0px 0px 1px rgba(0, 0, 0, 0.75), inset 0px 2px 0px 0px rgba(255, 192, 192, 0.5), inset 0px 0px 0px 2px rgba(255, 96, 96, 0.85), 3px 3px 3px 1px rgba(0, 0, 0, 0.15);
background-image: -moz-linear-gradient(top, #ed391b, #ce1a00);
background-image: -webkit-linear-gradient(top, #ed391b, #ce1a00);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ed391b), to(#ce1a00));
background-image: -ms-linear-gradient(top, #ed391b, #ce1a00);
background-image: -o-linear-gradient(top, #ed391b, #ce1a00);
background-image: linear-gradient(top, #ed391b, #ce1a00);
text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.5);
}
.button-big:hover {
background: #fd492b;
box-shadow: inset 0px 0px 0px 1px rgba(0, 0, 0, 0.75), inset 0px 2px 0px 0px rgba(255, 192, 192, 0.5), inset 0px 0px 0px 2px rgba(255, 96, 96, 0.85), 3px 3px 3px 1px rgba(0, 0, 0, 0.15);
background-image: -moz-linear-gradient(top, #fd492b, #de2a10);
background-image: -webkit-linear-gradient(top, #fd492b, #de2a10);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fd492b), to(#de2a10));
background-image: -ms-linear-gradient(top, #fd492b, #de2a10);
background-image: -o-linear-gradient(top, #fd492b, #de2a10);
background-image: linear-gradient(top, #fd492b, #de2a10);
text-decoration: none;
}
.button-big:active {
background: #ce1a00;
box-shadow: inset 0px 0px 0px 1px rgba(0, 0, 0, 0.75), inset 0px 2px 0px 0px rgba(255, 192, 192, 0.5), inset 0px 0px 0px 2px rgba(255, 96, 96, 0.85), 3px 3px 3px 1px rgba(0, 0, 0, 0.15);
background-image: -moz-linear-gradient(top, #ce1a00, #ed391b);
background-image: -webkit-linear-gradient(top, #ce1a00, #ed391b);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ce1a00), to(#ed391b));
background-image: -ms-linear-gradient(top, #ce1a00, #ed391b);
background-image: -o-linear-gradient(top, #ce1a00, #ed391b);
background-image: linear-gradient(top, #ce1a00, #ed391b);
}

I added these modifications to your CSS
.button-big-submit {
display: inline-block;
background: #ed391b;
color: #fff;
text-decoration: none;
font-size: 1.75em;
line-height: normal;
font-weight: 300;
padding: 5px 15px 5px 15px;
outline: 0;
border: 0; /* here */
padding: 10px 40px; /*here*/
border-radius: 10px;
box-shadow: inset 0px 0px 0px 1px rgba(0, 0, 0, 0.75), inset 0px 2px 0px 0px rgba(255, 192, 192, 0.5), inset 0px 0px 0px 2px rgba(255, 96, 96, 0.85), 3px 3px 3px 1px rgba(0, 0, 0, 0.15);
background-image: -moz-linear-gradient(top, #ed391b, #ce1a00);
background-image: -webkit-linear-gradient(top, #ed391b, #ce1a00);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#ed391b), to(#ce1a00));
background-image: -ms-linear-gradient(top, #ed391b, #ce1a00);
background-image: -o-linear-gradient(top, #ed391b, #ce1a00);
background-image: linear-gradient(top, #ed391b, #ce1a00);
text-shadow: -1px -1px 1px rgba(0, 0, 0, 0.5);
}
Then, fixed a typo on .button-big-submit:hover and added cursor: pointer;
Updated fiddle: http://jsfiddle.net/aL6M6/12/

Related

How to put these buttons on the same line with CSS?

I have been working on this extension and I am trying to put these buttons in the same place but they look like this. They don't line up
.fversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: left;
float: left;
}
.sversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
float: center;
}
.tversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: right;
float: right;
}
2048
16384
65536
I am kind of new to CSS.
I would abandon the use of float and make them inline-block elements. Also, remove the vertical align - or make them all middle (left and right are not valid values for vertical align)
.fversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
display:inline-block;
}
.sversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
display:inline-block;
}
.tversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
display:inline-block;
}
2048
16384
65536
If you need to split them across the line, you can put them in a flex container:
.container { /* flex for even spacing */
display: flex;
justify-content: space-between;
}
/* shared styles - could use a class on each button for shared styles instead of repeating (i have just used the extra selector I made from the container) */
.container > a {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
-moz-box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
box-shadow: rgba(255, 255, 255, 0.4) 0 0px 0, inset rgba(255, 255, 255, 0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
display: inline-block;
<div class="container">
2048
16384
65536
</div>
there is no CSS like
float: center
which is written in .sversion-button class . you should replace it with
float: left.
I think it will take the button in the right position which you want.
You need to remove float center and making chnages in html and css,you will get this
.fl1{
float:left;
width:33.33%;
margin:5px auto;
}
.fl2{
float:left;
width:33.33%;
text-align:center;
margin:5px auto;
}
.fl3{
float:left;
width:33.33%;
text-align:right;
margin:5px auto;
}
.fversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
}
.sversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
}
.tversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: right;
}
<div class="fl1">
2048
</div>
<div class="fl2">
16384
</div>
<div class="fl3">
65536
</div>
add display:inline-block; for tag a and set all buttons to float:left
a{
display:inline-block;
}
.fversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: left;
float: left;
}
.sversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
float: left;
}
.tversion-button {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: right;
float: left;
}
2048
16384
65536
/* Replace all css with this one css for all buttons */
.demo_btn {
border: 2px solid #8f7a66;
background: #8f7a66;
background: -webkit-gradient(linear, left top, left bottom, from(#8f7a66), to(#8f7a66));
background: -webkit-linear-gradient(top, #8f7a66, #8f7a66);
background: -moz-linear-gradient(top, #8f7a66, #8f7a66);
background: -ms-linear-gradient(top, #8f7a66, #8f7a66);
background: -o-linear-gradient(top, #8f7a66, #8f7a66);
background-image: -ms-linear-gradient(top, #8f7a66 0%, #8f7a66 100%);
padding: 10px 20px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
box-shadow: rgba(255,255,255,0.4) 0 0px 0, inset rgba(255,255,255,0.4) 0 0px 0;
color: #ffffff;
text-decoration: none;
vertical-align: middle;
display: inline-block;
}
<!-- Add common class to all buttons -->
2048
16384
65536

Coloring 50% of the progress bar

I have to color 50% of the progress bar with red color. Here is what I have tried , my css and html:
.progress {
width:100%;
display: inline-block;
height: 0.4615384615384615em;
padding: 0.0769230769230769em;
background: #fff;
border: 1px solid #c0c0c0;
position: relative;
-webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
background: #f9f9f9;
background: -moz-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f2f2f2));
background: -webkit-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -o-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -ms-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: linear-gradient(to bottom, #ffffff 0, #f2f2f2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#f2f2f2, GradientType=0);
filter: none \9;
}
.progress.complete {
height: 0.9em;
position: relative;
}
<div id="id1" class="progress complete">
<span title="" style="background: red; left: 0%; width: 50%; box-shadow: 0px 2px 1px rgba(0,0,0,0.2), inset 0px 2px 1px rgba(0,0,0,0.2);" rel="tooltip"></span>
</div>
How to color it without adding any text to <span> element in the output?
You have forgot to mention height & position to span tag
.progress {
width:100%;
display: inline-block;
height: 0.4615384615384615em;
padding: 0.0769230769230769em;
background: #fff;
border: 1px solid #c0c0c0;
position: relative;
-webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
background: #f9f9f9;
background: -moz-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f2f2f2));
background: -webkit-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -o-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -ms-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: linear-gradient(to bottom, #ffffff 0, #f2f2f2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#f2f2f2, GradientType=0);
filter: none \9;
}
.progress.complete {
height: 0.9em;
position: relative;
}
<div id="id1" class="progress complete">
<span title="" style="background: red; left: 0%; width: 50%; box-shadow: 0px 2px 1px rgba(0,0,0,0.2), inset 0px 2px 1px rgba(0,0,0,0.2);height: 100%; position: absolute;top: 0;" rel="tooltip"></span>
</div>
If you want to do that without span tag then use pseudo selector ::after as below to style that,
.progress {
width:100%;
display: inline-block;
height: 0.4615384615384615em;
padding: 0.0769230769230769em;
background: #fff;
border: 1px solid #c0c0c0;
position: relative;
-webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
background: #f9f9f9;
background: -moz-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f2f2f2));
background: -webkit-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -o-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -ms-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: linear-gradient(to bottom, #ffffff 0, #f2f2f2 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#f2f2f2, GradientType=0);
filter: none \9;
overflow:hidden;
}
.progress:after{
content:'';
position:absolute;
background: red;
left: 0%;
top:0;
width: 50%;
height:10px;
box-shadow: 0px 2px 1px rgba(0,0,0,0.2), inset 0px 2px 1px rgba(0,0,0,0.2);
z-index:9;
-webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
}
<div id="id1" class="progress complete">
</div>
Span tag default display is inline so you need to change that to inline-block and height to it.
.progress {
width: 100%;
display: inline-block;
height: 0.4615384615384615em;
padding: 0.0769230769230769em;
background: #fff;
border: 1px solid #c0c0c0;
position: relative;
-webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
background: #f9f9f9;
background: -moz-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #f2f2f2));
background: -webkit-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -o-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: -ms-linear-gradient(top, #ffffff 0, #f2f2f2 100%);
background: linear-gradient(to bottom, #ffffff 0, #f2f2f2 100%);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr=#ffffff, endColorstr=#f2f2f2, GradientType=0);
filter: none \9;
overflow: hidden;
}
.progress.complete {
height: 0.9em;
position: relative;
}
span {
background: red;
left: 0%;
width: 50%;
height: 15px;
display: block;
-webkit-border-radius: 5px 5px 5px 5px;
-moz-border-radius: 5px 5px 5px 5px;
border-radius: 5px 5px 5px 5px;
box-shadow: 0px 2px 1px rgba(0, 0, 0, 0.2), inset 0px 2px 1px rgba(0, 0, 0, 0.2);
}
<div id="id1" class="progress complete">
<span title="progress bar" rel="tooltip"></span>
</div>

Input type file solution with rgb color effect

Hello everyone this is my old problem for input type file css style problem.
This is input type file HTML code :
<input type="file" name="select_img" class="select_style" />
And this is for input type file css code:
.select_style {
float:left;
width: 80px;
height: 27px;
padding: 0;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
color: rgba(255,255,255,1);
font: normal 12px/27px "Lucida Grande";
border: 1px solid rgba(44,81,21,0.24);
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background-image: rgba(235,235,235,1);
background-image: -webkit-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -moz-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -o-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -ms-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: linear-gradient(top, #00c714 0%,#008c10 100%);
-webkit-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
-moz-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
}
I asked friends they said many solution but there is not use full for me. then i solved the problem and ....
input type file HTML code
<input type="file" class="file-input">
and CSS code solved problem with rgb color effect:
.file-input {
color: transparent;
}
.file-input::-webkit-file-upload-button {
visibility: hidden;
}
.file-input::before {
width:80px;
height:27px;
content: 'Select files';
color:#fff;
display: inline-block;
background-image: rgba(235,235,235,1);
background-image: -webkit-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -moz-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -o-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -ms-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: linear-gradient(top, #00c714 0%,#008c10 100%);
-webkit-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
-moz-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
border: 1px solid #999;
border-radius: 3px;
padding: 5px 8px;
outline: none;
white-space: nowrap;
-webkit-user-select: none;
cursor: pointer;
font-weight: bold;
font-size: 13px;
line-height:27px;
text-align:center;
}
.file-input:hover::before {
border-color: black;
}
.file-input:active {
outline: 0;
}
.file-input:active::before {
background-image: rgba(235,235,235,1);
background-image: -webkit-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: -moz-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: -o-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: -ms-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: linear-gradient(top, #008c10 0%,#00c714 100%);
-webkit-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
-moz-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
}
body {
padding: 20px;
}
Click to see here

css select file css style doesn't work [duplicate]

This question already has answers here:
Styling an input type="file" button
(46 answers)
Closed 9 years ago.
I am trying to create input file button with css style . But it does not work. My css code woking all browser but style is not working....
This is my script. enter link description here
This is inptu type html code :
<input type="file" name="select_img" class="select_style" />
And this is css code:
.select_style {
float:left;
width: 80px;
height: 27px;
padding: 0;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
color: rgba(255,255,255,1);
font: normal 12px/27px "Lucida Grande";
border: 1px solid rgba(44,81,21,0.24);
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
background-image: rgba(235,235,235,1);
background-image: -webkit-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -moz-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -o-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -ms-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: linear-gradient(top, #00c714 0%,#008c10 100%);
-webkit-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
-moz-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
}
This tutorial: http://www.quirksmode.org/dom/inputfile.html gives very detailed instructions on how to style input[type=file] with css.
Give .select_style and opacity of 0 and create a different div element with the other styles you have along with a z-index of -1. Then use relative positioning on that div to put it in the exact same spot as the file input. Then, when the user clicks on that styled div they will actually be clicking on the file input.
Example:
<div style="display: block; width: 100px; height: 20px; overflow: hidden;">
<button style="width: 110px; height: 30px; position: relative; top: -5px; left: -5px;">Upload File</button>
<input type="file" id="upload_input" name="upload" style="font-size: 50px; width: 120px; opacity: 0; filter:alpha(opacity: 0); position: relative; top: -40px;; left: -20px" />
</div>
Taken from this answer: https://stackoverflow.com/a/3030174/2374365
Look at this one it might help you
http://jsfiddle.net/gabrieleromanato/mxq9R/
HTML
<form action="" method="post" enctype="multipart/form-data">
<div class="upload">
<input type="file" name="upload"/>
</div>
</form>
CSS
iv.upload {
width: 157px;
height: 57px;
background: url(https://lh6.googleusercontent.com/-dqTIJRTqEAQ/UJaofTQm3hI/AAAAAAAABHo/w7ruR1SOIsA/s157/upload.png);
overflow: hidden;
}
div.upload input {
display: block !important;
width: 157px !important;
height: 57px !important;
opacity: 0 !important;
overflow: hidden !important;
}
Hi everyone this is my solution code thanks for help, but all code is not usefull for me i create new code then i solved my problem.
Click and see in jsfiddle.net
HTML input code is here:
<input type="file" class="file-input">
And only css for input type file button:
it is very user full i used rgb color with hover effect.
.file-input {
color: transparent;
}
.file-input::-webkit-file-upload-button {
visibility: hidden;
}
.file-input::before {
content: 'Select files';
color:#fff;
display: inline-block;
background-image: rgba(235,235,235,1);
background-image: -webkit-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -moz-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -o-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: -ms-linear-gradient(top, #00c714 0%,#008c10 100%);
background-image: linear-gradient(top, #00c714 0%,#008c10 100%);
-webkit-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
-moz-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
border: 1px solid #999;
border-radius: 3px;
padding: 5px 8px;
outline: none;
white-space: nowrap;
-webkit-user-select: none;
cursor: pointer;
font-weight: 700;
font-size: 10pt;
}
.file-input:hover::before {
border-color: black;
}
.file-input:active {
outline: 0;
}
.file-input:active::before {
background-image: rgba(235,235,235,1);
background-image: -webkit-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: -moz-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: -o-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: -ms-linear-gradient(top, #008c10 0%,#00c714 100%);
background-image: linear-gradient(top, #008c10 0%,#00c714 100%);
-webkit-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
-moz-box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
box-shadow: rgba(206,223,255,1) 0px 0px 0px 0px, inset rgba(255,255,255,1) 0px 0px 0px 0px;
}
body {
padding: 20px;
}

CSS3 - top notification bubble

How to add pure css notification bubble for the following example
Code CSS
<style>
.outer{
width:103px;
height:113px;
display:inline-block;
padding:5px;
margin:25px 14px 15px 14px;
font-size: 14px;
font-weight:bold;
color:#8E9FA9;
text-transform: uppercase;
border:1px solid #cccece;
text-align:center;
background-color:#f8f8f8;
letter-spacing: -0.06em;
-webkit-text-shadow: #ffffff 1px 1px;
moz-text-shadow: #ffffff 1px 1px;
text-shadow: #ffffff 1px 1px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow: 0 3px 2px 1px rgba(0, 0, 0, 0.03);
-moz-box-shadow: 0 3px 2px 1px rgba(0, 0, 0, 0.03);
box-shadow: 0 3px 2px 1px rgba(0, 0, 0, 0.03);
}
.outer:hover {
color:#7D878E !important;
-webkit-box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.05);
}
a.outer span {
font-size: 14px;
display:block;
padding:86px 0 6px 0;
background-repeat:no-repeat;
background-color:#f1f2f3;
background-position:50% 18px;
}
a.outer span:hover {background-position:50% -98px;}
a.outer.add_user span {background-image:url(icon_big_user_add.png);}
</style>
Code HTML
<a href="#" class="outer add_user">
<span>Test</span>
</a>
Results
Question
How to add pure css notification bubble at the top of the box just like this example.
as you might seen there is blue ball that shows numbers, how to apply such notification ball based on the above example. ~ Thanks
See this fiddle.
CSS:
.outer {
width:103px;
height:113px;
display:inline-block;
padding:5px;
margin:25px 14px 15px 14px;
font-size: 14px;
font-weight:bold;
color:#8E9FA9;
text-transform: uppercase;
border:1px solid #cccece;
text-align:center;
background-color:#f8f8f8;
letter-spacing: -0.06em;
-webkit-text-shadow: #ffffff 1px 1px;
moz-text-shadow: #ffffff 1px 1px;
text-shadow: #ffffff 1px 1px;
-webkit-border-radius:5px;
-moz-border-radius:5px;
border-radius:5px;
-webkit-box-shadow: 0 3px 2px 1px rgba(0, 0, 0, 0.03);
-moz-box-shadow: 0 3px 2px 1px rgba(0, 0, 0, 0.03);
box-shadow: 0 3px 2px 1px rgba(0, 0, 0, 0.03);
}
.outer:hover {
color:#7D878E !important;
-webkit-box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.05);
box-shadow: 0px 3px 2px 1px rgba(0, 0, 0, 0.05);
}
a.outer span {
font-size: 14px;
display:block;
padding:80px 0 6px 0;
}
.num_notifs {
border-radius: 5px;
width: 50%;
margin-top: 2px;
background: #00b7ea; /* Old browsers */
background: -moz-linear-gradient(top, #00b7ea 0%, #0052bf 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#00b7ea), color-stop(100%,#0052bf)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #00b7ea 0%,#0052bf 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #00b7ea 0%,#0052bf 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #00b7ea 0%,#0052bf 100%); /* IE10+ */
background: linear-gradient(to bottom, #00b7ea 0%,#0052bf 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00b7ea', endColorstr='#0052bf',GradientType=0 ); /* IE6-9 */
text-align: center;
color: white;
text-decoration: none;
font-weight: none;
}
HTML:
<a href="#" class="outer add_user">
<div class="num_notifs">4319</div>
<span>Test</span>
</a>