How can I make this progress bar with just CSS? - html
Can I make the progress bar below by using CSS only, that is, without using any images? In the second case, one can round the green corners on the left side of the div and not round them on the right side. However, is there a solution for the first and third case without resorting to an external image?
Note, that there should be a smooth transition from the bar being completely empty to being completely green.
Css Tricks has a good article showing how you would achieve this.
Example
Re: Comment
Looks pretty close to me
Notice I have changed the widths of the span elements.
LAST UPDATE
OP wanted it to look more like his example
Change the following two lines of CSS in the demo
.meter {
background: none repeat scroll 0 0 #555555;
border-radius: 25px 25px 25px 25px;
box-shadow: 0 -1px 1px rgba(255, 255, 255, 0.3) inset;
height: 40px;
margin: 60px 0 20px;
overflow: hidden; /* remove padding and add me */
position: relative;
}
.meter > span {
background-color: #2BC253;
background-image: -moz-linear-gradient(center bottom , #2BC253 37%, #54F054 69%);
border-radius: 20px 0px 0px 20px; /* change me */
box-shadow: 0 2px 9px rgba(255, 255, 255, 0.3) inset, 0 -2px 6px rgba(0, 0, 0, 0.4) inset;
display: block;
height: 100%;
overflow: hidden;
position: relative;
}
If you put the green bar inside the grey container and set overflow: hidden on the grey container then the green bar will be clipped when you give the container rounded corners.
To see it in action in the fiddle, toggle the checkbox to kick off the animation. I've set it to 3 seconds. Will work in all modern browsers and IE10. If you wind up needing JavaScript to kick off an event, or keep track of the time it should run, just change the CSS width of .progress-color.
Here is the fiddle
<!DOCTYPE html>
<html>
<head>
<title>Progress Bar</title>
<style>
.progress-bar {
margin: 5px;
width: 500px;
background-color: #DDD;
overflow: hidden;
border: 1px solid #BBB;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
}
.progress-color {
background-color: lime;
background-size: 40px 40px;
width: 0%;
height: 30px;
-webkit-transition: width 2s ease;
-moz-transition: width 2s ease;
-ms-transition: width 2s ease;
-o-transition: width 2s ease;
transition: width 2s ease;
-webkit-animation: bganim 3s linear 2s infinite;
-moz-animation: bganim 3s linear 2s infinite;
-ms-animation: bganim 3s linear 2s infinite;
-o-animation: bganim 3s linear 2s infinite;
animation: bganim 3s linear 2s infinite;
}
:checked + .progress-bar .progress-color{
width: 100%;
}
</style>
</head>
<body>
<input type="checkbox" value="Install" /> Start Installation:
<div class="progress-bar">
<div class="progress-color"></div>
</div>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.bar {
width: 300px;
height: 50px;
border-radius: 25px;
background-color: rgba(231, 56, 39, 0.5);
overflow: hidden;
}
.progress {
width: 96%;
height: 100%;
background-color: #e73827;
}
<div class="bar">
<div class="progress"></div>
</div>
If you don't like to use javascript or images only possible way i can think of is using css3 border radius style. But the problem is old browsers doesn't support for css3
example:
border-radius: 5px 10px 5px 10px
using above style you can round what ever the corner you like individually.
for more details follow this link
this a simple, smooth, and bootifull loader css3
JSFiddle here
<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">google.load("jquery", "1");</script>
<style>
#import url(http://fonts.googleapis.com/css?family=Aldrich);
body{background:#333;}
.progressbar{
position:relative;
display:block;
width:560px;
height:20px;
padding:10px 20px;
border-bottom:1px solid rgba(255,255,255,0.25);
border-radius:16px;
margin:40px auto;
-webkit-box-shadow: 0px 4px 4px -4px rgba(255, 255, 255, 0.4),0px -3px 3px -3px rgba(255, 255, 255, 0.25),inset 0px 0px 12px 0px rgba(0, 0, 0, 0.5);
box-shadow: 0px 4px 4px -4px rgba(255, 255, 255, 0.4),0px -3px 3px -3px rgba(255, 255, 255, 0.25),inset 0px 0px 12px 0px rgba(0, 0, 0, 0.5);
}
.progressbar:before{
position:absolute;
display:block;
content:"";
width:558px;
height:18px;
top:10px;
left:20px;
-webkit-border-radius:20px;
border-radius:20px;
background:#222;
-webkit-box-shadow: inset 0px 0px 6px 0px rgba(0, 0, 0, 0.85);;
box-shadow: inset 0px 0px 6px 0px rgba(0, 0, 0, 0.85);
border:1px solid rgba(0,0,0,0.8);
}
.bar {
position:absolute;
display:block;
width:0px;
height:16px;
top:12px;
left:22px;
background: rgb(126,234,25);
background: -moz-linear-gradient(top, rgba(126,234,25,1) 0%, rgba(83,173,0,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(126,234,25,1)), color-stop(100%,rgba(83,173,0,1)));
background: -webkit-linear-gradient(top, rgba(126,234,25,1) 0%,rgba(83,173,0,1) 100%);
background: -o-linear-gradient(top, rgba(126,234,25,1) 0%,rgba(83,173,0,1) 100%);
background: -ms-linear-gradient(top, rgba(126,234,25,1) 0%,rgba(83,173,0,1) 100%);
background: linear-gradient(to bottom, rgba(126,234,25,1) 0%,rgba(83,173,0,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7eea19', endColorstr='#53ad00',GradientType=0 );
-webkit-border-radius:16px;
border-radius:16px;
-webkit-box-shadow: 0px 0px 12px 0px rgba(126, 234, 25, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
box-shadow: 0px 0px 12px 0px rgba(126, 234, 25, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
overflow:hidden;
}
.bar.color2 {
background: rgb(229,195,25);
background: -moz-linear-gradient(top, rgba(229,195,25,1) 0%, rgba(168,140,0,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(229,195,25,1)), color-stop(100%,rgba(168,140,0,1)));
background: -webkit-linear-gradient(top, rgba(229,195,25,1) 0%,rgba(168,140,0,1) 100%);
background: -o-linear-gradient(top, rgba(229,195,25,1) 0%,rgba(168,140,0,1) 100%);
background: -ms-linear-gradient(top, rgba(229,195,25,1) 0%,rgba(168,140,0,1) 100%);
background: linear-gradient(to bottom, rgba(229,195,25,1) 0%,rgba(168,140,0,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5c319', endColorstr='#a88c00',GradientType=0 );
-webkit-box-shadow: 0px 0px 12px 0px rgba(229, 195, 25, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
box-shadow: 0px 0px 12px 0px rgba(229, 195, 25, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
}
.bar.color3 {
background: rgb(232,25,87);
background: -moz-linear-gradient(top, rgba(232,25,87,1) 0%, rgba(170,0,51,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(232,25,87,1)), color-stop(100%,rgba(170,0,51,1)));
background: -webkit-linear-gradient(top, rgba(232,25,87,1) 0%,rgba(170,0,51,1) 100%);
background: -o-linear-gradient(top, rgba(232,25,87,1) 0%,rgba(170,0,51,1) 100%);
background: -ms-linear-gradient(top, rgba(232,25,87,1) 0%,rgba(170,0,51,1) 100%);
background: linear-gradient(to bottom, rgba(232,25,87,1) 0%,rgba(170,0,51,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e81957', endColorstr='#aa0033',GradientType=0 );
-webkit-box-shadow: 0px 0px 12px 0px rgba(232, 25, 87, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
box-shadow: 0px 0px 12px 0px rgba(232, 25, 87, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
}
.bar.color4 {
background: rgb(24,109,226);
background: -moz-linear-gradient(top, rgba(24,109,226,1) 0%, rgba(0,69,165,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(24,109,226,1)), color-stop(100%,rgba(0,69,165,1)));
background: -webkit-linear-gradient(top, rgba(24,109,226,1) 0%,rgba(0,69,165,1) 100%);
background: -o-linear-gradient(top, rgba(24,109,226,1) 0%,rgba(0,69,165,1) 100%);
background: -ms-linear-gradient(top, rgba(24,109,226,1) 0%,rgba(0,69,165,1) 100%);
background: linear-gradient(to bottom, rgba(24,109,226,1) 0%,rgba(0,69,165,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#186de2', endColorstr='#0045a5',GradientType=0 );
-webkit-box-shadow: 0px 0px 12px 0px rgba(24, 109, 226, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
box-shadow: 0px 0px 12px 0px rgba(24, 109, 226, 1),inset 0px 1px 0px 0px rgba(255, 255, 255, 0.45),inset 1px 0px 0px 0px rgba(255, 255, 255, 0.25),inset -1px 0px 0px 0px rgba(255, 255, 255, 0.25);
}
.bar:before {
position:absolute;
display:block;
content:"";
width:606px;
height:150%;
top:-25%;
left:-25px;
background: -moz-radial-gradient(center, ellipse cover, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0.01) 50%, rgba(255,255,255,0) 51%, rgba(255,255,255,0) 100%);
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(255,255,255,0.35)), color-stop(50%,rgba(255,255,255,0.01)), color-stop(51%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,0)));
background: -webkit-radial-gradient(center, ellipse cover, rgba(255,255,255,0.35) 0%,rgba(255,255,255,0.01) 50%,rgba(255,255,255,0) 51%,rgba(255,255,255,0) 100%);
background: -o-radial-gradient(center, ellipse cover, rgba(255,255,255,0.35) 0%,rgba(255,255,255,0.01) 50%,rgba(255,255,255,0) 51%,rgba(255,255,255,0) 100%);
background: -ms-radial-gradient(center, ellipse cover, rgba(255,255,255,0.35) 0%,rgba(255,255,255,0.01) 50%,rgba(255,255,255,0) 51%,rgba(255,255,255,0) 100%);
background: radial-gradient(ellipse at center, rgba(255,255,255,0.35) 0%,rgba(255,255,255,0.01) 50%,rgba(255,255,255,0) 51%,rgba(255,255,255,0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#59ffffff', endColorstr='#00ffffff',GradientType=1 );
}
.bar:after {
position:absolute;
display:block;
content:"";
width:64px;
height:16px;
right:0;
top:0;
-webkit-border-radius: 0px 16px 16px 0px;
border-radius: 0px 16px 16px 0px;
background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 98%, rgba(255,255,255,0) 100%);
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(98%,rgba(255,255,255,0.6)), color-stop(100%,rgba(255,255,255,0)));
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.6) 98%,rgba(255,255,255,0) 100%);
background: -o-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.6) 98%,rgba(255,255,255,0) 100%);
background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.6) 98%,rgba(255,255,255,0) 100%);
background: linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,0.6) 98%,rgba(255,255,255,0) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#00ffffff',GradientType=1 );
}
.bar span {
position:absolute;
display:block;
width:100%;
height:64px;
-webkit-border-radius:16px;
border-radius:16px;
top:0;
left:0;
background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABACAYAAAD7/UK9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYW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FfPcvlXl3a6a17xW1vxTo4i9bxXQj2Iyu0prfANaclSLXTz+3EnvOS+diQmlsg3qkP9AJV9TEQbzFgVwMPUdvga+L0pGT+PsmwD0q6qAtHabdkLkyFncX2dUmvzO+LcJZe7PHKamaellx8fop1g1mi4kynEqeXNa5YXKf7xhbFuTBvqVmqKiWqzpjD0kFVFzeKJqV/xVzjHkKFjNiNUVRiILUzS4XdkqahDTTGD7F3f4LB/xzH5hLzZFD1q/eQeCmx9Wlh9AUId1u7dZrlE0dFL+d4adFtPgI+Lc05ay3aFWz3SyAceLHBvSW3eZtXVpKx2geTFbs2KIT9N4hUFztpFYY3SPqe57cnUE1pJPmk6+xY/tv1PK0DugLz1D2i6bEgt024QAJekxLrR8k0qKa32w20IVzWLtWUlxaCRS8pa2p6Rlxva4i1Hv5bLZIM9v8T6saOD0hBeBdJ4Av3gHDDSPs21rKKlAei3fYT+x6Tlgv3/wIMAGfxS3lASyEZAAAAAElFTkSuQmCC") 0 0;
-webkit-animation: sparkle 1500ms linear infinite;
-moz-animation: sparkle 1500ms linear infinite;
-o-animation: sparkle 1500ms linear infinite;
animation: sparkle 1500ms linear infinite;
opacity:0.2;
}
.label {
font-family: 'Aldrich', sans-serif;
position:absolute;
display:block;
width:40px;
height:30px;
line-height:30px;
top:38px;
left:0px;
background: rgb(76,76,76);
background: -moz-linear-gradient(top, rgba(76,76,76,1) 0%, rgba(38,38,38,1) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(76,76,76,1)), color-stop(100%,rgba(38,38,38,1)));
background: -webkit-linear-gradient(top, rgba(76,76,76,1) 0%,rgba(38,38,38,1) 100%);
background: -o-linear-gradient(top, rgba(76,76,76,1) 0%,rgba(38,38,38,1) 100%);
background: -ms-linear-gradient(top, rgba(76,76,76,1) 0%,rgba(38,38,38,1) 100%);
background: linear-gradient(to bottom, rgba(76,76,76,1) 0%,rgba(38,38,38,1) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4c4c4c', endColorstr='#262626',GradientType=0 );
font-weight:bold;
font-size:12px;
color:#fff;
text-align:center;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.3);
box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.3);
text-shadow: 0px -1px 0px #000000,0px 1px 1px #000000;
filter: dropshadow(color=#000000, offx=0, offy=-1);
}
.label span {
position:absolute;
display:block;
width:12px;
height:9px;
top:-9px;
left:14px;
background:transparent;
overflow:hidden;
}
.label span:before {
position:absolute;
display:block;
content:"";
width:8px;
height:8px;
top:4px;
left:2px;
border:1px solid rgba(0,0,0,0.5);
background: rgb(86,86,86);
background: -moz-linear-gradient(-45deg, rgba(86,86,86,1) 0%, rgba(76,76,76,1) 50%);
background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(86,86,86,1)), color-stop(50%,rgba(76,76,76,1)));
background: -webkit-linear-gradient(-45deg, rgba(86,86,86,1) 0%,rgba(76,76,76,1) 50%);
background: -o-linear-gradient(-45deg, rgba(86,86,86,1) 0%,rgba(76,76,76,1) 50%);
background: -ms-linear-gradient(-45deg, rgba(86,86,86,1) 0%,rgba(76,76,76,1) 50%);
background: linear-gradient(135deg, rgba(86,86,86,1) 0%,rgba(76,76,76,1) 50%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#565656', endColorstr='#4c4c4c',GradientType=1 );
-webkit-box-shadow: 0px -1px 2px 0px rgba(0, 0, 0, 0.15);
box-shadow: 0px -1px 2px 0px rgba(0, 0, 0, 0.15);
-moz-transform:rotate(45deg);
-webkit-transform:rotate(45deg);
-o-transform:rotate(45deg);
-ms-transform:rotate(45deg);
transform:rotate(45deg);
}
#-webkit-keyframes sparkle {
from {background-position: 0 0;}
to {background-position: 0 -64px;}
}
#-moz-keyframes sparkle {
from {background-position: 0 0;}
to {background-position: 0 -64px;}
}
#-o-keyframes sparkle {
from {background-position: 0 0;}
to {background-position: 0 -64px;}
}
#keyframes sparkle {
from {background-position: 0 0;}
to {background-position: 0 -64px;}
}
</style>
<script language="javascript">
$(function() {
$('.progressbar').each(function(){
var t = $(this),
dataperc = t.attr('data-perc'),
barperc = Math.round(dataperc*5.56);
t.find('.bar').animate({width:barperc}, dataperc*25);
t.find('.label').append('<div class="perc"></div>');
function perc() {
var length = t.find('.bar').css('width'),
perc = Math.round(parseInt(length)/5.56),
labelpos = (parseInt(length)-2);
t.find('.label').css('left', labelpos);
t.find('.perc').text(perc+'%');
}
perc();
setInterval(perc, 0);
});
});
</script>
</head>
<body>
<div class="progressbar" data-perc="100">
<div class="bar"><span></span></div>
<div class="label"><span></span></div>
</div>
<div class="progressbar" data-perc="75">
<div class="bar color2"><span></span></div>
<div class="label"><span></span></div>
</div>
<div class="progressbar" data-perc="50">
<div class="bar color3"><span></span></div>
<div class="label"><span></span></div>
</div>
<div class="progressbar" data-perc="25">
<div class="bar color4"><span></span></div>
<div class="label"><span></span></div>
</div>
</body>
</html>
Related
Change shape of gradient progress bar
I have a gradient progress bar. My code is as follows: CSS: .progressbar { height: 15px; border-radius: 1em; margin:5px; background: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%,transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%,transparent 75%) left/30px 30px repeat-x, linear-gradient(to right, red 0%, yellow 50%, green 100%) left/var(--p,100%) fixed, lightgray; box-shadow:inset 0px -2px 5px rgba(0, 0, 0, 0.5); animation: change 1s linear infinite; } #keyframes change { from {background-position:0 0,left} to {background-position:30px 0,left} } HTML: <div class="progressbar" style="width:80%;"></div> I want to keep it as gradient bar only but just want to change shape of progress bar. I want shape of progress bar as arrow as shown in image attached.How I can change shape of progress bar? .
It's a difficult one, and this workaround will not work if you don't use a solid background. But here's the trick done with pseudo elements. Hope it helps. More info about CSS triangles here. .progressbar { position: relative; /* for position absolute of pseudo element work */ height: 56px; margin:5px; background: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%,transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%,transparent 75%) left/30px 30px repeat, linear-gradient(to right, red 0%, yellow 50%, green 100%) left/var(--p,100%) fixed, lightgray; box-shadow:inset 0px -2px 5px rgba(0, 0, 0, 0.5); animation: change 1s linear infinite; } .progressbar:after { content: ""; position: absolute; right: 0; width: 0; height: 0; border-top: 28px solid white; /* Your background color*/ border-bottom: 28px solid white; /* Your background color*/ border-left: 28px solid transparent; } .progressbar:before { content: ""; position: absolute; left: 0; width: 0; height: 0; border-top: 28px solid transparent; border-bottom: 28px solid transparent; border-left: 28px solid white; /* Your background color*/ } #keyframes change { from {background-position:0 0,left} to {background-position:30px 0,left} } <div class="progressbar" style="width:80%;"></div>
Why do progress bars not load in IE?
I have been devloping a website but can not get a progress bar of any sorts to load in Internet Explorer. I tried both the basic progress bar in html, as well as a more complex CSS one, both of which did not work. I have 3 scripts, the first of which is the html code for the basic progress bar, as well as 4 of the more complex ones. The second script is the CSS styling for the more complex bar. Finally I have my run file which is used to live update the site I am working on. I am running the site on Apache 2.4.10 and it functions properly in both Firefox and Google Chrome. When trying in Internet Explorer, all that loads is a single black rectangle, instead of 4 actual bars, and one of the smaller progress bars. Please let me know if you see the flaw in my code or if you have the fix to the problem. This is the HTML <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="progressbarstyle.css"> </head> <title> Test</title> <style type="text/css"> </style> </head> <body> <progress max="100" value="10"></progress><br/> <div class="meter red"> <span id="progress-load" style="height: 60%" > </span> </div> <div class="meter red"> <span id="progress-load" style="height: 60%" > </span> </div> <div class="meter red"> <span id="progress-load" style="height: 40%" > </span> </div> <div class="meter red"> <span id="progress-load" style="height: 50%" > </span> </div> </body> </html> <script> This is the CSS p {color: white; background-color: black;} body {background-color: #F5F5DC; } .meter { float: left; height: 500px; width: 50px; background: #555; -moz-border-radius: 25px; -webkit-border-radius: 25px; border-radius: 25px; padding: 10px; -webkit-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3); -moz-box-shadow : inset 0 -1px 1px rgba(255,255,255,0.3); box-shadow : inset 0 -1px 1px rgba(255,255,255,0.3); position:relative; overflow: hidden; } .progress-load { display: block; height: 100%; -webkit-border-top-right-radius: 20px; -webkit-border-bottom-right-radius: 20px; -moz-border-radius-topright: 20px; -moz-border-radius-bottomright: 20px; border-top-right-radius: 20px; border-bottom-right-radius: 20px; -webkit-border-top-left-radius: 8px; -webkit-border-bottom-left-radius: 8px; -moz-border-radius-topleft: 8px; -moz-border-radius-bottomleft: 8px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; background-color: rgb(43,194,83); background-image: -webkit-gradient( linear, center right, center right, color-stop(0, rgb(43,194,83)), color-stop(1, rgb(84,240,84)) ); background-image: -webkit-linear-gradient( center right, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); background-image: -moz-linear-gradient( center right, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); background-image: -ms-linear-gradient( center right, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); background-image: -o-linear-gradient( center right, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); -webkit-box-shadow: inset 0 2px 9px rgba(255,255,255,0.3), inset 0 -2px 6px rgba(0,0,0,0.4); -moz-box-shadow: inset 0 2px 9px rgba(255,255,255,0.3), inset 0 -2px 6px rgba(0,0,0,0.4); overflow: hidden; position:absolute; left: 0; bottom: 0; width: 100%; } .red > span { background-color: #f0a3a3; background-image: -webkit-gradient(linear, left top,left bottom,color-stop(0.#f0a3a3),color-stop(1, #f42323)); background-image: -webkit-linear-gradient(right, #f0a3a3, #f42323); background-image: -moz-linear-gradient(right, #f0a3a3, #f42323); background-image: -ms-linear-gradient(right, #f0a3a3, #f42323); background-image: -o-linear-gradient(right, #f0a3a3, #f42323); } .meter > span:after { content: ""; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent) ); background-image: -webkit-linear-gradient( -45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent ); background-image: -moz-linear-gradient( -45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent ); background-image: -ms-linear-gradient( -45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent ); background-image: -o-linear-gradient( -45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent ); z-index: 1; -webkit-background-size: 50px 50px; -moz-background-size: 50px 50px; background-size: 50px 50px; -webkit-animation: move 2s linear infinite; -webkit-border-top-right-radius: 8px; -webkit-border-bottom-right-radius: 8px; -moz-border-radius-topright: 8px; -moz-border-radius-bottomright: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; -webkit-border-top-left-radius: 20px; -webkit-border-bottom-left-radius: 20px; -moz-border-radius-topleft: 20px; -moz-border-radius-bottomleft: 20px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; overflow: hidden; } And finally here is my run file <!DOCTYPE html> <html> <style type="text/css"> </style> <script> function showCustomer(str) { var xmlhttp; if (str=="") { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari php<!-- include('test.php');--> ?> xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("GET","Progress.html",true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 01 Jan 2000 00:00:00 GMT" ); xmlhttp.send(null); //showCustomer('ALFKI'); setTimeout(function(){showCustomer('load')}, 1500); } </script> </head> <body onLoad="showCustomer('Load')"> <div id="txtHint"></div> </body> </html>
CSS Button Unknownly Centered
Alright, I've got a button that I can't figure out why in the heck it's centring itself. My first suspicion was in the css, but any sort of align or position that I used/changed didn't work. Here's the html and css. You'll probably be able to find it faster than I would. (Also here's the jsfiddle link if anyone's interested: http://jsfiddle.net/takkun/63uktgyo/) /* ROUNDED ONE */ .Gcheckbox { /*CHANGES GRAY SQUARE DIMENSIONS*/ width: 16px; height: 33px; background: #ff0000; /*GRAY SQUARE BACKGROUND FADER*/ background: linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -webkit-linear-gradient(top, 0000ff 100%, 0000ff 0%, #ff0000 0%); background: -moz-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -o-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -ms-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 ); margin: 0px auto; position: relative; } .Gcheckbox label { cursor: pointer; position: absolute; width: 10px; height: 10px; /*MAKES THE GREEN CIRCLE A CIRCLE*/ -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; /********************************/ left: 3px; top: 11.25px; box-shadow: inset 0px 0px 0px rgba(239,239,238,1), 0px 0px 0px rgba(239,239,238,1); -webkit-box-shadow: inset 0px 0px 0px rgba(239,239,238,1), 0px 0px 0px rgba(239,239,238,1); -moz-box-shadow: inset 0px 0px 0px rgba(239,239,238,1), 0px 0px 0px rgba(239,239,238,1); /*BEHIND GREEN CIRCLE BACKGROUND*/ background: -webkit-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -moz-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -o-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -ms-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: linear-gradient(top, #0000ff 0%, #0000ff 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0000ff', endColorstr='#0000ff',GradientType=1 ); } .Gcheckbox label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); opacity: 0; content: ''; position: absolute; width: 10px; height: 10px; background: #00bf00; background: linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -webkit-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -moz-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -o-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -ms-linear-gradient(top, #00ff00 0%, #00ff00 100%); -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; bottom: 0px; right: 0px; -webkit-box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42,171,43); -moz-box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42,171,43); box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42,171,43); } /*CHANGE HOVER EFFECT OPACITY*/ .Gcheckbox label:hover::after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; filter: alpha(opacity=30); opacity: 0.3; } .Gcheckbox input[type=checkbox]:checked + label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); opacity: 1; } input[type=checkbox] { visibility:hidden; } <!DOCTYPE HTML> <html> <head> <link rel="stylesheet" href="styleCIRCLE.css" type="text/css"> <title>custom checkbox testing</title> </head> <body> <!--styleCIRCLE --> <div class="Gcheckbox"> <input type="checkbox" value="None" id="Gcheckbox" name="check" /> <label for="Gcheckbox"></label> </div> </body> </html>
It is horizontally centered because the containing parent, .Gcheckbox has left and right automatic margins, which has the effect of horizontally centering the element. By removing or commenting out that line, we will have the element aligning to the left as per default left-to-right layout behavior. /* ROUNDED ONE */ .Gcheckbox { /*CHANGES GRAY SQUARE DIMENSIONS*/ width: 16px; height: 33px; background: #ff0000; /*GRAY SQUARE BACKGROUND FADER*/ background: linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -webkit-linear-gradient(top, 0000ff 100%, 0000ff 0%, #ff0000 0%); background: -moz-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -o-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -ms-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 ); /*margin: 0px auto;*/ position: relative; } .Gcheckbox label { cursor: pointer; position: absolute; width: 10px; height: 10px; /*MAKES THE GREEN CIRCLE A CIRCLE*/ -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; /********************************/ left: 3px; top: 11.25px; box-shadow: inset 0px 0px 0px rgba(239,239,238,1), 0px 0px 0px rgba(239,239,238,1); -webkit-box-shadow: inset 0px 0px 0px rgba(239,239,238,1), 0px 0px 0px rgba(239,239,238,1); -moz-box-shadow: inset 0px 0px 0px rgba(239,239,238,1), 0px 0px 0px rgba(239,239,238,1); /*BEHIND GREEN CIRCLE BACKGROUND*/ background: -webkit-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -moz-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -o-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -ms-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: linear-gradient(top, #0000ff 0%, #0000ff 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0000ff', endColorstr='#0000ff',GradientType=1 ); } .Gcheckbox label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); opacity: 0; content: ''; position: absolute; width: 10px; height: 10px; background: #00bf00; background: linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -webkit-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -moz-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -o-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -ms-linear-gradient(top, #00ff00 0%, #00ff00 100%); -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; bottom: 0px; right: 0px; -webkit-box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42,171,43); -moz-box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42,171,43); box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42,171,43); } /*CHANGE HOVER EFFECT OPACITY*/ .Gcheckbox label:hover::after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; filter: alpha(opacity=30); opacity: 0.3; } .Gcheckbox input[type=checkbox]:checked + label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); opacity: 1; } input[type=checkbox] { visibility:hidden; } <div class="Gcheckbox"> <input type="checkbox" value="None" id="Gcheckbox" name="check" /> <label for="Gcheckbox"></label> </div>
It's the margin: 0px auto; on your .Gcheckbbox div. Remove that and it's all fine and dandy :)
Custom css button div issue
I'm trying to figure out why this custom css button I made, ONLY likes being within a div tag. Currently if I use a div for the button, I can not have anything else on the same line as the button without doing some css position stuff. If I have to as a last resort I will do that, but I want to see IF I can use another element, and why my button freaks out when you replace the div with anything else. You can take a look at the code here and see what I'm not seeing: http://jsfiddle.net/takkun/k1pz75t2/ <div class="Gcheckbox"> <input type="checkbox" value="None" id="Gcheckbox" name="check" /> <label for="Gcheckbox"></label> </div>
It's not so much that other elements won't work as wrappers as that they don't have the right styles to maintain the height you've set on the element. A span would work just fine if you also set display: inline-block; on it. As to other items not being on the same line, that's how block elements work by default: they take up as much space as they can width-wise. If you want other items on the same line you can set it to be inline-block like the previous span example or you can set it to be float: left;, etc. Whatever suits your particular needs.
Just add a style display: inline-block to the .Gcheckbox. That way, it will be able to be inserted in the flow of the text, but still render as an inline element. Demo
You may need to change the block behavior of the div tag to have another elements aside. You can change it to inline-block: .Gcheckbox { display: inline-block; } input[type=checkbox] { visibility: hidden; } /* ROUNDED ONE */ .Gcheckbox { /*CHANGES GRAY SQUARE DIMENSIONS*/ width: 16px; display: inline-block; height: 33px; background: #ff0000; /*GRAY SQUARE BACKGROUND FADER*/ background: linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -webkit-linear-gradient(top, 0000ff 100%, 0000ff 0%, #ff0000 0%); background: -moz-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -o-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); background: -ms-linear-gradient(top, #000000 100%, 0000ff 0%, #ff0000 0%); filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0); /* margin: 0px auto;*/ position: relative; } .Gcheckbox label { cursor: pointer; position: absolute; width: 10px; height: 10px; /*MAKES THE GREEN CIRCLE A CIRCLE*/ -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; /********************************/ left: 3px; top: 11.25px; box-shadow: inset 0px 0px 0px rgba(239, 239, 238, 1), 0px 0px 0px rgba(239, 239, 238, 1); -webkit-box-shadow: inset 0px 0px 0px rgba(239, 239, 238, 1), 0px 0px 0px rgba(239, 239, 238, 1); -moz-box-shadow: inset 0px 0px 0px rgba(239, 239, 238, 1), 0px 0px 0px rgba(239, 239, 238, 1); /*BEHIND GREEN CIRCLE BACKGROUND*/ background: -webkit-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -moz-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -o-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: -ms-linear-gradient(top, #0000ff 0%, #0000ff 100%); background: linear-gradient(top, #0000ff 0%, #0000ff 100%); filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#0000ff', GradientType=1); } .Gcheckbox label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter: alpha(opacity=0); opacity: 0; content: ''; position: absolute; width: 10px; height: 10px; background: #00bf00; background: linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -webkit-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -moz-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -o-linear-gradient(top, #00ff00 0%, #00ff00 100%); background: -ms-linear-gradient(top, #00ff00 0%, #00ff00 100%); -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; bottom: 0px; right: 0px; -webkit-box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42, 171, 43); -moz-box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42, 171, 43); box-shadow: inset 0px 0px 0px #00ff00, 0px 0px 0px rgba(42, 171, 43); } /*CHANGE HOVER EFFECT OPACITY*/ .Gcheckbox label:hover::after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; filter: alpha(opacity=30); opacity: 0.3; } .Gcheckbox input[type=checkbox]:checked + label:after { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: alpha(opacity=100); opacity: 1; } h2 { display: inline-block; } <div class="Gcheckbox"> <input type="checkbox" value="None" id="Gcheckbox" name="check" /> <label for="Gcheckbox"></label> </div> <h2>I'm aside the button</h2> Also with that property on the classname you can use any other tag like span since now has the property to make the dimensions width and height to work.
Button background not changing on hover
I've created a button as a link using the usual methods, however, I am encountering a curious issue where the background colour is not changing on hover, when it should. I've probably missed something really obvious, but I can't for the life of me find it. The code in question is: .downloadbtn { color: white; display: block; margin: auto; width: 250px; height: 60px; margin-top: 30px; padding: 20px; background: #06bce4; background: -moz-linear-gradient(top, #06bce4 0%, #0589d4 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#06bce4), color-stop(100%,#0589d4)); background: -webkit-linear-gradient(top, #06bce4 0%,#0589d4 100%); background: -o-linear-gradient(top, #06bce4 0%,#0589d4 100%); background: -ms-linear-gradient(top, #06bce4 0%,#0589d4 100%); background: linear-gradient(to bottom, #06bce4 0%,#0589d4 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#06bce4', endColorstr='#0589d4',GradientType=0 ); border: 1px solid #076ca0; border-radius: 4px; -webkit-box-shadow: inset 0px 1px 0px 0px rgba(64, 209, 236, 1); -moz-box-shadow: inset 0px 1px 0px 0px rgba(64, 209, 236, 1); box-shadow: inset 0px 1px 0px 0px rgba(64, 209, 236, 1); -webkit-animation-delay: 2s; -webkit-animation-iteration-count: infinite; -webkit-animation-duration: 6s; -moz-animation-delay: 2s; -moz-animation-iteration-count: infinite; -webkit-animation-duration: 6s; } .downloadbtn :hover { background: green; } A JSFiddle is here: http://jsfiddle.net/4Xxaf/
Updated fiddle. You added a space between the selector and :hover http://jsfiddle.net/4Xxaf/1/
Remove the space in your code .downloadbtn:hover{ background: green; }