Coloring 50% of the progress bar - html

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>

Related

What is wrong with my layout? Fixed Header with iframe

I am trying to make a iframe for website demos so I want to add a fixed header. Why does my right Buy Now Button will keep getting lower then it should? I have tried a few things but I am not a coder.
Here is my code:
#headerfix {
height: 60px;
background-color:#000;
border-bottom: 2px solid gold;
z-index: 99999;
position: fixed;
width: 100%;
}
.button {
border: 2px solid gold;
background: #ff9900;
background: -webkit-gradient(linear, left top, left bottom, from(#ffff00), to(#ff9900));
background: -webkit-linear-gradient(top, #ffff00, #ff9900);
background: -moz-linear-gradient(top, #ffff00, #ff9900);
background: -ms-linear-gradient(top, #ffff00, #ff9900);
background: -o-linear-gradient(top, #ffff00, #ff9900);
background-image: -ms-linear-gradient(top, #ffff00 0%, #ff9900 100%);
padding: 7.5px 15px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-webkit-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
-moz-box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
box-shadow: rgba(255,255,255,0.4) 0 1px 0, inset rgba(255,255,255,0.4) 0 1px 0;
text-shadow: #303030 0 1px 0;
color: #000000;
font-size: 18px;
font-family: helvetica, serif;
text-decoration: none;
vertical-align: middle;
}
.button:hover {
border: 2px solid #d9ff00;
text-shadow: #1e4158 0 1px 0;
background: #ffff00;
background: -webkit-gradient(linear, left top, left bottom, from(#ff9900), to(#ffff00));
background: -webkit-linear-gradient(top, #ff9900, #ffff00);
background: -moz-linear-gradient(top, #ff9900, #ffff00);
background: -ms-linear-gradient(top, #ff9900, #ffff00);
background: -o-linear-gradient(top, #ff9900, #ffff00);
background-image: -ms-linear-gradient(top, #ff9900 0%, #ffff00 100%);
color: #fff;
}
.button:active {
text-shadow: #1e4158 0 1px 0;
border: 2px solid #d9ff00;
background: #ff9900;
background: -webkit-gradient(linear, left top, left bottom, from(#ffff00), to(#ffff00));
background: -webkit-linear-gradient(top, #ffff00, #ff9900);
background: -moz-linear-gradient(top, #ffff00, #ff9900);
background: -ms-linear-gradient(top, #ffff00, #ff9900);
background: -o-linear-gradient(top, #ffff00, #ff9900);
background-image: -ms-linear-gradient(top, #ffff00 0%, #ff9900 100%);
color: #000000;
}
#preview-frame {
margin: 0 auto;
display: block;
padding-top: 60px;
width:100%;
height: 581px;
}
<div id="headerfix">
<section style="width:15%; float:left;"><img style='padding-left: 10px; padding-top: 2.5px;' src="https://turnkey-shop.com/wp-content/uploads/2017/11/demo-tunkey-icon.png" alt="Turnkey-Shop.com"></section>
<section style='padding-left:15%; padding-top:8px; width:70%; text-align:center; float:none; font-size:25px; color:gold;'>Product Name</section>
<section style='padding-left:15%; width:70%; text-align:center; float:none; font-size:12px; color:gold;'>SKU</section>
<section style='padding-left:85%; width: 15%; float:none; '><a href='https://turnkey-shop.com/' class='button'>Buy Now</a></section>
</div>
<iframe id="preview-frame" src="https://turnkey-shop.com/" frameborder="0"></iframe>
I want my button to be center in the top bar.
Use margin-top property in the section to properly align your button
Fiddle: http://jsfiddle.net/sanchitpatiyal95/QQKc4/184/

CSS-Styled div does not scroll with parent div

I am using some css styled checkboxes and want to have a parent container (I am using a div) to scroll when they overflow a certain height. I am currently using this:
/**
* Menu Styles
*/
.fieldset-auto-width {
display: inline-block;
}
.menu_header
{
vertical-align:middle;
background-color:#d0eace;
padding-top:24px;
padding-bottom:24px;
padding-left:24px;
padding-right:24px;
width:500px;
}
.menu_button
{
padding-top:12px;
padding-left:8px;
width:50px;
vertical-align:middle;
}
.menu_description
{
padding-top:12px;
padding-left:8px;
padding-right:8px;
width:400px;
}
.created_by
{
display:inline-block;
float:right;
}
input,.container
{
background-color:white;
}
select
{
color: #000;
font-size: 12px;
background: transparent;
/*-webkit-appearance: none;*/
}
button, option {
background-color: white;/*#d0eace;*/
}
input[type=radio] {
visibility: hidden;
}
/**
* frnakRadio Buttons!
*/
.frnakRadio {
width: 24px;
height: 24px;
background: #ddd;
margin: 10px 10px;
border-radius: 100%;
position: absolute;
-webkit-box-shadow: 0px 1px 3px rgba(0,0,0,0.5);
-moz-box-shadow: 0px 1px 3px rgba(0,0,0,0.5);
box-shadow: 0px 1px 3px rgba(0,0,0,0.5);
}
/**
* Create the checkbox button
*/
.frnakRadio label {
display: inline-block;
width: 18px;
height: 18px;
border-radius: 100px;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
-ms-transition: all .5s ease;
transition: all .5s ease;
cursor: pointer;
position: relative;
top: 3px;
left: 3px;
z-index: 1;
background: #333;
-webkit-box-shadow:inset 0px 1px 3px rgba(0,0,0,0.5);
-moz-box-shadow:inset 0px 1px 3px rgba(0,0,0,0.5);
box-shadow:inset 0px 1px 3px rgba(0,0,0,0.5);
}
/**
* Create the checked state
*/
.frnakRadio input[type=radio]:checked + label {
background: #26ca28;
}
.checkname
{
display: block;
margin: 10px 35px;
}
input[type=text] {
height:2.2em;
padding:5px 5px;
margin-bottom: 10px ;
border-radius:.75em;
-moz-border-radius:.5em;
-webkit-border-radius:.5em;
text-transform:none;
width:200px;
background:-webkit-gradient(linear, left top, left 25, from(#FFF), color-stop(1%,#FFF), to(#d0eace));
background:-moz-linear-gradient(right, #EEEDEE, #d0eace); /* For Firefox 3.6 to 15 */
color:#000;
font-size:.9em;
}
input[type=text]:focus{
box-shadow:1px 1px 10px #446;
outline:none;
}
.crunch:hover
{
background-color: #d0eace;
font-weight:bold;
}
.centercontainer {
/* Internet Explorer 10 */
display:-ms-flexbox;
-ms-flex-pack:center;
-ms-flex-align:center;
/* Firefox */
display:-moz-box;
-moz-box-pack:center;
-moz-box-align:center;
/* Safari, Opera, and Chrome */
/*display:-webkit-box;
-webkit-box-pack:center;
-webkit-box-align:center;*/
/* W3C */
display:box;
box-pack:center;
box-align:center;
display: inline-block;
}
.status
{
border-radius: 100%;
margin:0px 20px;
border: 1px solid black;
width: 15px;
height: 15px;
float:center;
}
.queued
{
background: yellow;
}
.running
{
background:green;
}
.failed
{
background:red;
}
.key
{
float: left;
width: 15px;
text-align: left;
margin: 2px 2px;
margin-left:25px;
display: inline-block;
}
.keytext
{
width: 80px;
float: left;
text-align: left;
margin: 2px 2px;
display: inline-block;
font-size:14px;
font:Times;
}
.helper {
position: relative;
padding: 5px;
width: 15px; height:15px;
cursor:pointer;
}
#loading-image {
margin:0 auto;
background-color: #c0dabd;
width: 128px;
height: 128px;
z-index: 50;
position:absolute;
left:45%;
top:40%;
margin:-0px 0 0 -0px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px; /* future proofing */
-khtml-border-radius: 10px;
}
//FRNAKCHECK!!!
input[type=checkbox] {
visibility: hidden;
}
.frnakcheckbox {
width: 24px;
height: 22px;
background: #fcfff4;
background: -webkit-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -moz-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 );
margin: -12px 5px auto;
-webkit-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
-moz-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
position: absolute;
}
.frnakcheckbox label {
cursor: pointer;
position: absolute;
width: 20px;
height: 20px;
left: 2px;
top: 0px;
-webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
-moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
background: -webkit-linear-gradient(top, #222 0%, #45484d 100%);
background: -moz-linear-gradient(top, #222 0%, #45484d 100%);
background: -o-linear-gradient(top, #222 0%, #45484d 100%);
background: -ms-linear-gradient(top, #222 0%, #45484d 100%);
background: linear-gradient(top, #222 0%, #45484d 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d',GradientType=0 );
}
.frnakcheckbox label:after {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
content: '';
position: absolute;
width: 16px;
height: 16px;
background: #00bf00;
background: -webkit-linear-gradient(top, #00bf00 0%, #009400 100%);
background: -moz-linear-gradient(top, #00bf00 0%, #009400 100%);
background: -o-linear-gradient(top, #00bf00 0%, #009400 100%);
background: -ms-linear-gradient(top, #00bf00 0%, #009400 100%);
background: linear-gradient(top, #00bf00 0%, #009400 100%);
top: 2px;
left: 2px;
-webkit-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
-moz-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
}
.frnakcheckbox label:hover::after {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
filter: alpha(opacity=30);
opacity: 0.3;
}
.frnakcheckbox input[type=checkbox]:disabled{
background: #FFFFFF;
background: -webkit-linear-gradient(top, #ffffff 0%, #009400 100%);
background: -moz-linear-gradient(top, #ffffff 0%, #009400 100%);
background: -o-linear-gradient(top, #ffffff 0%, #009400 100%);
background: -ms-linear-gradient(top, #ffffff 0%, #009400 100%);
background: linear-gradient(top, #ffffff 0%, #009400 100%);
}
.frnakcheckbox input[type=checkbox]:checked + label:after {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
}
.checklabel {
margin: -10px 40px auto;
}
<div id="" style="overflow:auto; height:300px; display: inline-block;">
<b>Sample Text:</b><span class="helper" id="help1" style="color:blue;"><b>?</b></span>
<br>
<br>
<br>
<div class="fcheckbox">
<input type="checkbox" value="library_522">
<label for="control522"></label>
</div>
<div class="checklabel">522</div>
<br>
<div class="fcheckbox">
<input type="checkbox" value="library_523">
<label for="control523"></label>
</div>
<div class="checklabel">523</div>
<br>
</div>
This ends up looking like this: http://imgur.com/EPZ3SnQ
Notice that the actual check boxes aren't contained by the div but the labels are!
This is the CSS for the radio buttons: http://pastebin.com/up29LWCD
I am new to css and haven't quite gotten to understand how positioning works. Any help would be appreciated! I have tried a varying combination of style tags with no real progress...
They seem to work fine if you use them in a container and set the overflow?
/**
* Menu Styles
*/
.container {
margin: 10px;
border: 1px solid black;
height: 100px;
width: 100px;
overflow-y: scroll;
}
/**
* FRNAKCHECK
*/
.frnakcheckbox {
width: 24px;
height: 22px;
background: #fcfff4;
background: -webkit-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -moz-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0);
margin: -12px 5px auto;
-webkit-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
-moz-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
position: absolute;
}
.frnakcheckbox label {
cursor: pointer;
position: absolute;
width: 20px;
height: 20px;
left: 2px;
top: 0px;
-webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 1);
-moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 1);
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.5), 0px 1px 0px rgba(255, 255, 255, 1);
background: -webkit-linear-gradient(top, #222 0%, #45484d 100%);
background: -moz-linear-gradient(top, #222 0%, #45484d 100%);
background: -o-linear-gradient(top, #222 0%, #45484d 100%);
background: -ms-linear-gradient(top, #222 0%, #45484d 100%);
background: linear-gradient(top, #222 0%, #45484d 100%);
filter: progid: DXImageTransform.Microsoft.gradient(startColorstr='#222', endColorstr='#45484d', GradientType=0);
}
.frnakcheckbox label:after {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
filter: alpha(opacity=0);
opacity: 0;
content: '';
position: absolute;
width: 16px;
height: 16px;
background: #00bf00;
background: -webkit-linear-gradient(top, #00bf00 0%, #009400 100%);
background: -moz-linear-gradient(top, #00bf00 0%, #009400 100%);
background: -o-linear-gradient(top, #00bf00 0%, #009400 100%);
background: -ms-linear-gradient(top, #00bf00 0%, #009400 100%);
background: linear-gradient(top, #00bf00 0%, #009400 100%);
top: 2px;
left: 2px;
-webkit-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
-moz-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0, 0, 0, 0.5);
}
.frnakcheckbox label:hover::after {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
filter: alpha(opacity=30);
opacity: 0.3;
}
.frnakcheckbox input[type=checkbox]:disabled {
background: #FFFFFF;
background: -webkit-linear-gradient(top, #ffffff 0%, #009400 100%);
background: -moz-linear-gradient(top, #ffffff 0%, #009400 100%);
background: -o-linear-gradient(top, #ffffff 0%, #009400 100%);
background: -ms-linear-gradient(top, #ffffff 0%, #009400 100%);
background: linear-gradient(top, #ffffff 0%, #009400 100%);
}
.frnakcheckbox input[type=checkbox]:checked + label:after {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
filter: alpha(opacity=100);
opacity: 1;
}
.checklabel {
margin: -10px 40px auto;
}
<b>Sample Text:</b>
<span class="helper" id="help1" style="color:blue;"><b>?</b></span>
<div class="container">
<div class="fcheckbox">
<input type="checkbox" value="library_522">
<label for="control522">522</label>
</div>
<br>
<div class="fcheckbox">
<input type="checkbox" value="library_523">
<label for="control523">523</label>
</div>
<div class="fcheckbox">
<input type="checkbox" value="library_522">
<label for="control522">522</label>
</div>
<br>
<div class="fcheckbox">
<input type="checkbox" value="library_523">
<label for="control523">523</label>
</div>
<div class="fcheckbox">
<input type="checkbox" value="library_522">
<label for="control522">522</label>
</div>
<br>
<div class="fcheckbox">
<input type="checkbox" value="library_523">
<label for="control523">523</label>
</div>
<div class="fcheckbox">
<input type="checkbox" value="library_522">
<label for="control522">522</label>
</div>
<br>
<div class="fcheckbox">
<input type="checkbox" value="library_523">
<label for="control523">523</label>
</div>
<br>
</div>

CSS stretch horizontal menu to fill all width

Here is the link to my site. When you have a wide resolution there is no issue with the dispaly, but if with the brower I try to simulate a little resolution, I come across an issue :
The nav bar won't fill the entire page but only the width of the browser, even though I used width : 100%;
Here the code in CSS
header {
width: 100%;
/*min-width: 1000px;*/
-webkit-box-shadow: 0px 1px 1px 0px rgba(250, 250, 250, .5);
-moz-box-shadow: 0px 1px 1px 0px rgba(250, 250, 250, .5);
box-shadow: 0px 1px 1px 0px rgba(250, 250, 250, .5);
padding-top: 60px; /* Gere l'espace entre le top et la barre de menu */
background: url('../img/binding_dark.png');
}
nav {
margin-bottom: 30px;
width: 100%;
background: -moz-linear-gradient(top, #353535 0%, #222222 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#353535), color-stop(100%,#222222));
background: -webkit-linear-gradient(top, #353535 0%,#222222 100%);
background: -o-linear-gradient(top, #353535 0%,#222222 100%);
background: -ms-linear-gradient(top, #353535 0%,#222222 100%);
background: linear-gradient(top, #353535 0%,#222222 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#353535', endColorstr='#222222',GradientType=0 );
border-width: 1px 0 1px 0;
border-style: solid;
border-color: #000;
}
The header is the wide black block and the nav is inside it.
Here is an exemple of the issue:
The header won't fill all the page (horizontally), the li element would overflow, and gradient background would split.
Is there a solution to this please ?
Here is your corrected css and fiddle link
header {
width: 100%;
-webkit-box-shadow: 0px 1px 1px 0px rgba(250, 250, 250, .5);
-moz-box-shadow: 0px 1px 1px 0px rgba(250, 250, 250, .5);
box-shadow: 0px 1px 1px 0px rgba(250, 250, 250, .5);
padding-top: 60px; /* Gere l'espace entre le top et la barre de menu */
background: url('../img/binding_dark.png');
}
hgroup,
main,
nav {
margin-bottom: 30px;
width: 100%;
background: -moz-linear-gradient(top, #353535 0%, #222222 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#353535), color-stop(100%,#222222));
background: -webkit-linear-gradient(top, #353535 0%,#222222 100%);
background: -o-linear-gradient(top, #353535 0%,#222222 100%);
background: -ms-linear-gradient(top, #353535 0%,#222222 100%);
background: linear-gradient(top, #353535 0%,#222222 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#353535', endColorstr='#222222',GradientType=0 );
border-top:1px solid #000;
border-bottom:1px solid #000;
}
/* nav:before {
border-top: 1px solid #444;
}
nav:after {
border-top: 1px solid #333;
}*/
nav ul {
/*width: 808px;*/
height: 45px;
margin: 0 auto;
/*border-left: 1px solid #111;
border-right: 1px solid #444;*/
}
nav li {
float: left;
list-style-type:none;
}
nav li a {
display: inline-block;
/*width: 200px;*/
width:auto;
padding:0 50px;
height: 45px;
font: bold 15px 'Arial', sans-serif;
color: #fff;
text-decoration: none;
text-align: center;
line-height: 48px;
text-shadow: 1px 1px 0px #111;
filter: dropshadow(color=#111, offx=1, offy=1);
border-left: 1px solid #444;
border-right: 1px solid #111;
background-color:#2B2B2B;
}
nav li a:hover {
background: -moz-linear-gradient(top, #444 0%, #222 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#444), color-stop(100%,#222));
background: -webkit-linear-gradient(top, #444 0%,#222 100%);
background: -o-linear-gradient(top, #444 0%,#222 100%);
background: -ms-linear-gradient(top, #444 0%,#222 100%);
background: linear-gradient(top, #444 0%,#222 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#444', endColorstr='#222',GradientType=0 );
/*background-color:#2F2F2F;*/
}
nav li a:active {
background: #222;
-webkit-box-shadow: inset 0px 0px 3px 1px rgba(0, 0, 0, .3);
-moz-box-shadow: inset 0px 0px 3px 1px rgba(0, 0, 0, .3);
box-shadow: inset 0px 0px 3px 1px rgba(0, 0, 0, .3);
}
nav li a:active:after {
content: "";
display: block;
width: 100%;
height: 4px;
position: relative;
bottom: 6px;
background: -moz-linear-gradient(top, #ff5e1f 0%, #ff3410 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff5e1f), color-stop(100%,#ff3410));
background: -webkit-linear-gradient(top, #ff5e1f 0%,#ff3410 100%);
background: -o-linear-gradient(top, #ff5e1f 0%,#ff3410 100%);
background: -ms-linear-gradient(top, #ff5e1f 0%,#ff3410 100%);
background: linear-gradient(top, #ff5e1f 0%,#ff3410 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff5e1f', endColorstr='#ff3410',GradientType=0 );
}
There are other issues with the layout, but for the immediate problem, you could try
#page-wrap header {min-width: 1400px;}
Try increasing the width of the nav ul.
nav ul {
width: 809px;
height: 45px;
margin: 0 auto;
border-left: 1px solid #111;
border-right: 1px solid #444;
}
You can use Developer Tools(F12) to inspect elements.
Check this .

CSS3 create this button using only single DIV

I am trying to create a button similar to this in CSS3. (all HTML5 browsers should be supported):
Button image
HTML:
<div class="buttonClass">Nitin Mukesh</div>
CSS:
body {
background: gray;
margin-top: 50px;
margin-left: 50px;
}
.buttonClass {
width: 300px;
height: 40px;
padding: 10px 60px;
-webkit-border-radius: 7px;
-moz-border-radius: 7px;
border-radius: 7px;
background: -moz-linear-gradient(top, #FFFFFF 0%, #91BDD6 100%); /* firefox */
border: solid #91BDD6 5px;
outline: solid #fff 5px;
-moz-box-shadow: 3px 1px 24px #000000;
-webkit-box-shadow: 3px 1px 24px #000000;
box-shadow: 3px 1px 24px #000000;
}
JSFiddle
I could possible think of a solution that using 2 div will solve the problem with outer div hold the white outline and box-shadow and inner div with outline and gradient color.
Is it possible to achieve this using single div.
Many thanks for any inputs
This is what I came up with: http://jsfiddle.net/psycketom/heGu9/2/
.button
{
display: block;
background-image: linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -o-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -moz-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -ms-linear-gradient(bottom, rgb(145,189,214) 0%, rgb(255,255,255) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgb(145,189,214)),
color-stop(1, rgb(255,255,255))
);
/* Added second shadow for that "black" effect */
box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-o-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-ms-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-moz-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
-webkit-box-shadow: 0px 0px 0px 5px white, 0px 0px 10px 5px black;
border-radius: 15px;
-o-border-radius: 15px;
-ms-border-radius: 15px;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border: solid 5px rgb(145,189,214);
padding: 60px;
margin: 7px; /* to complement the outside shadow */
}
box-shadow can have multiple shadow, so:
http://jsfiddle.net/cyzw8/4/
.buttonClass {
width: 200px;
height: 40px;
/* padding: 10px 60px;*/
text-align:center;
line-height:40px;
border-radius: 7px;
background-image:-webkit-linear-gradient(top,#FFF 0%,#91BDD6 100%);
background-image: -moz-linear-gradient(top, #FFFFFF 0%, #91BDD6 100%);
background-image:-ms-linear-gradient(top,#FFF,#91BDD6);
background-image:-o-linear-gradient(top,#FFF,#91BDD6);
background-image:linear-gradient(top,#FFF,#91BDD6);
border: solid #91BDD6 5px;
box-shadow: 0px 0px 0px 5px #fff, 5px 3px 12px #000000;
}
This is what I see in my Chrome:
Here is a second way http://jsfiddle.net/Merec/Va4qG/
<div class="buttonClass"><span>Nitin Mukesh</span></div>
.buttonClass {
display: inline-block;
background: #fff;
border: 2px solid #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
background: rgb(255,255,255); /* Old browsers */
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(145,189,214,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(145,189,214,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(145,189,214,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#91bdd6',GradientType=0 ); /* IE6-9 */
}
.buttonClass span {
padding: 5px 10px;
display: block;
border: 2px solid #91bdd6;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}

Is it possible to perfectly replicate this in css3?

The div: sidebar-top at http://alex.piechowski.org/school/...
CSS:
.sidebar-top {
float: left;
height: 32px;
width: 292px;
background: url(../images/sidebar_top.png) no-repeat;
padding: 4px 15px;
}
Note, it's an image. Is it possible without that image?
You can achieve a fairly similar effect with these rules:
border-top-right-radius: 12px;
border-top-left-radius: 12px;
border: 1px solid #ccc;
width: 290px;
background: -webkit-linear-gradient(top, white 0%,#ddd 100%);
background: linear-gradient(to bottom, white 0%,#ddd 100%);
I think this DEMO is what you need
.sidebar-top {
background: #ccc;
border: 1px solid rgba(0,0,0,0.5);
border-radius: 6px;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
-o-box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
-webkit-box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
-moz-box-shadow: inset 0 -20px 40px #aaa, inset 0 20px 40px #fff, 0 2px 6px rgba(0,0,0,0.5);
padding: 0px 20px 15px 10px;
width: 500px;
}
h2 {
text-align: center;
font-family: "Helvetica Neue", sans-serif;
color: #444;
text-shadow: 0 1px 1px #fff;
font-size: 14px;
margin: -0 -20px 10px -10px;
padding: 5px 15px;
border-radius: 5px 5px 0 0;
-webkit-border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
background: rgba(0,0,0,0.2);
border-bottom: 2px groove rgba(255,255,255,0.75);
box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
-o-box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
-webkit-box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
-moz-box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
}
Absolutely.
you'll need to set a background-color then you can do a border to get the 1px border and border-radius that just encompasses the top corners, sort of like this:
background-color: grey;
border: 1px solid black;
border-radius: 5px 5px 0 0;
To get the gradient, you can set up a box-shadow using the inset to get the desired gradient, or as another answer suggests, use a linear-gradient.
.sidebar-top {
float: left;
height: 38px;
width: 292px;
-webkit-border-top-left-radius: 15px;
-webkit-border-top-right-radius: 15px;
-moz-border-radius-topleft: 15px;
-moz-border-radius-topright: 15px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
border:1px solid #D3D3D3;
background-color:#FBFBFB;
background-image: -ms-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: -moz-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: -o-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #FBFBFB), color-stop(1, #EAEFEF));
background-image: -webkit-linear-gradient(top, #FBFBFB 0%, #EAEFEF 100%);
background-image: linear-gradient(to bottom, #FBFBFB 0%, #EAEFEF 100%);
}
.sidebar-top h2 {
color: #666666;
font: bold 16px Arial,Helvetica,sans-serif;
letter-spacing: -1px;
margin: 10px;
padding:0px;
text-transform: capitalize;
}
Yes it is, you can use the below mentioned css
from here you can generate css based gradient effects
http://www.colorzilla.com/gradient-editor/
.sidebar-top {
background: rgb(254,255,255); /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZlZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjM1JSIgc3RvcC1jb2xvcj0iI2Y3ZjdmNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlZWVlZWUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, rgba(254,255,255,1) 0%, rgba(247,247,247,1) 35%, rgba(238,238,238,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(254,255,255,1)), color-stop(35%,rgba(247,247,247,1)), color-stop(100%,rgba(238,238,238,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(254,255,255,1) 0%,rgba(247,247,247,1) 35%,rgba(238,238,238,1) 100%); /* W3C */
border: 1px solid #d3d3d3;
border-radius: 10px 10px 0 0;
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#feffff', endColorstr='#eeeeee',GradientType=0 ); /* IE6-8 */
float: left;
height: 32px;
padding: 4px 15px;
width: 292px;
}