2 Progress bars with different colors - html

I've made 2 progress bars with succes! But here's the hard part, I'm trying to give both of them a different color with CSS styling by using classes on the progress bars and styling them in CSS but it won't change color. I want the first bar to have the color #c30000 and the second bar to have the color #1eff00. But whenever I add the classes both of the bars go back to the default state of progress bars without styling.
.progress1 {
progress {
background-color: #eee;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
width: 250px;
height: 20px;
}
progress::-webkit-progress-bar {
background-color: #eee;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}
progress::-webkit-progress-value {
background-color: #c30000;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}
progress::-moz-progress-bar {
background-color: #c30000;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}
}
.progress2 {
progress {
background-color: #eee;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
width: 250px;
height: 20px;
}
progress::-webkit-progress-bar {
background-color: #eee;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}
progress::-webkit-progress-value {
background-color: #1eff00;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}
progress::-moz-progress-bar {
background-color: #1eff00;
border-radius: 2px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) inset;
}
}
<div class="progress1"><progress value="50" max="100"></progress></div>
<br />
<div class="progress2"><progress value="25" max="100"></progress></div>

Related

How can i convert box shadow to filter drop shadow?

Is there a way to convert box-shadow property value to filter drop-shadow?
I have tried doing this:
.boxes-container {
display: flex;
justify-content: center;
}
.boxshadow-box,
.filter-dropshadow-box {
display: block;
background-color: green;
margin: 50px;
padding: 50px;
width: 150px;
box-sizing: border-box;
}
.boxshadow-box {
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
}
.filter-dropshadow-box {
filter: drop-shadow(5px 5px 3px rgba(0, 0, 0, 0.2)) drop-shadow(8px 10px 1px rgba(0, 0, 0, 0.14)) drop-shadow(3px 14px 2px rgba(0, 0, 0, 0.12));
}
<div class="boxes-container">
<div class="boxshadow-box"></div>
<div class="filter-dropshadow-box"></div>
</div>
But I can't reach the same results for drop-shadow as box-shadow.
Can you please check the below code? Hope it will work for you. By Mistake, you passed the wrong value in filter drop-shadow.
.boxes-container {
display: flex;
justify-content: center;
}
.boxshadow-box,
.filter-dropshadow-box {
display: block;
background-color: green;
margin: 50px;
padding: 50px;
width: 150px;
box-sizing: border-box;
}
.boxshadow-box {
box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
}
.filter-dropshadow-box {
-webkit-filter: drop-shadow( 0px 5px 5px rgba(0, 0, 0, 0.2)) drop-shadow( 0px 8px 10px rgba(0, 0, 0, 0.14));
filter: drop-shadow( 0px 5px 5px rgba(0, 0, 0, 0.2)) drop-shadow( 0px 8px 10px rgba(0, 0, 0, 0.14));
}
<div class="boxes-container">
<div class="boxshadow-box"></div>
<div class="filter-dropshadow-box"></div>
</div>

Why does my custom scrollbar box shadow styles not affect the body scrollbar?

I have a simple scrollbar stylesheet that changes the scrollbar's appearance in Webkit based browsers. Here's the code:
::-webkit-scrollbar {
width: 14px;
height: 14px;
background-color: white;
-webkit-box-shadow: -1px 0px 0px 0px rgba(0, 0, 0, 0.1);
-moz-box-shadow: -1px 0px 0px 0px rgba(0, 0, 0, 0.1);
box-shadow: -1px 0px 0px 0px rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-button {
background-color: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
height: 50px;
background-color: rgba(0, 0, 0, 0.25);
border: 4px solid white;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4);
}
::-webkit-resizer {
background-color: rgba(0, 0, 0, 0.25);
}
<div style="height: 5000px;">
<br /><br />
<div style="margin: auto; width: 100px; height: 500px; overflow-y: scroll; border: 1px solid black;">
<div style="height: 1000px; padding: 24px;">
<div>Some content</div>
</div>
</div>
</div>
As you can see, the scrollbar within the black box has the box shadow on the left side. However, the one on the body does not, even though it is the same styles being applied to both. Why does this happen?
Just use the inset option in box-shadow for scroll bar shadows
::-webkit-scrollbar {
width: 14px;
height: 14px;
background-color: white;
-webkit-box-shadow: inset 0 0 6px black
}
::-webkit-scrollbar-button {
background-color: rgba(0, 0, 0, 0.25);
}
::-webkit-scrollbar-thumb {
height: 50px;
background-color: rgba(0, 0, 0, 0.25);
border: 4px solid white;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.4);
}
::-webkit-resizer {
background-color: rgba(0, 0, 0, 0.25);
}
html{
background-color:white;
height:100%;
}
<div style="height: 5000px;">
<br /><br />
<div style="margin: auto; width: 100px; height: 500px; overflow-y: scroll; border: 1px solid black;">
<div style="height: 1000px; padding: 24px;">
<div>Some content</div>
</div>
</div>
</div>

Div overlapping with outer divs on css transorm

.demo-div{
margin:auto;
width:50%;
border: 1px solid #d6f5f5;
background: #f6f6f6;
padding: 20px 5px 20px 5px;
min-height: 500px;
}
.demo-div .demo-div-content{
padding: 0px !important;
}
.demo-div-inner{
background: white;
min-height: 70px;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2);
margin-bottom: 10px;
padding: 30px;
transform:translateX(30%);
}
<div class="demo-div ">
<div class="demo-div-content">
<div class="demo-div-inner">swipe me out</div> </div>
</div>
When i apply translate to inner div , it comes on top of parent div.
But i want is that it should stay within parent on applying tranform.
Also i have event listener on demo-div-inner , so setting it z-index of parent div i.e. demo-div as -1 , stopped event listener from firing.
Add Another attributes margin-right at your demo-div-inner class.
.demo-div{
margin:auto;
width:50%;
border: 1px solid #d6f5f5;
background: #f6f6f6;
padding: 20px 5px 20px 5px;
min-height: 500px;
}
.demo-div .demo-div-content{
padding: 0px !important;
}
.demo-div-inner{
background: white;
min-height: 70px;
box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.14), 0 1px 7px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -1px rgba(0, 0, 0, 0.2);
margin-bottom: 10px;
padding: 30px;
margin-right: 66px;
transform:translateX(30%);
}
<div class="demo-div">
<div class="demo-div-content">
<div class="demo-div-inner">swipe me out</div>
</div>
</div>

How to create drop shadow?

I want to add drop shadow to input fields, I tried this code
.inp_text{
background: url(../images/inp_back.png) no-repeat;
border: none;
color: #393939;
height: 34px;
padding: 6px 6px 6px 6px;
width: 156px;
}
.inp_text:focus{
background: #fff;
box-shadow: 0 0 5px rgba(0, 0, 255, 1);
-webkit-box-shadow: 0 0 5px rgba(0, 0, 255, 1);
-moz-box-shadow: 0 0 5px rgba(0, 0, 255, 1);
border: 1px solid rgba(0, 0, 255, 0.8);
}
This is working fine in firefox but, I am not getting the blue glow in other browsers(IE & chrome). Please help.
use outline:none; in .inp_text you will find the desire result.
.inp_text{
background: url(../images/inp_back.png) no-repeat;
border: none;
color: #393939;
height: 34px;
padding: 6px 6px 6px 6px;
width: 156px;
outline:none;
}

Positioning buttons around a background image

I want to position multiple link buttons around an background image. Here is the HTML:
<body>
<div id="background">
<div id="abt">About Us</div>
<div id="ofc">Office</div>
<div id="staf">Staff</div>
<div id="msg">Message</div>
</div>
</body>
I want to position them around the background so that they stay fixed.
Example: http://jsfiddle.net/kimonante/2cvz4/1/
body {
background:url(http://www.factoryoutletstores.info/img/usa-map.gif) no-repeat;
background-attachment:fixed;
/*fix the shit*/
background-position:center;
}
.button-link {
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
border: solid 1px #20538D;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
padding: 10px 25px;
background: #0d0f12;
color: #FFF;
font-family:arial;
font-weight:600;
display:block;
}
.button-link:hover, .button-link:focus {
background: #356094;
border: solid 1px #2A4E77;
text-decoration: none;
}
.button-link:active {
-webkit-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
-moz-box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
background: #2E5481;
border: solid 1px #203E5F;
}
a {
text-decoration:none;
color:white;
width:100px;
text-transform:uppercase;
padding-left:18px;
}
#abt {
margin-left:540px;
margin-top:200px;
}
#ofc {
margin-left:160px;
margin-top:105px;
}
#msg {
margin-left:930px;
margin-top:-240px;
}
#staf {
margin-left:360px;
margin-top:260px;
}
As your buttons are positioned by pixels, you need to set your div#background to a fixed size and set the background to the div#background instead of the body.
Also remove the background attachement. This version works: http://jsfiddle.net/BTVZz/