How should these CSS classes be positioned? - html

How would you position these CSS classes?
I'm talking about the order from 1st to last. Top to bottom.
Starting with .wrap, ending with .hide.
I just readjusted all of these classes, but which would be a good way line these up?
All help would be greatly appreciated.
Something like this?
https://jsfiddle.net/49ajbhte/35/
<div class="wrape">
<div class="covere" title="OPEN"></div>
<ul class="nav">
.wrape {
position: relative;
width: 266px;
height: 174px;
margin-top: 8px;
overflow: hidden;
}
.covere {
width: 266px;
height: 174px;
background: url("https://i.imgur.com/dCneQvW.png") no-repeat 0 0;
cursor: pointer;
border: 3px solid #0059dd;
box-sizing: border-box;
}
.covere {
display: none;
}
.inactivee .covere {
display: block;
}
.covere::before,
.covere::after {
content: "";
position: absolute;
top: 0;
left: 86px;
width: 3px;
height: 100%;
background: #0059dd;
}
.covere::after {
left: 177px;
}
.nav {
margin: 0;
padding: 0;
list-style: none;
}
.nav li {
float: left;
}
.nav a {
float: left;
width: 50px;
height: 50px;
margin: 0 4px 12px 0;
color: transparent;
background: rgba(0, 0, 0, .2);
border: 3px solid #0059dd;
box-sizing: border-box;
}
.nav a:hover {
border: 3px solid red;
}
.nav li:nth-of-type(5n) a {
margin-right: 0;
}
.nav li:nth-of-type(8) a {
opacity: 0;
}
.nav li:nth-of-type(15) a {
position: relative;
border: 3px solid #0059dd;
background: none;
}
.left-background {
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 100%;
background: rgba(0, 255, 255, 0.5);
}
.left-border {
position: absolute;
top: 0;
left: 12px;
width: 3px;
height: 100%;
background: #0059dd;
}
.middle-background {
position: absolute;
top: 0;
left: 15px;
width: 14px;
height: 100%;
background: rgba(255, 255, 255, 0.5);
}
.right-border {
position: absolute;
top: 0;
left: 29px;
width: 3px;
height: 100%;
background: #0059dd;
}
.right-background {
position: absolute;
top: 0;
left: 32px;
width: 12px;
height: 100%;
background: rgba(255, 0, 255, 0.5);
}
.inactivee a {
display: none;
}
.inactivee .playButtone {
display: none;
}
.activee .playButtone {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
width: 50px;
height: 50px;
background: rgba(0, 0, 0, .7);
cursor: pointer;
fill: #aaff00;
}
.activee {
background: url("https://i.imgur.com/dCneQvW.png") no-repeat -260px 0;
}
.playe,
.pausee {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 6px;
margin: auto;
}
.pausee {
left: 0;
}
.hide {
display: none;
}
or like this:
https://jsfiddle.net/49ajbhte/33/
<div class="wrape">
<div class="covere" title="OPEN"></div>
<ul class="nav">
.wrap {
position: relative;
width: 266px;
height: 174px;
margin-top: 8px;
overflow: hidden;
}
.nav a {
float: left;
width: 50px;
height: 50px;
margin: 0 4px 12px 0;
color: transparent;
background: rgba(0, 0, 0, .2);
border: 3px solid #0059dd;
box-sizing: border-box;
}
.nav a:hover {
border: 3px solid red;
}
.nav li:nth-of-type(5n) a {
margin-right: 0;
}
.nav li:nth-of-type(8) a {
opacity: 0;
}
.nav li:nth-of-type(15) a {
position: relative;
border: 3px solid #0059dd;
background: none;
}
.nav li:nth-of-type(15) a {
position: relative;
border: 3px solid #0059dd;
background: none;
}
.left-background {
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 100%;
background: rgba(0, 255, 255, 0.5);
}
.left-border {
position: absolute;
top: 0;
left: 12px;
width: 3px;
height: 100%;
background: #0059dd;
}
.middle-background {
position: absolute;
top: 0;
left: 15px;
width: 14px;
height: 100%;
background: rgba(255, 255, 255, 0.5);
}
.right-border {
position: absolute;
top: 0;
left: 29px;
width: 3px;
height: 100%;
background: #0059dd;
}
.right-background {
position: absolute;
top: 0;
left: 32px;
width: 12px;
height: 100%;
background: rgba(255, 0, 255, 0.5);
}
.inactivee a {
display: none;
}
.inactivee .playButtone {
display: none;
}
.covere {
width: 266px;
height: 174px;
background: url("https://i.imgur.com/dCneQvW.png") no-repeat 0 0;
cursor: pointer;
border: 3px solid #0059dd;
box-sizing: border-box;
}
.covere {
display: none;
}
.inactivee .covere {
display: block;
}
.covere::before,
.covere::after {
content: "";
position: absolute;
top: 0;
left: 86px;
width: 3px;
height: 100%;
background: #0059dd;
}
.covere::after {
left: 177px;
}
.nav {
margin: 0;
padding: 0;
list-style: none;
}
.nav li {
float: left;
}
.activee .playButtone {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
width: 50px;
height: 50px;
background: rgba(0, 0, 0, .7);
cursor: pointer;
fill: #aaff00;
}
.activee {
background: url("https://i.imgur.com/dCneQvW.png") no-repeat -260px 0;
}
.playe,
.pausee {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 6px;
margin: auto;
}
.pausee {
left: 0;
}
.hide {
display: none;
}
According to the html
This comes first
.wrape {
position: relative;
width: 266px;
height: 174px;
margin-top: 8px;
overflow: hidden;
}
Then Cover:
.covere {
width: 266px;
height: 174px;
background: url("https://i.imgur.com/dCneQvW.png") no-repeat 0 0;
cursor: pointer;
border: 3px solid #0059dd;
box-sizing: border-box;
}
Then these would come right before the 'a' anchor tag.
.nav {
margin: 0;
padding: 0;
list-style: none;
}
.nav li {
float: left;
}
Then the 'a' anchor tags would come next:
.nav a {
float: left;
width: 50px;
height: 50px;
margin: 0 4px 12px 0;
color: transparent;
background: rgba(0, 0, 0, .2);
border: 3px solid #0059dd;
box-sizing: border-box;
}
.nav a:hover {
border: 3px solid red;
}
.nav li:nth-of-type(5n) a {
margin-right: 0;
}
.nav li:nth-of-type(8) a {
opacity: 0;
}
.nav li:nth-of-type(15) a {
position: relative;
border: 3px solid #0059dd;
background: none;
}
.left-background {
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 100%;
background: rgba(0, 255, 255, 0.5);
}
.left-border {
position: absolute;
top: 0;
left: 12px;
width: 3px;
height: 100%;
background: #0059dd;
}
.middle-background {
position: absolute;
top: 0;
left: 15px;
width: 14px;
height: 100%;
background: rgba(255, 255, 255, 0.5);
}
.right-border {
position: absolute;
top: 0;
left: 29px;
width: 3px;
height: 100%;
background: #0059dd;
}
.right-background {
position: absolute;
top: 0;
left: 32px;
width: 12px;
height: 100%;
background: rgba(255, 0, 255, 0.5);
}
Then these would come next? but I have no idea why.
.wrape.inactivee a {
display: none;
}
.wrape.inactivee .playButtone {
display: none;
}
Then these would come after that.
.activee .playButtone {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
width: 50px;
height: 50px;
background: rgba(0, 0, 0, .7);
cursor: pointer;
fill: #aaff00;
}
.activee {
background: url("https://i.imgur.com/dCneQvW.png") no-repeat -260px 0;
}
.playe,
.pausee {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 6px;
margin: auto;
}
.pausee {
left: 0;
}
.hide {
display: none;
}

