I have a div that has a background image but has 50% opacity.
Now I have a div that is child and I want what every the content it has to have 100% opacity. You can see in the snipplet headings and textbox and button has less opacity.
Can anyone help how to fix this thing? I tried to apply opacity 100% to child but it didn't work.
/* CSS to be fixed*/
#home_div
{
background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/1/1e/Shoppers_on_Dundas%2C_near_Yonge.jpg/1200px-Shoppers_on_Dundas%2C_near_Yonge.jpg");
opacity: 0.5;
filter: alpha(opacity=50);
/*background-color: #0050A0;*/
background-color: lightgrey;
padding-top: 200px;
color: white;
padding-bottom: 200px;
height: 100%;
}
#home_div_content
{
opacity: 1.0;
filter: alpha(opacity=100);
text-align: center;
}
#header
{
height: 70px;
border-bottom: 4px solid lightgrey;
}
#header_content
{
margin-top: 10px;
margin-left: 80px;
}
.brandmark
{
margin-top: -20px;
}
.link_to a
{
color: #0050A0 !important;
}
.featured_div
{
display: none;
}
.featured_close_anchor, .featured_anchor_close
{
text-align: center;
}
#heading, #tag_line
{
top: -300px;
position:relative;
color: #0050A0;
}
#search
{
border-radius: 0 !important;
border-color: #0050A0 !important;
width: 60%;
height: 35px;
padding: 8px 15px;
color: #0050A0; /* change color of text to be typed inside search box */
font-size: 13px;
line-height: 20px;
background-color: transparent;
border: 1px solid #ccc;
-webkit-box-shadow: none;
box-shadow: none;
}
.btn-custom {
color: #FFFFFF;
background-color: #0050A0; /* change button color */
border-radius: 0!important; /* button border radius */
padding: 5px 11px; /* Button size change*/
margin-top: -3.5px;
border-top: 2px solid #0050A0;
border-bottom: 3px solid #0050A0;
margin-left: -3px;
}
.btn-custom:hover{
background-color:#9AC94B; /* change button color on hover */
border-radius: 0!important;
}
.left_categories
{
padding-top: 5px;
padding-bottom: 5px;
margin-bottom: 1px;
border-left: 4px solid #0050A0;
}
.left_categories:hover
{
border-top: 1px solid lightgrey;
border-bottom: 1px solid lightgrey;
border-left: 4px solid #E5002B;
}
.active_category
{
background-color: #0050A0;
color: white !important;
border-left: 4px solid #E5002B;
}
.search_section
{
margin-top: 30px;
}
a
{
text-decoration: none !important;
}
.flash_nav
{
height: 90px;
border: 0 !important;
background-color: #283442;
}
.gradient
{
background: -moz-linear-gradient(left, white 0%, white 45%, #12A8E0 85%, #0050A0 100%);
}
.flash_navbar a
{
color: black !important;
}
.search_form
{
width: 70%;
}
.nav_form
{
border-radius: 0;
margin-top: 27px;
}
#searchBar
{
border-color: #0050A0;
}
#searchButton
{
background-color: #0050A0;
color: white;
border: none;
}
<div id="home_div">
<div class="container" id="home_div_content">
<h1 id="heading">Find your product!</h1>
<h4 id="tag_line">Search what you are looking for.</h4>
<form method="GET" action="/product/search">
<input type="text" name="product" id="search" placeholder="Enter product name" class="searchTextBox" />
<button type="submit" id="quick-search" class="btn btn-custom"><span class="glyphicon glyphicon-search custom-glyph-color"></span></button>
</form>
<br />
view <i class="fa fa-chevron-down"></i> featuring
</div>
</div>
FIDDLE
An opacity rule will always affect child/descendant elements since they are part of the parent, and the rule says the parent should be 50% opacity.
To get round this, use a pseudo element and give that reduced opacity rather than the parent.
HTML
<div id='outer'>
<div id='inner'></div>
</div>
CSS
#outer { width: 200px; height: 200px; position: relative; padding: 2em; }
#outer::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: red; opacity: .5; z-index: -1; }
#inner { width: 100%; height: 100%; background: blue; }
Fiddle.
Related
Can someone help me figure out why there's a single pixel space between the border of the input range and the top and right edge of the thumb slider? I don't recall this being here before and I can't figure out what is causing it.
#media screen and (min-width:720px) {
.financecalc {
margin-bottom: 0;
width: 300px;
}
.financetext {
width: calc(100% - 330px);
}
}
#media screen and (min-width:960px) {
.financecalc {
width: 400px;
}
.financetext {
width: calc(100% - 430px);
}
}
.paycalc {
background-color: white;
border: 2px solid #b2221b;
border-radius: 8px;
box-shadow: 0 3px 5px 1px black;
padding: 10px;
text-align: center;
width: calc(100% - 24px);
}
.paycalc label {
display: block;
margin-bottom: 4px;
}
.paycalc input[type=range] {
-webkit-appearance: none;
background: #f0f0f0;
border: 2px solid #b2221b;
border-radius: 4px;
display: block;
height: 16px;
opacity: 0.9;
outline: none;
padding: 0;
width: calc(100% - 4px);
}
.paycalc input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 16px;
background: #b2221b;
cursor: pointer;
}
.paycalc input[type=range]::-moz-range-thumb {
width: 20px;
height: 16px;
background: #b2221b;
cursor: pointer;
}
.calcSlider {
margin-bottom: 0;
width: calc(100% - 100px);
}
#interestSlider {
direction: rtl;
}
.calcBox,
.interestBox,
.paymentBox {
background-color: #555;
border: 3px inset #909090;
border-radius: 2px;
color: white;
padding: 6px;
}
.calcBox {
margin-bottom: 0;
width: 62px;
}
.interestBox {
width: 100%;
}
.paymentBox {
width: calc(100% - 18px);
}
.calcBox div,
.paymentBox div {
color: inherit;
margin: 0;
}
.calcBox div:first-of-type,
.paymentBox div:first-of-type {
font-size: 12px;
width: 12px;
}
.calcBox div:last-of-type,
.paymentBox div:last-of-type {
font-size: 18px;
width: calc(100% - 14px);
}
<div id="calculator" class="financecalc">
<form id="myForm" class="paycalc">
<div class="calcSlider">
<label for="downPaymentSlider">Down Payment</label>
<input id="downPaymentSlider" name="downPaymentSlider" type="range" value="500" min="250" max="5000" step="50">
</div>
</form>
</div>
The white line can appear at various zoom levels depending on how the system is mapping CSS pixels to screen pixels (there being several screen pixels to a CSS pixel on many higher def screens nowadays).
It's a bit like a rounding error, a screen pixel can get 'left behind' in the calculations.
As your thumb and your border are the same color here's a slightly unpleasant hack, but it overcomes the problem visually.
This snippet makes the height of the thumb equal to the height of the input element plus its top and bottom borders - this gives the system lots of wiggle room when it's dropping or including a screen pixel and the user won't see bits of white.
#media screen and (min-width:720px) {
.financecalc {
margin-bottom: 0;
width: 300px;
}
.financetext {
width: calc(100% - 330px);
}
}
#media screen and (min-width:960px) {
.financecalc {
width: 400px;
}
.financetext {
width: calc(100% - 430px);
}
}
.paycalc {
background-color: white;
border: 2px solid #b2221b;
border-radius: 8px;
box-shadow: 0 3px 5px 1px black;
padding: 10px;
text-align: center;
width: calc(100% - 24px);
}
.paycalc label {
display: block;
margin-bottom: 4px;
}
.paycalc input[type=range] {
-webkit-appearance: none;
background: #f0f0f0;
border: 2px solid #b2221b;
border-radius: 4px;
display: block;
height: 16px;
opacity: 0.9;
outline: none;
padding: 0;
width: calc(100% - 4px);
}
.paycalc input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 16px;
height: 20px;
/* 16px + 2x2px */
background: #b2221b;
cursor: pointer;
}
.paycalc input[type=range]::-moz-range-thumb {
width: 20px;
height: 20px;
background: #b2221b;
cursor: pointer;
}
.calcSlider {
margin-bottom: 0;
width: calc(100% - 100px);
}
#interestSlider {
direction: rtl;
}
.calcBox,
.interestBox,
.paymentBox {
background-color: #555;
border: 3px inset #909090;
border-radius: 2px;
color: white;
padding: 6px;
}
.calcBox {
margin-bottom: 0;
width: 62px;
}
.interestBox {
width: 100%;
}
.paymentBox {
width: calc(100% - 18px);
}
.calcBox div,
.paymentBox div {
color: inherit;
margin: 0;
}
.calcBox div:first-of-type,
.paymentBox div:first-of-type {
font-size: 12px;
width: 12px;
}
.calcBox div:last-of-type,
.paymentBox div:last-of-type {
font-size: 18px;
width: calc(100% - 14px);
}
<div id="calculator" class="financecalc">
<form id="myForm" class="paycalc">
<div class="calcSlider">
<label for="downPaymentSlider">Down Payment</label>
<input id="downPaymentSlider" name="downPaymentSlider" type="range" value="500" min="250" max="5000" step="50">
</div>
</form>
</div>
I have the following flex item (#globalSearchContLi) inside a flex-container. The container is an unordered list.
My problem is that I'm creating a fun looking search bar with a half-sphere submit button. The button is pretty much attached to the search bar with inline-block and margin properties.
This bundle (the search bar and button) won't center in the div any way I try to.
I tried setting #globalSearchCont with a specific width and auto side margins, but the whole flexbox presentation won't display correctly on mobile.
Any suggestions/advice? Thanks in advance.
#globalSearchContLi {
flex-grow: 7;
margin: 0px 15px;
flex-basis: 100px;
}
#globalSearchContLi {
flex-grow: 7;
margin: 0px 15px;
flex-basis: 100px;
}
#munchGlobalSearchbar {
width: 240px;
height: 50px;
/* box-shadow: 0 0 0 1px#000,0 0 0 3px #FFF, 0 0 0 5px #333; */
font-weight: 300;
font-size: 1.6rem;
border-radius: 10px;
display: inline-block;
margin-top: 20px;
text-align: center;
background-color: #edad0c;
border-bottom: 2px solid #333;
border-top: 2px solid #333;
border-left: 2px solid #333;
}
#munchGlobalSearchbar::placeholder {
color: #000;
}
#globalSearchBtn {
background-image: url(../imgs/addOn/panEmoji.png);
width: 50px;
height: 51px;
margin: 0px 0px -17px -12px !important;
border-bottom-right-radius: 50%;
border-top-right-radius: 50%;
display: inline-block;
border: 2px solid #333;
background-color: #38b32b;
transition: .2s all ease;
}
.backImageCon {
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
<li id="globalSearchContLi">
<div id="globalSearchCont">
<input placeholder="Search..." type="textbox" name="globalSearch" id="munchGlobalSearchbar">
<div id="globalSearchBtn" class="backImageCon"></div>
</div>
</li>
Use justify-content: center on the parent to horizontally center the button elements.
#globalSearchContLi {
list-style-type: none;
margin-left: 0;
}
#globalSearchCont {
display: flex;
justify-content: center;
height: 50px;
}
#munchGlobalSearchbar {
width: 240px;
font-weight: 300;
font-size: 1.6rem;
border-radius: 10px;
text-align: center;
background-color: #edad0c;
border-bottom: 2px solid #333;
border-top: 2px solid #333;
border-left: 2px solid #333;
}
#munchGlobalSearchbar::placeholder {
color: #000;
}
#globalSearchBtn {
background-image: url(../imgs/addOn/panEmoji.png);
width: 50px;
border-bottom-right-radius: 50%;
border-top-right-radius: 50%;
border: 2px solid #333;
background-color: #38b32b;
transition: .2s all ease;
margin-left: -10px;
}
.backImageCon {
background-repeat: no-repeat;
background-size: contain;
background-position: center;
}
ul {
margin: 0;
padding: 0;
}
* {
box-sizing: border-box;
}
<ul>
<li id="globalSearchContLi">
<div id="globalSearchCont">
<input placeholder="Search..." type="textbox" name="globalSearch" id="munchGlobalSearchbar">
<div id="globalSearchBtn" class="backImageCon"></div>
</div>
</li>
</ul>
I am trying to build a Dual Step Slider using HTML and CSS alone without any JQuery. It is working fine in Chrome and Mozilla, But in IE11, it is not registering the click inside first input element.
I designed the slider by using position:absolute and made two html input sliders on top of each other. In IE, i could click and drag on Second Input Elemenr only.
.slider {
-webkit-appearance: none;
width: 100%;
//height: 10px;
position: absolute;
//background: #f3f3f3;
outline: none;
border-radius: 8px;
}
.slider input {
pointer-events: none;
position: absolute;
overflow: hidden;
left: 25%;
top: 15px;
width: 50%;
outline: none;
height: 18px;
margin: 0;
padding: 0;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 8px;
background: #E6E6E6;
border: none;
border-radius: 3px;
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
//border: none;
height: 20px;
width: 20px;
border-radius: 50%;
background: white;
border: 1px solid #3972D6;
margin-top: -4px;
cursor: pointer;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 20px;
height: 20px;
border-radius: 50%;
background: #e6e6e6;
border: 2px solid #cdcdcd;
pointer-events: all;
position: relative;
z-index: 1;
outline: 0;
}
.slider::-moz-range-thumb {
width: 20px;
height: 20px;
background: #ea4550;
pointer-events: all;
position: relative;
z-index: 10;
-moz-appearance: none;
}
.slider input::-moz-range-track {
position: relative;
z-index: -1;
border: 0;
}
.slider input:last-of-type::-moz-range-track {
-moz-appearance: none;
background: none transparent;
border: 0;
}
.slider input[type="range"]::-moz-focus-outer {
border: 0;
}
.flex-next {
display: flex;
justify-content: flex-start;
}
.dual-slider-container {
position: relative;
width: 100%;
}
.dual-slider-text-left {
position: relative;
bottom: 12px;
right: 8px;
.text-style {
color: #303030;
font-size: 20px;
font-weight: 600;
text-align: right;
}
.text2 {
text-align: right;
font-size: 14px;
}
}
.dual-slider-text-right {
position: relative;
bottom: 12px;
left: 8px;
.text-style {
color: #303030;
font-size: 20px;
font-weight: 600;
text-align: left;
}
.text2 {
text-align: left;
font-size: 14px;
}
}
.pointer {
cursor: pointer;
}
//Internet Explorer Support
input[type=range]::-ms-track {
width: 100%;
height: 8px;
/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
background: transparent;
/*leave room for the larger thumb to overflow with a transparent border */
border-color: transparent;
border-width: 6px 0;
/*remove default tick marks*/
color: transparent;
}
#lower::-ms-fill-lower {
background: #E6E6E6;
border-radius: 10px;
}
#lower::-ms-fill-upper {
background: #E6E6E6;
border-radius: 10px;
}
#higher::-ms-fill-lower {
background: transparent;
border-radius: 10px;
}
#higher::-ms-fill-upper {
background: transparent;
border-radius: 10px;
}
input[type=range]::-ms-thumb {
//border: none;
height: 18px;
width: 18px;
border-radius: 50%;
background: white;
border: 1px solid #3972D6;
//cursor: hand;
}
input[type=range]::-ms-tooltip {
display: none;
}
<div style="padding:8px" class="col-12 row m-0">
<div class="dual-slider-text-left col-2 p-0">
<div class="text-style">
{{minValue}}
</div>
<div class="text2">{{minValueText}}</div>
</div>
<div class="col-8 p-0">
<div class="dual-slider-container">
<input (click)="getSliderOneValue($event)" type="range" min="{{minValue}}" max="{{maxValue}}" step="1"
value="{{sliderOneValue}}"
class="slider" [disabled]="disabled" [ngClass]="{'pointer' : !disabled}"
id="lower">
</div>
<div class="dual-slider-container">
<input (click)="getSliderTwoValue($event)" type="range" min="{{minValue}}" max="{{maxValue}}" step="1"
value="{{sliderTwoValue}}"
class="slider" [disabled]="disabled" [ngClass]="{'pointer' : !disabled}"
id="higher">
</div>
</div>
<div class="dual-slider-text-right col-2 p-0">
<div class="text-style">{{maxValue}}</div>
<div class="text2">{{maxValueText}}</div>
</div>
</div>
It seems that you can only reach the second slider if they're lapped in IE. You could use two slides side by side as a workaround. I make a demo and you could refer to it.
body {
min-height: 100px;
}
div {
display: flex;
}
input {
flex: 1 0 0;
min-width: 0;
padding: 0;
}
input::-webkit-slider-thumb {
margin: 0;
padding: 0;
}
output {
display: block;
text-align: center;
margin-top: 3px;
color: gray;
}
<div>
<input id="a" type="range" min="0" max="10" value="0" />
<input id="b" type="range" min="11" max="20" value="20" />
</div>
<output></output>
I am designing a FM player using pure CSS (no javascript) and tested the layout in Chrome, Firefox, Internet Explorer (IE), and Edge browsers. Except Internet Explorer, the layout shows 99% accuracy as below.
The layout in IE is shown below,
Is it possible to get 100% layout accuracy in all cross-browsers (others like Opera, Safari, etc.)?
The HTML code is used is below,
<body>
<div id="player">
<audio id="musicPlayer" autoplay="autoplay">
<source src="hls.mp3"/>
</audio>
<span id="playPause" onclick="playPause()"><img src="images/play.png" id="playMusic"/></span>
<span id="time">00:00:00</span>
<span id="volumeIcon"><img src="images/volume.png" id="volume"/></span>
<input type="range" id="changeVolume" oninput="SetVolume(this.value)" onchange="SetVolume(this.value)" step="1" min="0" max="100" value="100"/>
</div>
</body>
and CSS code is below,
body {
width:100%;
margin:0 auto;
padding:0px;
font-family:helvetica;
}
#player {
width:400px;
margin:0 auto;
padding:5px;
box-sizing:border-box;
border-radius: 4px;
border: 1px outset darkgreen;
box-shadow: 5px 0 5px -5px black, -5px 0 5px -5px black;
background-image: linear-gradient(lightgreen, PaleGreen, lightgreen);
}
#time {
float:left;
height:20px;
line-height:20px;
margin-left:2px;
margin-right:5px;
margin-top:3px;
}
#playMusic, #pauseMusic {
float:left;
height:18px;
margin-left:2px;
margin-right:5px;
margin-top:3px;
cursor: default;
border-radius: 3px;
border: 1px solid limegreen;
background-image: linear-gradient(lightgreen, PaleGreen, lightgreen);
outline:none;
}
#playMusic:hover, #pauseMusic:hover {
background:#94d362;
border-radius: 3px;
border: 1px solid ForestGreen;
background-color:lightgreen;
background: hsl(100, 100%, 85%);
}
input[type=range] {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
width: 120px;
height:18px;
line-height:18px;
margin-left:2px;
margin-right:5px;
margin-top:3px;
position: absolute;
background-color: transparent;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #228442;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
input[type=range]::-moz-range-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
input[type=range]::-ms-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 3px 0;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
input[type=range]::-ms-fill-upper {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
input[type=range]::-ms-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
margin: 0;
}
input[type=range]:focus::-ms-fill-lower {
background: #228442;
}
input[type=range]:focus::-ms-fill-upper {
background: #228442;
}
#volume {
margin-left:134px;
width:20px;
}
The live test URL: https://biox.ml/fm
After some research, I finally found out that you should use the flex positioning (supported by IE11).
First, I edited the HTML design to use block elements (and to pack together the volume icon and range input to simplify the CSS styling).
I set a display:flex for div#player to enable flex positioning.
I put a flex-grow:1 to div#time to let it fill the remaining space.
I put to div#volume an align-items:center style to vertical align the range input and an align-content:flex-end to place the volume box to the right of the div#player.
Finally, I set the top and the bottom paddings of the range input to 0 for IE11, and the height to 100% otherwise IE crops the thumb.
Plus, some minor changes for the finishing and code cleaning.
body {
width: 100%;
margin: 0 auto;
padding: 0px;
font-family: helvetica;
}
/* Beginning of the edited part */
#player {
display: flex;
height: 28px;
width: 400px;
align-items: center;
margin: 0 auto;
padding: 0 5px 0 5px;
background-image: linear-gradient(lightgreen, PaleGreen, lightgreen);
border-radius: 4px;
border: 1px outset darkgreen;
box-sizing: border-box;
box-shadow: 5px 0 5px -5px black, -5px 0 5px -5px black;
}
div#playPause,
div#volume {
height: 18px;
}
div#playPause {
margin-right: 5px;
border: 1px solid limegreen;
border-radius: 3px;
outline: none;
}
div#volume {
display: flex;
align-items: center;
align-content: flex-end;
}
div#playPause img,
div#volume img {
height: 100%;
}
div#time {
flex-grow: 1;
}
div#volume input[type=range] {
width: 120px;
height:100%;
margin: 0;
padding: 0 0 0 5px;
/* 0 paddings is important here */
background-color: transparent;
}
div#volume input[type=range]:focus {
outline: none;
}
/* End of the edited part
Below untouched specific-browser styling the "skin" of the range input
"Untouched" except the prefix "div#volume"
*/
div#volume input[type=range] {
appearance: none;
-moz-appearance: none;
-webkit-appearance: none;
}
div#volume input[type=range]:focus {
outline: none;
}
div#volume input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
div#volume input[type=range]::-webkit-slider-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
div#volume input[type=range]:focus::-webkit-slider-runnable-track {
background: #228442;
}
div#volume input[type=range]::-moz-range-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
box-shadow: 0;
background: #228442;
border-radius: 3px;
border: 0;
}
div#volume input[type=range]::-moz-range-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
-webkit-appearance: none;
margin-top: -4px;
}
div#volume input[type=range]::-ms-track {
width: 100%;
height: 3px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 3px 0;
color: transparent;
}
div#volume input[type=range]::-ms-fill-lower {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
div#volume input[type=range]::-ms-fill-upper {
background: #228442;
border: 0;
border-radius: 3px;
box-shadow: 0;
}
div#volume input[type=range]::-ms-thumb {
box-shadow: 0;
border: 0;
height: 10px;
width: 10px;
border-radius: 10px;
background: darkgreen;
cursor: pointer;
margin: 0;
}
div#volume input[type=range]:focus::-ms-fill-lower {
background: #228442;
}
div#volume input[type=range]:focus::-ms-fill-upper {
background: #228442;
}
<div id="player">
<audio id="musicPlayer" autoplay="autoplay">
<source src="hls.mp3"/>
</audio>
<div id="playPause" onclick="playPause()">
<img src="https://biox.ml/fm/images/play.png" id="playMusic" />
</div>
<div id="time">00:00:00</div>
<div id="volume">
<img src="https://biox.ml/fm/images/volume.png" id="playMusic" />
<input type="range" id="changeVolume" oninput="SetVolume(this.value)" onchange="SetVolume(this.value)" step="1" min="0" max="100" value="100" />
</div>
</div>
I think that changing the vertical align property in the CSS might help:
#changeVolume{
vertical-align: middle;
}
Update
You could try doing this:
#player{
display: table-cell;
vertical-align: middle;
}
#changeVolume{
display: inline-block;
}
I hope so that would work...
Hi I'm trying to make a Pomodoro clock. I've made a play button by removing border-right and increasing border-left width to create a triangle.
My questions is - how do I apply border-radius to it?
https://codepen.io/jenlky/pen/ypQjPa?editors=1100
<div id="all-buttons" class="buttons">
<!-- play button -->
<div id="play" class="play-button"></div>
<!-- pause button -->
<div id="pause">
<div class="line-1"></div>
<div class="line-2"></div>
</div>
<!-- end of play and pause button-->
</div>
.play-button {
z-index: 2;
width: 48px;
height: 48px;
border-style: solid;
border-width: 24px 0px 24px 48px;
border-color: white white white #FF8F83;
}
HTML play button:
.circle_inner{
position: relative;
height: 100%;
}
.circle_inner:before{
content: "";
display: block;
width: 0;
height: 0;
border-style: solid;
border-width: 10px 0 10px 20px;
border-color: transparent transparent transparent #000;
position: absolute;
top: 50px;
left: 50%;
margin: -10px 0 0 -7px;
}
<div class="circle_inner">
</div>
Try this (Less)
<div class="control play">
<span class="left"></span><span class="right"></span>
</div>
.control {
#color: #ffb160;
#highlight: darken(#color, 10%);
#duration: 0.4s;
#sin: 0.866;
#size: 112px;
border-radius: 50%;
margin: 20px;
padding: #size*0.25;
width: #size;
height: #size;
font-size: 0;
white-space: nowrap;
text-align: center;
cursor: pointer;
&, .left, .right, &:before {
display: inline-block;
vertical-align: middle;
transition: border #duration, width #duration, height #duration, margin #duration;
transition-tiomig-function: cubic-bezier(1, 0, 0, 1);
}
&:before {
content: "";
height: #size;
}
&.pause {
.left, .right {
margin: 0;
border-left: #size*0.33 solid #color;
border-top: 0 solid transparent;
border-bottom: 0 solid transparent;
height: #size*#sin;
}
.left {
border-right: #size*0.2 solid transparent;
}
}
&.play {
#border: #size/4;
.left {
margin-left: #size/6;
border-left: #size*#sin/2 solid #color;
border-top: #border solid transparent;
border-bottom: #border solid transparent;
border-right: 0px solid transparent;
height: #size - 2*#border;
}
.right {
margin: 0;
border-left: #size*#sin/2 solid #color;
border-top: #border solid transparent;
border-bottom: #border solid transparent;
height: 0px;
}
}
&:hover {
border-color: #highlight;
.left, .right {
border-left-color: #highlight;
}
}
}