Both of those work and wont effect your code. However, the first one will keep you from getting lost in your code. Its always good to arrange your html the same as your CSS.

Related

Custom slider positioning elements over it.(HTML+CSS)

Creating a custom slider which should be supporting Chrome and IE11.
Facing issues positioning the thumb and elements(White circle and red oval) on the slider track.
The white circles should be connected with a line.
Here is the fiddle of what i have achieved.
https://jsfiddle.net/Pravin_it14/7t9bsrdn/7/
/*Slider*/
.areaDetail_graph_04 {
height: 87px;
width: 614px!important;
position: relative;
/* background-color: rgba(255,255,255,0.5); */
/* border-radius: 8px 8px 8px 8px; */
}
.areaDetail_graph_04 .img {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmYAAABXCAYAAACulYmrAAAACXBIWXMAAAsSAAALEgHS3X78AAADzklEQVR4nO3dT25TVxTA4ROHCuq4LaZS1M5AQuowLCE7apbQJSQ7yhYyrIQEM6pIjaGx3UYUXB3zAlWC0H0PiI+U75tkEsfRu5Of7r+3tVqt4qrZfPkwIg4iYj8i9q79AgAAQ5xExHFEHE4n4+dXP38tzGbz5WFE/OpRAwB8VUfTyfjg/1/wPsxm8+X9ruDMkAEA3IycQdufTsYv89tGIcoAADYl2+u4a7F3YRYRv4kyAICN2OtaLLbOzhe50f+ZcQAA2KhHo+70JQAAm3Uw6q7EAABgs/ZzKfP6RWYAANy4kUcOAFCDMAMAKEKYAQAUIcwAAIoQZgAARdz5nH9jcfE6Xryax19/X8TFv2+MKQBwK929sx3ff3s3dr8br38ONei6jIywp6ezdZABAPBBhtnj3ek61vrqHWZni3/WUfbm7VtDAADwEduj0TrOHuzc6/V4eu0xyyj7/Y8/RRkAwCdkK2UzZTv10Rxml8uXAAC0yXbqsw+/OcwsXwIA9JPt1GdiqynMcpO/jf4AAP1lQ+VNFi2awuz0fGkYAAAGyuvFWjTPmAEAMExrSzWFmctjAQCGa20pr2QCAChCmAEAFCHMAACKEGYAAEU0hdmQl3ACANCvpZrCLN+SDgDAMK0t1RRmP/8wMQwAAAO1tlRTmO3c/casGQDAANlQ2VItmjf/P96dxvbIWQEAgFbZTtlQrZpLKzet9fnDAAC3XbZTn0OUvabAHuzci19++tHMGQDAJ2QrZTNlO/WxdXa+WPV9sPm+p6enMy83BwC4IveU9Z0puzQozC4tLl7Hi1fzdaB50TkAcFtlhGWQ5enL1o3+H/NZYQYAwJdjsxgAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBEZZicGAwBg404yzI6NAwDAxh1vnZ0vHkbEM2MBALBRj0bTyfh5RBwZBwCAjTnKJttarVYxmy/vd0uae8YDAOBGnUwn4ydxeSpzOhm/jIh9BwEAAG7USddga++vy8g462rNsiYAwNeXy5dPugmytfVS5lWz+TIPBBx0BWd5EwDgy8gZstw+dtjt8/8gIv4DGWnfdriGm90AAAAASUVORK5CYII=);
height: 87px;
margin-left: -1px;
width: 614px!important;
z-index: 1;
position: absolute;
top: 0;
}
.range {
position: absolute;
top: 0;
z-index: 99;
width: 614px!important;
}
.range-labels {
margin: 55px -20px 0 5px;
padding: 0;
list-style: none;
width: 614px!important;
}
.range-labels li {
position: relative;
float: left;
width: 100px;
text-align: center;
color: #808093;
font-size: 11px;
font-weight: 600;
cursor: pointer;
}
.range-labels li::before {
position: absolute;
top: -35px;
right: 0;
left: 0px;
content: "";
margin: 0 auto;
width: 10px;
height: 10px;
background: #E9EEF0;
border-radius: 50%;
}
.range-labels li:nth-child(1):before {
position: absolute;
top: -42px;
right: 0;
left: -20px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(2):before {
position: absolute;
top: -42px;
right: 0;
left: -20px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(3):before {
position: absolute;
top: -42px;
right: 0;
left: -20px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(4):before {
position: absolute;
top: -42px;
right: 0;
left: -20px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(5):before {
position: absolute;
top: -42px;
right: 0;
left: -35px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(6):before {
position: absolute;
top: -42px;
right: 0;
left: -50px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #826AA7;
border-radius: 40%;
}
.range-labels li::after {
position: absolute;
top: -35px;
right: 0;
left: 0px;
content: "";
margin: 0 auto;
width: 9px;
height: 9px;
background: #E9EEF0;
border-radius: 50%;
}
input[type=range] {
-webkit-appearance: none;
margin: 0px 0 0 30px;
width: 88%;
z-index: 9999;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
height: 2px;
background: #E9EEF0;
width: 100%;
cursor: pointer;
animate: 0.2s;
}
input[type=range]::-webkit-slider-thumb {
position: relative;
height: 29px;
width: 29px;
background: transparent;
cursor: pointer;
z-index: 9999;
-webkit-appearance: none;
margin-top: -14px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAACXBIWXMAAAsSAAALEgHS3X78AAACeklEQVRIicWXMWgTYRiGv+T+y9WgtlocSrAekmBDS61ZrEtHoZSCg0MHIVNBJDg5hg6S0amEUugU6ODQoYuLY5fWpUZR0pJQLi2hiFitldjL3Rl5691xJrnepfnTvpAld3mfu+///+97E6jX6+RXyUx2jIjwkR0/UYgon0un8n59PKEAhXukl6qmPZREMXDjWl/oeu8V+/rB4RF9/f6jpmpaXRLFt9Vjdc7rAVyhyUxWDvdIyzVNv39HvslityLU33vV1ehX9Td9Kim0rezpIZG9qx6rT3LplOIbmsxkHwlC8PWQPCgl4lEKieKp1XCqpmm0WSjRlrKrGsafmVw6teoJffpq6Zmu6/MP7g4LscGIb1ijirsVWv/w2WCMPV98MbvgCsUbikxYmZoYF04rpV99O/xJb9Y2DE03HjvfOOgAyigp3pAHEIIP/OAL/yYoNg3WsJOSthL8bkcGJPj/B8WxwC7FpumGxkfjBH/znP+D4hziWLSzS9sRfOEPjg3FwR+JyrwYLYVzDg6uMbPjBC6HL7W8ebNQpPdbJd/m94ailIjHmr7HpkJHA4+hl6K1uZnAoJXJWQROef/LGMorO3tpN2Vy5OC50BrEvG7gtaZOAapgPLmJ55qaHAXlzWMecnH1kMnJBzFwMYDRnLsp+IMD3smaYuIXy5Xp/tHmRs9rTYvlygmHrI2EiLGt7E0m4tGmVshjTTHYkSh0w5gjqw3ilRExMPG7oY2PBYK/lZ3sc4pMg4iBic9T8Nup7Kvwt2xtKEIUMg0iBq9NBR/4mVnJDmkXn5EsdZoGsYYoqe806AC3lXtRShyLM+feBvj5JXy3B+j4vwwR/QWs5oN+Ncbm9gAAAABJRU5ErkJggg==);
}
input[type=range]::-ms-track {
position: absolute;
width: 100%;
height: 2px;
cursor: pointer;
animate: 0.2s;
margin-top: -10px;
background: transparent;
border-color: transparent;
border-width: 16px 0;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #E9EEF0;
border: 0.2px solid#E9EEF0;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #E9EEF0, 0px 0px 1px #E9EEF0;
}
input[type=range]::-ms-fill-upper {
background: #E9EEF0;
border: 0.2px solid #E9EEF0;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #E9EEF0, 0px 0px 1px #E9EEF0;
}
input[type=range]::-ms-thumb {
position: absolute;
z-index: 99999;
border: transparent;
height: 29px;
width: 29px;
background: transparent;
cursor: pointer;
background-image: url("../parts/icons/handle.png");
}
input[type=range]:focus::-ms-fill-lower {
background: #E9EEF0;
}
input[type=range]:focus::-ms-fill-upper {
background: #E9EEF0;
}
<div class="areaDetail_graph_04">
<div class="img">
<div class="range">
<input type="range" class="slider" width="614px" value="0" min="0" max="5" id="rangeSlider">
</div>
<ul class="range-labels">
<li>11:00</li>
<li>12:00</li>
<li>13:00</li>
<li>14:00</li>
<li>15:00</li>
<li>16:00</li>
</ul>
<span id="valBox"></span>
</div>
</div>
Do you mean the white circle is behind the white line?
You could try adding "margin-bottom: -15px;" to
"input[type=range]::-webkit-slider-runnable-track";
In addition, you'd better change the position of the circles inside li(5) and li (6).
use "left: -20px;"both in "li:nth-child(5)" and "li:nth-child(6)".
The complete code is as follows:
/*Slider*/
.areaDetail_graph_04 {
height: 87px;
width: 614px!important;
position: relative;
/* background-color: rgba(255,255,255,0.5); */
/* border-radius: 8px 8px 8px 8px; */
}
.areaDetail_graph_04 .img {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAmYAAABXCAYAAACulYmrAAAACXBIWXMAAAsSAAALEgHS3X78AAADzklEQVR4nO3dT25TVxTA4ROHCuq4LaZS1M5AQuowLCE7apbQJSQ7yhYyrIQEM6pIjaGx3UYUXB3zAlWC0H0PiI+U75tkEsfRu5Of7r+3tVqt4qrZfPkwIg4iYj8i9q79AgAAQ5xExHFEHE4n4+dXP38tzGbz5WFE/OpRAwB8VUfTyfjg/1/wPsxm8+X9ruDMkAEA3IycQdufTsYv89tGIcoAADYl2+u4a7F3YRYRv4kyAICN2OtaLLbOzhe50f+ZcQAA2KhHo+70JQAAm3Uw6q7EAABgs/ZzKfP6RWYAANy4kUcOAFCDMAMAKEKYAQAUIcwAAIoQZgAARdz5nH9jcfE6Xryax19/X8TFv2+MKQBwK929sx3ff3s3dr8br38ONei6jIywp6ezdZABAPBBhtnj3ek61vrqHWZni3/WUfbm7VtDAADwEduj0TrOHuzc6/V4eu0xyyj7/Y8/RRkAwCdkK2UzZTv10Rxml8uXAAC0yXbqsw+/OcwsXwIA9JPt1GdiqynMcpO/jf4AAP1lQ+VNFi2awuz0fGkYAAAGyuvFWjTPmAEAMExrSzWFmctjAQCGa20pr2QCAChCmAEAFCHMAACKEGYAAEU0hdmQl3ACANCvpZrCLN+SDgDAMK0t1RRmP/8wMQwAAAO1tlRTmO3c/casGQDAANlQ2VItmjf/P96dxvbIWQEAgFbZTtlQrZpLKzet9fnDAAC3XbZTn0OUvabAHuzci19++tHMGQDAJ2QrZTNlO/WxdXa+WPV9sPm+p6enMy83BwC4IveU9Z0puzQozC4tLl7Hi1fzdaB50TkAcFtlhGWQ5enL1o3+H/NZYQYAwJdjsxgAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBHCDACgCGEGAFCEMAMAKEKYAQAUIcwAAIoQZgAARQgzAIAihBkAQBEZZicGAwBg404yzI6NAwDAxh1vnZ0vHkbEM2MBALBRj0bTyfh5RBwZBwCAjTnKJttarVYxmy/vd0uae8YDAOBGnUwn4ydxeSpzOhm/jIh9BwEAAG7USddga++vy8g462rNsiYAwNeXy5dPugmytfVS5lWz+TIPBBx0BWd5EwDgy8gZstw+dtjt8/8gIv4DGWnfdriGm90AAAAASUVORK5CYII=);
height: 87px;
margin-left: -1px;
width: 614px!important;
z-index: 1;
position: absolute;
top: 0;
}
.range {
position: absolute;
top: 0;
z-index: 99;
width: 614px!important;
}
.range-labels {
margin: 55px -20px 0 5px;
padding: 0px;
list-style: none;
width: 614px!important;
}
.range-labels li {
position: relative;
float: left;
width: 100px;
text-align: center;
color: #808093;
font-size: 11px;
font-weight: 600;
cursor: pointer;
}
.range-labels li::before {
position: absolute;
top: -35px;
right: 0;
left: 0px;
content: "";
margin: 0 auto;
width: 10px;
height: 10px;
background: #E9EEF0;
border-radius: 50%;
}
.range-labels li:nth-child(1):before {
position: absolute;
top: -42px;
right: 0;
left: -10px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(2):before {
position: absolute;
top: -42px;
right: 0;
left: -10px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(3):before {
position: absolute;
top: -42px;
right: 0;
left: -4px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(4):before {
position: absolute;
top: -42px;
right: 0;
left: 0px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(5):before {
position: absolute;
top: -42px;
right: 0;
/*left: -35px;*/
left: 6px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #F06C81;
border-radius: 40%;
}
.range-labels li:nth-child(6):before {
position: absolute;
top: -42px;
right: 0;
/*left: -50px;*/
left: 8px;
content: "";
margin: 0 auto;
width: 35px;
height: 23px;
background: #826AA7;
border-radius: 40%;
}
/*White circle01*/
.range-labels li:nth-child(1):after {
left: -6px;
}
/*White circle02*/
.range-labels li:nth-child(2):after {
left: -10px;
}
/*White circle03*/
.range-labels li:nth-child(3):after {
left: -1px;
}
/*White circle04*/
.range-labels li:nth-child(4):after {
left: 0px;
}
/*White circle05*/
.range-labels li:nth-child(5):after {
left: 7px;
}
/*White circle06*/
.range-labels li:nth-child(6):after {
left: 10px;
}
/*White circle*/
.range-labels li::after {
position: absolute;
top: -35px;
right: 0px;
/*left: 0px;*/
content: "";
margin: 0px auto;
width: 9px;
height: 9px;
background: #E9EEF0;
border-radius: 50%;
}
input[type=range] {
-webkit-appearance: none;
margin: -10px 0px 0px 35px;
width: 88%;
z-index: 9999;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
height: 2px;
background: #E9EEF0;
width:100%;
margin-bottom: -15px; /*add*/
/*margin-right: -5px;*/
cursor: pointer;
animate: 0.2s;
}
input[type=range]::-webkit-slider-thumb {
position: relative;
height: 29px;
width: 29px;
background: transparent;
cursor: pointer;
z-index: 9999;
-webkit-appearance: none;
margin-top: -14px;
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAACXBIWXMAAAsSAAALEgHS3X78AAACeklEQVRIicWXMWgTYRiGv+T+y9WgtlocSrAekmBDS61ZrEtHoZSCg0MHIVNBJDg5hg6S0amEUugU6ODQoYuLY5fWpUZR0pJQLi2hiFitldjL3Rl5691xJrnepfnTvpAld3mfu+///+97E6jX6+RXyUx2jIjwkR0/UYgon0un8n59PKEAhXukl6qmPZREMXDjWl/oeu8V+/rB4RF9/f6jpmpaXRLFt9Vjdc7rAVyhyUxWDvdIyzVNv39HvslityLU33vV1ehX9Td9Kim0rezpIZG9qx6rT3LplOIbmsxkHwlC8PWQPCgl4lEKieKp1XCqpmm0WSjRlrKrGsafmVw6teoJffpq6Zmu6/MP7g4LscGIb1ijirsVWv/w2WCMPV98MbvgCsUbikxYmZoYF04rpV99O/xJb9Y2DE03HjvfOOgAyigp3pAHEIIP/OAL/yYoNg3WsJOSthL8bkcGJPj/B8WxwC7FpumGxkfjBH/znP+D4hziWLSzS9sRfOEPjg3FwR+JyrwYLYVzDg6uMbPjBC6HL7W8ebNQpPdbJd/m94ailIjHmr7HpkJHA4+hl6K1uZnAoJXJWQROef/LGMorO3tpN2Vy5OC50BrEvG7gtaZOAapgPLmJ55qaHAXlzWMecnH1kMnJBzFwMYDRnLsp+IMD3smaYuIXy5Xp/tHmRs9rTYvlygmHrI2EiLGt7E0m4tGmVshjTTHYkSh0w5gjqw3ilRExMPG7oY2PBYK/lZ3sc4pMg4iBic9T8Nup7Kvwt2xtKEIUMg0iBq9NBR/4mVnJDmkXn5EsdZoGsYYoqe806AC3lXtRShyLM+feBvj5JXy3B+j4vwwR/QWs5oN+Ncbm9gAAAABJRU5ErkJggg==);
}
input[type=range]::-ms-track {
position: absolute;
width: 100%;
height: 2px;
cursor: pointer;
animate: 0.2s;
margin-top: -10px;
background: transparent;
border-color: transparent;
border-width: 16px 0;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #E9EEF0;
border: 0.2px solid#E9EEF0;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #E9EEF0, 0px 0px 1px #E9EEF0;
}
input[type=range]::-ms-fill-upper {
background: #E9EEF0;
border: 0.2px solid #E9EEF0;
border-radius: 2.6px;
box-shadow: 1px 1px 1px #E9EEF0, 0px 0px 1px #E9EEF0;
}
input[type=range]::-ms-thumb {
position: absolute;
z-index: 99999;
border: transparent;
height: 29px;
width: 29px;
background: transparent;
cursor: pointer;
background-image: url("../parts/icons/handle.png");
}
input[type=range]:focus::-ms-fill-lower {
background: #E9EEF0;
}
input[type=range]:focus::-ms-fill-upper {
background: #E9EEF0;
}
<div class="areaDetail_graph_04">
<div class="img">
<div class="range">
<input type="range" class="slider" width="614px" value="0" min="0" max="5" id="rangeSlider">
</div>
<ul class="range-labels">
<li>11:00</li>
<li>12:00</li>
<li>13:00</li>
<li>14:00</li>
<li>15:00</li>
<li>16:00</li>
</ul>
<span id="valBox"></span>
</div>
</div>

Parent div tag alters styling

So I am trying to do conditional rendering and i've narrowed it down to the outside parent <div> tag being the culprit. So, I removed the conditional rendering and am trying to figure out why my card styling is being altered. Below I posted screenshots with and without parent div tag.
return (
<div>
<div className="card" id="chatcard">
<div className="card-body">
<h5 className="card-title">{this.props.user.user}</h5>
<div className="card-text">
<ChatList
user={this.props.user}
socket={this.props.socket}
currentUser={this.props.currentUser}
/>
</div>
</div>
<div className="card-footer">
<small className="text-muted">
<form>
<ChatField
user={this.props.user}
socket={this.props.socket}
chatusers={this.props.index}
/>
</form>
</small>
</div>
</div>
</div>
);
CSS
.chat {
color: white;
}
.chat .dropdown-toggle:after {
content: none;
}
.userbutton {
size: 2px;
}
.card {
color: black;
}
.card-text {
overflow: auto;
height: 10rem;
}
.onlinebar {
position: "absolute";
color: red;
bottom: 0;
left: 0;
}
#chatbtn {
color: black;
width: 200px;
margin-left: 5px;
margin-top: 0px;
}
.chatcollapse {
width: 100%;
height: 100%;
margin: 0px;
padding: 0px;
}
#chatHeader {
margin: 0px;
padding: 0px;
}
#chatcard {
width: 2rem;
}
.card-deck .card {
max-width: calc(25% + 80px);
}
.card-body {
padding: 0px;
margin: 0px;
}
.bubble-r {
align-items: flex-end;
position: relative;
background: #0072c6;
max-width: 100px;
padding: 5px;
font-family: arial;
margin: 0 auto;
font-size: 14px;
color: white;
border-radius: 6px;
}
.bubble-r:after,
.bubble-r:before {
left: 100%; /*change this from right to left*/
top: 42%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.bubble-r:after {
border-color: rgba(200, 200, 204, 0);
border-left-color: #0072c6; /*change this from right to left */
border-width: 8px;
margin-top: -3px;
}
.bubble-r:before {
border-color: rgba(200, 204, 0, 0);
border-left-color: #0072c6; /*change this from right to left*/
border-width: 8px;
margin-top: -3px;
}
.bubble {
position: relative;
background: #cad5d7;
max-width: 100px;
padding: 5px;
font-family: arial;
margin: 0 auto;
font-size: 14px;
border-radius: 6px;
}
.bubble:after,
.bubble:before {
right: 100%;
top: 42%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
}
.bubble:after {
border-color: rgba(255, 255, 204, 0);
border-right-color: #cad5d7;
border-width: 8px;
margin-top: -3px;
}
.bubble:before {
border-color: rgba(255, 204, 0, 0);
border-right-color: #cad5d7;
border-width: 8px;
margin-top: -3px;
}
#chatcard {
width: 40rem;
}
I adjusted the width within this and it worked. It's odd that adding the div tag caused this.

CSS styled checkbox not working when clicked

Index.html
<div class="wrap">
<div class="toggle">
<input type="checkbox" onclick='window.location.assign("newuser.html")'/>
<span class="btn"></span>
<span class="texts"></span>
<span class="bg"></span>
</div>
</div>
Index.css
#import url(http://fonts.googleapis.com/css? family=Open+Sans:400,600|Lato:300,400,700&subset=latin,cyrillic);
* {
margin: 0;
padding: 0;
}
body {
background: #ecf0f1;
}
.wrap {
width: 90px;
margin: 50px auto;
}
.toggle {
position: relative;
width: 82px;
height: 35px;
border: 3px solid #f9f9f9;
border-radius: 40px;
}
.toggle input[type="checkbox"] {
opacity: 0;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 84px;
height: 34px;
}
.toggle .btn {
display: block;
position: absolute;
z-index: 4;
top: -3px;
left: -1px;
width: 37px;
height: 37px;
background: #F5F5F5;
border: 1px solid #e8e8e8;
border-radius: 100%;
box-shadow: 0 2px 4px rgba(100, 100, 100, 0.1);
transition: left .25s ease-in-out;
}
.toggle input[type="checkbox"]:checked ~ .btn {
left: 44px;
}
.toggle .texts {
position: absolute;
top: 9px;
z-index: 2;
width: 100%;
font-family: 'Lato', Helvetica, sans-serif;
font-weight: bold;
color: #fff;
text-transform: uppercase;
font-size: 14px;
}
.toggle .texts:before {
content: "On";
position: absolute;
left: 12px;
}
.toggle .texts:after {
content: "Off";
position: absolute;
right: 11px;
}
.toggle .bg {
display: block;
background: #F56557;
position: absolute;
z-index: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 40px;
box-shadow: inset 0 0px 2px 1px rgba(0, 0, 0, 0.3);
transition: background .25s ease-in;
}
.toggle input[type="checkbox"]:checked ~ .bg {
background: #48C893;
}
I am creating an Android mobile application and I ran this code in Eclipse Luna. I managed to show the button but when it is clicked, nothing happens.
Your code is working. The style is changed onclick.
The problem might be somewhere else
* {
margin: 0;
padding: 0;
}
body {
background: #ecf0f1;
}
.wrap {
width: 90px;
margin: 50px auto;
}
.toggle {
position: relative;
width: 82px;
height: 35px;
border: 3px solid #f9f9f9;
border-radius: 40px;
}
.toggle input[type="checkbox"] {
opacity: 0;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
z-index: 10;
width: 84px;
height: 34px;
}
.toggle .btn {
display: block;
position: absolute;
z-index: 4;
top: -3px;
left: -1px;
width: 37px;
height: 37px;
background: #F5F5F5;
border: 1px solid #e8e8e8;
border-radius: 100%;
box-shadow: 0 2px 4px rgba(100, 100, 100, 0.1);
transition: left .25s ease-in-out;
}
.toggle input[type="checkbox"]:checked ~ .btn {
left: 44px;
}
.toggle .texts {
position: absolute;
top: 9px;
z-index: 2;
width: 100%;
font-family: 'Lato', Helvetica, sans-serif;
font-weight: bold;
color: #fff;
text-transform: uppercase;
font-size: 14px;
}
.toggle .texts:before {
content: "On";
position: absolute;
left: 12px;
}
.toggle .texts:after {
content: "Off";
position: absolute;
right: 11px;
}
.toggle .bg {
display: block;
background: #F56557;
position: absolute;
z-index: 0;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 40px;
box-shadow: inset 0 0px 2px 1px rgba(0, 0, 0, 0.3);
transition: background .25s ease-in;
}
.toggle input[type="checkbox"]:checked ~ .bg {
background: #48C893;
}
<div class="wrap">
<div class="toggle">
<input type="checkbox" />
<span class="btn"></span>
<span class="texts"></span>
<span class="bg"></span>
</div>
</div>
Look into the below jsfiddle for your code
your onClick might be faster that your vision
your code seems working fine please check from your end

CSS Hover over div to change another div's element

So i am trying to change the element of a different div using the :hover effect in CSS.
If you check my code you should understand what I am trying to accomplish.
When you hover over the project button i would like the slider-container to have the text 'projects' and so on for all of the buttons
I understand that the button needs to be before the slider container which it is, so i really don't understand why this is not working?
If anybody could either direct me to a better tutorial on using this hover effect and help me understand what the issue is i would be really appreciative.
Thanks Guys! :)
#content {
position: relative;
overflow: hidden;
width: 900px;
height: 440px;
background: #D5D5D5;
margin: auto;
top: 50px; left: 0; bottom: 0; right: 0;
-webkit-box-shadow: 0px 0px 23px 3px rgba(0,0,0,0.75);
-moz-box-shadow: 0px 0px 23px 3px rgba(0,0,0,0.75);
box-shadow: 0px 0px 23px 3px rgba(0,0,0,0.75);
}
.logo-container{
display: flex;
flex-direction: row;
position: relative;
width: 100%;
height: 100px;
justify-content: center;
margin: auto;
float: right;
top: 0px;
}
.blockicon {
position: relative;
width: 50px;
height: 50px;
top: 15px;
border-radius: 50%;
border: solid 5px black;
cursor: pointer;
font-size: 30px;
text-align: center;
vertical-align: middle;
line-height: 50px;
margin: 0 0.8%;
}
.projects {
background: #801113;
}
.projects:hover > .slider-container {
background: #801113;
}
.projects:hover > .slider-container:before {
content:"Projects";
}
.aboutme {
background: #1A8305;
}
.aboutme:hover > .slider-container {
background: #1A8305;
}
.aboutme:hover > .slider-container:before {
content:"About Me";
}
.contactme {
background: #E8BA1A;
}
.contactme:hover > .slider-container {
background: #E8BA1A;
}
.contactme:hover > .slider-container:before {
content:"Contact Me";
}
.helped {
background: #0049BB;
}
.helped:hover > .slider-container {
background: #0049BB;
}
.helped:hover > .slider-container:before {
content:"Helped";
}
.hobbys {
background: #A40CA3;
}
.hobbys:hover > .slider-container {
background: #A40CA3;
}
.hobbys:hover > .slider-container:before {
content:"Hobbys";
}
.slider-container {
position:absolute;
background: #CF4000;
width: 95%;
height: 320px;
margin: auto;
top: 400px; left: 0; bottom: 0; right: 0;
}
.slider-container:before {
position:absolute;
content:"Test";
font-size: 30px;
bottom: 20%;
left: 40%;
font-family: Aldrich;
padding: 0;
font-weight: bold;
color: white;
z-index: 999;
}
#media screen and (max-width: 900px) {
#content {
width: 100%;
}
#content-container {
width: 100%;
}
#footer {
width: 100%;
}
}
<div id="content">
<div class="logo-container">
<div class="blockicon projects"> P </div>
<div class="blockicon aboutme"> A </div>
<div class="blockicon contactme"> C </div>
<div class="blockicon helped"> H </div>
<div class="blockicon hobbys"> H </div>
<div class="slider-container">
</div>
</div>
</div>
Just use the general sibling combinator ~ and it will work.
#content {
position: relative;
overflow: hidden;
width: 900px;
height: 440px;
background: #D5D5D5;
margin: auto;
top: 210px;
left: 0;
bottom: 0;
right: 0;
-webkit-box-shadow: 0px 0px 23px 3px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 23px 3px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 23px 3px rgba(0, 0, 0, 0.75);
}
.logo-container {
display: flex;
flex-direction: row;
position: relative;
width: 100%;
height: 100px;
justify-content: center;
margin: auto;
float: right;
top: 0px;
}
.blockicon {
position: relative;
width: 50px;
height: 50px;
top: 15px;
border-radius: 50%;
border: solid 5px black;
cursor: pointer;
font-size: 30px;
text-align: center;
vertical-align: middle;
line-height: 50px;
margin: 0 0.8%;
}
.projects {
background: #801113;
}
.projects:hover ~ .slider-container {
background: #801113;
}
.projects:hover ~ .slider-container:before {
content: "Projects";
}
.aboutme {
background: #1A8305;
}
.aboutme:hover ~ .slider-container {
background: #1A8305;
}
.aboutme:hover ~ .slider-container:before {
content: "About Me";
}
.contactme {
background: #E8BA1A;
}
.contactme:hover ~ .slider-container {
background: #E8BA1A;
}
.contactme:hover ~ .slider-container:before {
content: "Contact Me";
}
.helped {
background: #0049BB;
}
.helped:hover ~ .slider-container {
background: #0049BB;
}
.helped:hover ~ .slider-container:before {
content: "Helped";
}
.hobbys {
background: #A40CA3;
}
.hobbys:hover ~ .slider-container {
background: #A40CA3;
}
.hobbys:hover ~ .slider-container:before {
content: "Hobbys";
}
.slider-container {
position: absolute;
background: #CF4000;
width: 95%;
height: 320px;
margin: auto;
top: 400px;
left: 0;
bottom: 0;
right: 0;
}
.slider-container:before {
position: absolute;
content: "Test";
font-size: 30px;
bottom: 20%;
left: 40%;
font-family: Aldrich;
padding: 0;
font-weight: bold;
color: white;
z-index: 999;
}
#media screen and (max-width: 900px) {
#content {
width: 100%;
}
#content-container {
width: 100%;
}
#footer {
width: 100%;
}
}
<div id="content">
<div class="logo-container">
<div class="blockicon projects">P</div>
<div class="blockicon aboutme">A</div>
<div class="blockicon contactme">C</div>
<div class="blockicon helped">H</div>
<div class="blockicon hobbys">H</div>
<div class="slider-container">
</div>
</div>
</div>
see here : jsfiddle
( changed only for .projects )
> means directly the element inside it's parent. for eg : parent > child.
for elements that are siblings like .projects and .slider-container use ~
for eg :
.projects:hover ~ .slider-container {
background: #801113;
}
.projects:hover ~ .slider-container:before {
content:"Projects";
}

Why is this animation working on every browser but chrome ? (has prefixes)

HTML
<div class="container-screenz service-graphic sg2">
<div class="screenz monitor">
<img src="img/geoqueri-monitor.jpg">
</div>
<div class="laptop">
<div class="screenz">
<img src="img/geoqueri-laptop.jpg">
</div>
<div class="btm"></div>
</div>
<div class="phone">
<div class="screenz">
<img src="img/geoqueri-phone.jpg">
</div>
<div class="shadow"></div>
</div>
<div class="ipad">
<div class="screenz">
<img src="img/geoqueri-tablet.jpg">
</div>
</div>
</div>
CSS (with added prefixes)
#keyframes scroll {
20%,
60% {
-webkit-transform:translateY(-62%);
-moz-transform:translateY(-62%);
-ms-transform:translateY(-62%);
-o-transform:translateY(-62%);
transform:translateY(-62%);
}
80% {
margin-top: -50px;
}
}
.service-graphic {
max-width: 42.500em;
font-size: 8px;
padding: 1em;
position: relative;
display: block;
margin: 0 auto;
.monitor {
width: 28.750em;
height: 17.5em;
position: relative;
background: #f8f8f8;
border: 0.625em solid #1f1f1f;
#include border-radius(0.625em);
border: 1.25em solid #1f1f1f;
margin: 0 auto;
.content-screenz {
width: 26.25em;
height: 15em;
left: 50%;
margin-left: -13.125em;
overflow: hidden;
}
&:before, &:after {
content: "";
position: absolute;
left: 50%;
}
&:before {
top: -0.25em;
margin: -0.188em 0 0 -0.188em;
width: 0.250em;
height: 0.250em;
#include border-radius(0.250em);
background: #d8dbe1;
top: -0.625em;
}
}
.laptop {
&:before {
content: "";
position: absolute;
left: 50%;
top: -0.25em;
margin: -0.188em 0 0 -0.188em;
width: 0.250em;
height: 0.250em;
#include border-radius(0.250em);
background: #d8dbe1;
top: -0.625em;
}
}
}
.screenz {
&:after {
width: 0.500em;
height: 0.500em;
#include border-radius(0.500em);
margin: 0 0 -0.25em -0.25em;
background: #e8ebf0;
bottom: -0.625em;
}
}
.monitor > div {
position: absolute;
}
.monitor .content-screenz:before,
.laptop .screenz:before,
.phone .screenz:before,
.ipad .screenz:before {
content: "";
position: absolute;
right: -5.625em;
width: 12.500em;
height: 18.750em;
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
-ms-transform:rotate(45deg);
-o-transform:rotate(45deg);
transform:rotate(45deg);
/*linear-gradient*/
background:-webkit-gradient(linear,left top,left bottom,color-stop(rgba(255, 255, 255, 0.5),0),color-stop(rgba(255, 255, 255, 0),1));
/*##prefixmycss->No equivalent*/
background:-webkit-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
background: -moz-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
background: -o-linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 100%);
z-index: 5;
}
.browser {
width: 15em;
height: 11.250em;
position: absolute;
left: 50%;
top: 50%;
margin: -5.625em 0 0 -7.5em;
background: #ffffff;
border: 1px solid #e8ebf0;
border-top: 1.25em solid #d8dbe1;
#include border-radius(0.313em);
}
.browser-content {
overflow: hidden;
height: 9.938em;
padding-top: 0.625em;
}
.btns {
position: absolute;
top: -1.25em;
left: 0.438em;
&:before {
content: "";
position: absolute;
left: 2.188em;
top: 0.313em;
height: 0.625em;
width: 11.563em;
background: #fff;
#include border-radius(3px);
}
}
.btns > li {
display: inline-block;
list-style: none;
width: 0.313em;
height: 0.313em;
#include border-radius(0.313em);
background: #fc5254;
margin-right: 0.250em;
}
.btns li:nth-child(2) {
background: #fcae52;
}
.btns li:nth-child(3) {
background: #66b34e;
}
.base {
width: 5.625em;
height: 3.1em;
bottom: -3.9em;
left: 50%;
margin-left: -2.8125em;
background: #e8ebf0;
bottom: -4.3em;
z-index: -1;
}
.base:before,
.base:after,
.grey-shadow:before,
.grey-shadow:after {
content: "";
position: absolute;
top: 0;
}
.base:before {
border-left: 0.813em solid transparent;
border-right: 0px solid transparent;
border-bottom: 3.125em solid #e8ebf0;
left: -0.77em;
}
.base:after {
border-right: 0.813em solid transparent;
border-left: 0px solid transparent;
border-bottom: 3.125em solid #e8ebf0;
right: -0.77em;
}
.base > div {
position: absolute;
}
.grey-shadow {
width: 5.625em;
height: 0.750em;
background: #d8dbe1;
top: 0;
}
.grey-shadow:before {
border-left: 3px solid transparent;
border-right: 0px solid transparent;
border-bottom: 0.75em solid #d8dbe1;
left: -3px;
}
.grey-shadow:after {
border-right: 3px solid transparent;
border-left: 0px solid transparent;
border-bottom: 0.75em solid #d8dbe1;
right: -2px;
z-index: 1;
}
.foot {
background: #e8ebf0;
}
.foot.top {
width: 7.250em;
height: 0.313em;
bottom: -0.3em;
left: 50%;
margin-left: -3.625em;
}
.foot.top:before,
.foot.top:after,
.foot.bottom:before {
content: "";
position: absolute;
top: 0px;
}
.foot.top:before {
border-left: 16px solid transparent;
border-right: 0px solid transparent;
border-bottom: 5px solid #e8ebf0;
left: -16px;
}
.foot.top:after {
border-right: 1em solid transparent;
border-left: 0px solid transparent;
border-bottom: 5px solid #e8ebf0;
right: -1em;
}
.foot.bottom {
width: 9.375em;
height: 0.313em;
bottom: -0.625em;
left: 50%;
margin-left: -4.688em;
}
.laptop {
width: 14.688em;
height: 9.688em;
background: #f8f8f8;
border: 0.75em solid #1f1f1f;
-webkit-border-radius:10px 10px 0 0;
-moz-border-radius:10px 10px 0 0;
border-radius:10px 10px 0 0;
position: absolute;
top: 14.5em;
right: 1.875em;
z-index: 10;
}
.laptop:before {
top: -0.3em;
}
.laptop > div {
position: absolute;
}
.laptop > .screenz {
width: 13.188em;
height: 8.188em;
left: 0;
margin-left: 0;
background: #fff;
overflow: hidden;
}
.btm {
width: 18.500em;
height: 0.625em;
bottom: -1.188em;
left: 50%;
margin-left: -9.25em;
-webkit-border-radius:0 0 20px 20px;
-moz-border-radius:0 0 20px 20px;
border-radius:0 0 20px 20px;
background: #e8ebf0;
z-index: 1;
}
.btm:before {
content: "";
position: absolute;
width: 42px;
height: 4px;
left: 50%;
top: 0;
margin-left: -21px;
-webkit-border-radius:0 0 5px 5px;
-moz-border-radius:0 0 5px 5px;
border-radius:0 0 5px 5px;
background: #d8dbe1;
}
.btm:after {
display: none;
content: "";
position: absolute;
width: 100%;
height: 0.25rem;
background: #bababa;
top: .5rem;
border-bottom-right-radius: 7.5rem 2.5rem;
border-bottom-left-radius: 7.5rem 2.5rem;
}
.phone {
width: 4.125em;
height: 8.750em;
position: absolute;
top: 15.75em;
left: 1em;
#include border-radius(0.5em);
background: #1f1f1f;
border: 1.563em solid #1f1f1f;
border-left: 0.313em solid #1f1f1f;
border-right: 0.313em solid #1f1f1f;
}
.phone:before,
.phone:after {
content: "";
position: absolute;
left: 50%;
background: #474e5d;
}
.phone:before {
background: #474e5d;
width: 1.250em;
height: 0.250em;
margin-left: -0.625em;
top: -0.75em;
#include border-radius(2px);
}
.phone:after {
width: 0.625em;
height: 0.625em;
#include border-radius(0.625em);
bottom: -1.125em;
margin-left: -0.313em;
}
.phone .screenz {
width: 3.50em;
height: 5.625em;
margin: 0 auto;
position: relative;
overflow: hidden;
background: #fff;
}
.ipad {
width: 8.75em;
height: 12.750em;
position: absolute;
top: 11.7em;
left: 6em;
#include border-radius(0.5em);
background: #1f1f1f;
border: 1.563em solid #1f1f1f;
border-left: 0.313em solid #1f1f1f;
border-right: 0.313em solid #1f1f1f;
}
.ipad:before,
.ipad:after {
content: "";
position: absolute;
left: 50%;
background: #474e5d;
}
.ipad:before {
background: #474e5d;
width: 1.250em;
height: 0.250em;
margin-left: -0.625em;
top: -0.75em;
#include border-radius(2px);
}
.ipad:after {
width: 0.625em;
height: 0.625em;
#include border-radius(0.625em);
bottom: -1.125em;
margin-left: -0.313em;
}
.ipad .screenz {
width: 8em;
height: 9.8em;
margin: 0 auto;
position: relative;
overflow: hidden;
background: #fff;
}
.ipad .content {
width: 100%;
left: 0%;
margin-left: 0px;
}
.monitor , .laptop, .ipad, .phone {
overflow: hidden;
img {
padding: 0 !important;
width: 100%;
height: 880px;
-webkit-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
-moz-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
-ms-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
-o-animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
animation:scroll 4s 1s cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
&:hover {
opacity: 1 !important;
}
}
}
#media screen and (min-width: 38em) {
.service-graphic {
font-size: 12px;
.monitor {
border: 1.25em solid #1f1f1f;
}
}
}
Original unmodified codepen :
http://codepen.io/nicholaspetersen/pen/BHjfk
So what I did was, I converted the LESS to CSS (since I do not know LESS) using
http://less2css.org/
The animation worked perfectly for Firefox, however on Chrome it did not. So I went through the code and added all the missing prefixes, as you can see in the CSS code I provided and it still does not work. I am now clueless, why will this work on Firefox but not Chrome?
Thanks
It's not enough to just add the prefixed transformations inside of a keyframe animation, you need to prefix the keyframe declaration itself as well. For example:
#-webkit-keyframes foo {
0% {
-webkit-transform: scale(0);
}
100% {
-webkit-transform: scale(1);
}
}
Also worth noting, you can view the compiled LESS in codepen by clicking on the 'eye' icon in the CSS pane. Hope this helps bud