Z-Index is "not working" - html

I'm learning HTML and CSS and have some problems. Thare are 3 html elements.
First one is navigation bar.
Seconde one is button in that navigation.
Third one is dropdown menu.
Basicly, i wont on hover of 2nd element slide down 3th one.
And i get that. Problem is 3th element when sliding down it appears OVER 1st and 2nd. element. With opacity 0.99 i managed to slid it UNDER element 2. But its still OVER element 1.
How can i put it under all. Is it possible?
Here is example of my code. https://jsfiddle.net/eth66zea/
.su-drop {
position: absolute;
left: 0px;
top: -100px;
height: 100px;
min-width: 200px;
background-color: greenyellow;
transition: all 0.333s;
z-index: -1;
display: inline;
opacity: 0.99
}
.su-header {
position: relative;
height: 70px;
color: white;
background-color: black;
border-bottom: 2px #1f7caf solid;
margin-bottom: 10px;
z-index: 5;
}
.su-header .su-ul {
position: relative;
list-style-type: none;
font-size: 16px;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 10%;
}
.su-header .su-ul .su-li{
position: relative;
float: left;
padding: 10px 10px;
line-height: 50px;
min-width: 100px;
text-align: center;
transition: all 0.6s;
cursor: pointer;
display: inline;
}
.su-header .su-ul .su-li:hover{
background-color: #1f7caf;
}
.su-header .su-li:last-child:hover > .su-drop{
top: 70px;
}
<div class="su-header">
<ul class="su-ul">
<li class="su-li"><i class="fa fa-heartbeat" aria-hidden="true"></i></li>
<li class="su-li">Test1</li>
<li class="su-li">Test2</li>
<li class="su-li">
Dropdown
<div class="su-drop"></div>
</li>
</ul>
</div>
Thx for your help.

Here is one way of doing it that gets around the z-index problem.
Instead of doing the transition on the top offset, you can try doing the transition on the height value.
Position the .su-drop element where you need it (bottom of .su-li) and give it an initial height of 0. On hover, you then set the height to the desired value.
If you want the sliver of color at the top, you would need to add a second element, .su-drop-up, but this may be optional.
If you don't have a height value for .su-drop, then you might need to alter your HTML, it all depends on the details of your layout and design.
.su-drop {
position: absolute;
left: 0px;
bottom: 0px;
height: 0px;
min-width: 200px;
background-color: greenyellow;
transition: all 0.333s;
z-index: -1;
display: inline;
opacity: 0.97
}
.su-drop-up {
position: absolute;
left: 0px;
top: -10px;
height: 10px;
min-width: 200px;
background-color: greenyellow;
transition: all 0.333s;
z-index: -1;
display: inline;
opacity: 0.97
}
.su-header {
position: relative;
height: 70px;
color: white;
background-color: black;
border-bottom: 2px #1f7caf solid;
margin-bottom: 10px;
z-index: 5;
opacity: 1;
}
.su-header .su-ul {
position: relative;
list-style-type: none;
font-size: 16px;
margin-top: 0px;
margin-bottom: 0px;
margin-left: 10%;
opacity: 0.98;
}
.su-header .su-ul .su-li {
position: relative;
float: left;
padding: 10px 10px;
line-height: 50px;
min-width: 100px;
text-align: center;
transition: all 0.6s;
cursor: pointer;
display: inline;
}
.su-header .su-ul .su-li:hover {
background-color: #1f7caf;
}
.su-header .su-li:last-child:hover > .su-drop {
height: 100px;
bottom: -100px;
}
.su-header .su-li:last-child:hover > .su-drop-up {
height: 0px;
}
<div class="su-header">
<ul class="su-ul">
<li class="su-li"><i class="fa fa-heartbeat" aria-hidden="true"></i>
</li>
<li class="su-li">Test1</li>
<li class="su-li">Test2</li>
<li class="su-li">
Dropdown
<div class="su-drop-up"></div>
<div class="su-drop"></div>
</li>
</ul>
</div>

Change your Height Property
.su-drop {
position: absolute;
left: 0px;
top:70px;
height: 0px;
min-width: 200px;
background-color: greenyellow;
transition: all 0.333s;
z-index: -1;
display: inline;
opacity: 0.97
}
.su-header .su-li:last-child:hover > .su-drop{
height:100px;
}
Working Demo https://jsfiddle.net/Rahul_Ravi/eth66zea/3/

Related

Buttons losing functionality when positioned over background image

I am having the weirdest problem: I am working on a portfolio page with images that should link to the various projects. There are 6 of these in total. Each of the images has a button that should live on top of it. When the button is hovered on by the user, it changes color, the cursor changes, and a popup with a short description of the project opens. When the button is clicked, there is an event listener that redirects to the project's page.
The problem is that in 2 out of the 6 instances, the moment I position the buttons inside the image, the buttons lose all functionality (including the event listener). As far as I can tell the code governing these 2 instances is the same as the other 4 where there is no such problem.
code where it doesn't work:
HTML:
<div class="container" id="linkTwo">
<img src="assets/images/bonez2.jpg" alt="bonez" style="width:200px; height:200px;" class="linkpic" >
<div class="btn1"id="btn1">Bone's Beatz<span id="bonezPop"> */some text that pops up/* </span></div>
</div>
CSS:
#linkTwo {
position: absolute;
top: 100px;
left: 230px;
}
#linkTwo #btn1:hover {
background-color: black;
}
#btn1 {
position: absolute;
left:20px;
padding-left: 23px;
padding-right: 23px;
}
#btn1 #bonezPop {
visibility: hidden;
width: 250px;
background-color: #883043;
color: #aa9e9e;
text-align: center;
border-radius: 6px;
border-style: solid;
border-color: black;
border-width: 2px;
padding: 5px 0;
position: absolute;
z-index: 1;
}
#btn1:hover #bonezPop {
visibility: visible;
}
.container #btn1 {
position: absolute;
top: -2px;
left: 20px;
font-size: 16px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 53px;
padding-right: 53px;
border: none;
cursor: pointer;
border-radius: 5px;
}
code that DOES work:
HTML:
<div class="container" id="linkFive">
<img src="assets/images/weather.jpg" alt="weather app" style="width:200px;height:200px;" class="linkpic">
<div class="btn3" id="btn3">Weather App<span id="weatherPop"> */some text that pops up */</span></div>
</div>
CSS:
#linkFive {
position: absolute;
top:320px;
}
#btn3 #weatherPop {
visibility: hidden;
width: 250px;
background-color: #883043;
color: #aa9e9e;
text-align: center;
border-radius: 6px;
border-style: solid;
border-color: black;
border-width: 2px;
padding: 5px 0;
position: absolute;
z-index: 1;
}
#btn3:hover #weatherPop {
visibility: visible;
}
#btn3 {
padding-left: 53px;
padding-right: 53px;
}
.container .btn3 {
position: absolute;
top: -2px;
left: 20px;
font-size: 16px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 60px;
padding-right: 40px;
border: none;
cursor: pointer;
border-radius: 5px;
}
.container .btn3:hover {
background-color: black;
}
I realize this whole thing would have been done much more easily with WordPress or some such, but this is a class assignment that requires I do this with code.
Thanks!
Short gif of how the problem looks
Found the answer. It was a different CSS rule that was for some reason breaking it:
.container {
position: relative;
width: 50%;
}
commenting this out solved the problem.

Centrally divided layout with animation (ONLY CSS)

IMPORTANT NOTE: only CSS/HTML, but not javascript (client does not allow it)
recently started the homepage of my site and wanted to make a centrally divided layout. Want to place the logo on the middle and one picture on top of it with a button to lead to the page, and one below it with the same function.
The animation should be a hover over the buttons (or defined area around it) as seen in the comp I did here:
GIF ANIMATION OF WHAT IS INTENDED
Similar to what is intended: https://jsfiddle.net/vja85zgL/
* {
margin: 0px;
padding: 0px;
}
#wrapper {
width: 80%;
height: 200px;
margin: auto;
}
#wrapper:hover #left:not(:hover) {
width: 25%;
transition: width 1s linear;
}
#wrapper:hover #right:not(:hover) {
width: 25%;
transition: width 1s linear;
}
#left {
width: 50%;
height: 100%;
background-color: lightblue;
display: inline-block;
position: relative;
transition: width 1s linear;
}
#innerleft {
position: absolute;
top: 100px;
width: calc(100% - 4px);
text-align: center;
border: 2px solid black;
}
#right {
width: 50%;
height: 100%;
background-color: lightgrey;
display: inline-block;
position: relative;
transition: width 1s linear;
}
#innerright {
position: absolute;
top: 100px;
width: calc(100% - 4px);
text-align: center;
border: 2px solid black;
}
#right:hover {
width: 75%;
transition: width 1s linear;
}
#left:hover {
width: 75%;
transition: width 1s linear;
}
<div id="wrapper">
<div id="left">
<div id="innerleft">
TITLE 1
</div>
</div><div id="right">
<div id="innerright">
TITLE 2
</div>
</div>
</div>
As seen, if hovering over the button, the background image behind the button shows itself "fully" (no rescaling), the logo (showed as B) moves down to 25% and the button not hovered scales down in size and font size and the image behind it slides under it where the user cannot see it properly (the user cannot see it by scrolling down).
If hovered on the other button the animation goes to the other button and image background.
There should be a delay of 2 seconds before the layout comes back to the starting position
DETAILS:
NO JAVASCRIPT ALLOWED, client doesn't allow usage
Should be responsive, so no hovering on touch devices
The image must not resize or loose proportion
Full screen layout
Mouse simulates user.
Animation should return to initial position after 3 seconds if mouse is not hovering
Initial position is 50%-50% (almost, due to the logo which is 150x150px)
End position should be 75%-25%.
Have been loosing my mind the last 2 days wondering how to do it as I am a beginner at CSS but didn't find a way yet.
Any help would be appreciated!
Available code of what has been done already to the design (total mess...):
#business-top {
height:50%
width:100%
}
#business-button {
height:3em;
width:12em;
background-color:#2B2A2A;
border: .2em solid #ff7600;
border-radius:1.8em;
margin:auto;
margin-top:3em;
}
#logo-separator {
text-align:center;
}
.separator {
display: block;
position: relative;
padding: 0;
height: 0;
width: 100%;
max-height: 0;
font-size: 1px;
line-height: 0;
clear: both;
border: none;
border-top: 1px solid #ff7600;
border-bottom: 1px solid #ff7600;
}
#logo {
margin:auto;
max-width:150px;
display:inline-block;
overflow:hidden
margin-top:-75px
}
#photography-bottom {
height:50%
width:100%
}
#photography-button {
height:3em;
width:12em;
background-color:#2B2A2A;
border: .2em solid #ff7600;
border-radius:1.8em;
margin:auto;
margin-top:3em;
}
h1 {
color:#ff7600;
text-align:center;
font-size:1.4em;
vertical-align:middle;
line-height:2.2em
}
<div id="business-top"
<a href="www.lluisballbe.smugmug.com">
<div id="business-button">
<h1>BUSINESS</h1>
</div>
</a>
</div>
<div id="logo-separator">
<div class="separator"></div>
<div id="logo"><img src="https://lluisballbe.smugmug.com/Assets-for-website/i-CsMnM3R/0/Th/800x800-round-Th.png"</div>
</div>
<div id="photography-bottom"
<a href="www.lluisballbe.smugmug.com">
<div id="photography-button">
<h1>PHOTOGRAPHY</h1>
</div>
</a>
</div>
If you increase area of buttons once hovered , then you may have some results in CSS only:
trick comes from pointer-events and pseudo to increase hoverable area
/* tricky part */
div {
width: 100%;
pointer-events: none;
overflow: hidden;
transition: 1.5s;
}
div:hover {/* will be catch by child with pointer-events auto */
flex: 3;
}
div:first-child {
background: turquoise;
}
div a {
pointer-events: auto;/* if a is hovered, so is its parent */
position: relative;/* this could be for the div parent if you want to cover its area */
padding: 5px;
border-radius: 0.25em;
border: 3px solid;
box-shadow: 2px 2px 5px;
color: #222;
background: #aaa;
}
div a:hover:before {/* increase size of button only once hovered */
content: '';
position: absolute;
top: -200px;/* coordonates used to increase pseudo size from its relative position parent. tune to your needs */
bottom: -200px;
width: 100%;
}
/* layout */
body,
div {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
div {
flex: 1;
}
hr {
width: 100%;
height: 5px;
background: red;
text-align: center;
}
hr:before {
content: url(http://dummyimage.com/50x50);
display: inline-block;
height: 50px;
border-radius: 50%;
overflow: hidden;
margin-top: -25px;
}
html,
body {
height: 100%;
width: 100%;
margin: 0;
}
<div>
button style
</div>
<hr/>
<div>
button style
</div>
From your update snippet :
html,
body {
height: 100%;
width: 100%;
margin: 0;
}
body {
display: flex;
flex-direction: column;
}
h1 {
margin: 0;
}
a {
display: inline-block;
}
#business-top {
display: flex;
flex: 1;
width: 100%;
align-items: center;
justify-content: center;
text-align: center;
}
#business-button {
height: 3em;
width: 12em;
background-color: #2B2A2A;
border: .2em solid #ff7600;
border-radius: 1.8em;
margin: auto;
}
#logo-separator {
text-align: center;
}
.separator {
display: block;
position: relative;
padding: 0;
height: 0;
width: 100%;
max-height: 0;
font-size: 1px;
line-height: 0;
flex: 0;
border-top: 1px solid #ff7600;
border-bottom: 1px solid #ff7600;
}
#logo {
margin: auto;
max-width: 150px;
display: inline-block;
overflow: hidden;
margin: -75px;
position: absolute;
}
#photography-bottom {
display: flex;
flex: 1;
width: 100%;
align-items: center;
justify-content: center;
}
#photography-button {
height: 3em;
width: 12em;
background-color: #2B2A2A;
border: .2em solid #ff7600;
border-radius: 1.8em;
margin: auto;
}
h1 {
color: #ff7600;
text-align: center;
font-size: 1.4em;
vertical-align: middle;
line-height: 2.2em
}
#business-top,
#photography-bottom {
pointer-events: none;
position: relative;
z-index: 1;
transition: 1s;
/* min-height: 200px; you ma want this to avoid logo and button to overlap */
}
#business-top a,
#photography-bottom a {
pointer-events: auto;
}
#business-top:hover,
#photography-bottom:hover {
flex: 3;
}
#business-top a:hover:before,
#photography-bottom a:hover:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
<div id="business-top">
<a href="www.lluisballbe.smugmug.com">
<div id="business-button">
<h1>BUSINESS</h1>
</div>
</a>
</div>
<div id="logo-separator">
<div class="separator"></div>
<div id="logo"><img src="https://lluisballbe.smugmug.com/Assets-for-website/i-CsMnM3R/0/Th/800x800-round-Th.png"> </div>
</div>
<div id="photography-bottom">
<a href="www.lluisballbe.smugmug.com">
<div id="photography-button">
<h1>PHOTOGRAPHY</h1>
</div>
</a>
</div>
http://codepen.io/anon/pen/qbvgga

CSS : Float a number value on the right top corner of an image

I'm trying to float a number on the right top of an image.
I want this number to have a background-color and overlay on top of a small portion of the image on the right top corner.
I have tried :
<li class=topoulimg><span id=bell><img src=img-img/bell.png alt=alerts></span><span class=bellnumbers>10</span></li>
css
.bellnumbers{
float:right;
font-size:12px;
background-color:red;
width:10px;
height:10px;
color:#fff;
}
but it is not working.
http://jsfiddle.net/yv5q4gvm/
Use position:absolute instead float:right for your badge (Adjust your needs).
CSS
.bell {
display: inline-block;
position: relative;
width:64px;
}
.bellnumbers {
position: absolute;
font-size:12px;
background-color:red;
width:14px;
height:14px;
color:#fff;
top: -4px;
right: -4px;
}
The float CSS property specifies that an element should be taken from
the normal flow and placed along the left or right side of its
container, where text and inline elements will wrap around it.
DEMO HERE
You can try this...
<span class="bell">
<img src=https://cdn4.iconfinder.com/data/icons/simplicio/64x64/message.png alt=alerts>
<span class="bellnumbers">10</span>
</span>
.bell {
display: inline-block;
position: relative;
background-color: #eee;
width: 48px;
height: 42px;
text-align: center;
padding-top: 6px;
}
.bell img {
width: 24px;
height: 24px;
padding-top: 10px;
}
.bellnumbers {
font-size:12px;
background-color:red;
width:16px;
line-height: 16px;
text-align: center;
color:#fff;
z-index: 2;
border-radius: 3px;
position: absolute;
left: 28px;
}
JSFiddle
Insert content from html attribute (data-count).
<button data-count="16"></button>
Insert content before every <button> element's content, and style the inserted content:
button:before {
content: attr(data-count);
}
See the live example below:
button {
position: relative;
width: 64px;
height: 64px;
margin: 10px;
background-image: url("https://cdn4.iconfinder.com/data/icons/simplicio/64x64/message.png");
background-color: white
}
button:before {
content: attr(data-count);
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
display: block;
border-radius: 20%;
background: #FF9727;
border: 1px solid #FFF;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
color: #FFF;
position: absolute;
top: -10px;
left: -10px;
}
button.bell-top-right:before {
left: auto;
right: -10px;
}
button.bell-bottom-right:before {
left: auto;
top: auto;
right: -10px;
bottom: -10px;
}
button.bell-bottom-left:before {
top: auto;
bottom: -10px;
}
<button data-count="16" class="bell-top-right"></button>
<button data-count="16" class="bell-bottom-right"></button>
<button data-count="16"></button>
<button data-count="16" class="bell-bottom-left"></button>
try this.. perhaps it will solve your purpose (try bootstrap badges that can be a help to)
<li>
<span class=bell>
<img src="https://cdn4.iconfinder.com/data/icons/simplicio/64x64/message.png">
<span class=bellnumbers>10</span>
</span>
</li>
<style>
.bellnumbers{
vertical-align: top;
font-size:17px;
letter-spacing: 3px;
background-color:#F06861;
width:27px;
height:22px;
color:#fff;
border-radius: 3px;
padding-top: 3px;
text-align: center;
position: absolute;
margin-left: -1%;
margin-top: -5px;
}
.bell{
width:64px;
margin-top: 5%;
}
</style>
As others have shown, absolute/relative positioning and 'inline-block' on the li are ideal for this. I've got the code trimmed down quite a bit, however. Demo here: https://jsfiddle.net/r09d314v/
<style type="text/css">
li {
display: inline-block;
list-style-type: none;
position: relative;
}
span {
position: absolute;
top: -8px;
right: -10px;
background: red;
color: white;
padding: 2px;
}
</style>
<li>
<img src="https://cdn4.iconfinder.com/data/icons/simplicio/64x64/message.png">
<span class="number">11</span>
</li>

Registration Process Bar CSS3 animation

What is a good way to implement this feature?
<div class="container">
<h2>Basic Progress Bar</h2>
<div class="progress">
<div class="progress-bar" role="progressbar" aria-valuenow="70" aria-valuemin="0" aria-valuemax="100" style="width:50%">
<span class="sr-only">70% Complete</span>
</div>
</div>
</div>
Should I add those numbers on the progress-bar as photos?
or I should draw the circle by CSS3? If so, could anyone provide an example?
Below is a quick live demo of how one could start creating this type of visual in CSS. This example is quick and dirty, so to adapt it for production I would recommend simplifying some of the CSS and possibly generating the HTML using JavaScript and maybe some CSS pseudoelements. Then I would look into animating the colors using CSS animations. This is just to give you an idea of how it could be done, and maybe spark some ideas.
Screenshot of the result:
Live Demo:
html, body {
background-color: #555048;
}
.segment {
position: relative;
display: inline-block;
margin-right: -10px;
}
.circle {
display: inline-block;
background-color: #A8A9AD;
width: 20px;
height: 20px;
line-height: 20px;
border-radius: 50%;
color: white;
overflow: hidden;
text-align: center;
font-size: 12px;
}
.line {
display: inline-block;
width: 80px;
height: 10px;
margin: 5px 0;
background-color: #A8A9AD;
position: relative;
left: -5px;
}
.label {
position: absolute;
left: 10px;
top: 35px;
transform: translate(-50%, 0);
font-size: 12px;
color: #A8A9AD;
}
.container {
margin: 50px;
}
.segment.active .circle, .segment.active .line {
background-color: #C0A05F;
}
.segment.active .label {
color: #C0A05F;
}
<div class="container">
<div class="segment active"><div class="circle">1</div><div class="label">PERSONAL</div><div class="line"></div></div>
<div class="segment active"><div class="circle">2</div><div class="label">PROFILE</div><div class="line"></div></div>
<div class="segment"><div class="circle">3</div><div class="label">EXPERIENCE</div><div class="line"></div></div>
<div class="segment"><div class="circle">4</div><div class="label">SETTING</div><div class="line"></div></div>
<div class="segment"><div class="circle">5</div><div class="label">CERTIFICATE</div><div class="line"></div></div>
<div class="segment"><div class="circle">6</div><div class="label">SUBMIT</div></div>
</div>
JSFiddle Version: https://jsfiddle.net/8hxqunLx/1/
Let's create something clean and beautiful!
The end result:
The HTML
This is a good place for an ordered list. All we need is this:
<ol>
<li class="complete">Personal</li>
<li class="complete">Profile</li>
<li>Experience</li>
<li>Setting</li>
<li>Certificate</li>
<li>Submit</li>
</ol>
When a step is complete, give it the complete class to change the steps background colour.
The CSS
The numbers
There is an in-depth write up of counter over on Smashing Magazine.
The numbers are created with a counter which looks like this stripped to the basics:
ol {
list-style: none;
counter-reset: counter;
}
ol li {
counter-increment: counter;
}
ol li::before {
content: counter(counter, decimal);
}
The counter-increment property provides the correct number which is placed inside with content in a ::before pseudo-element.
The numbers are then positioned above the text with position: absolute.
The progress bar
Read more about pseudo-elements over here on the MDN.
It looks like this and goes behind the numbers:
It is created with a ::before pseudo element with a background gradient. Change the two middle percentage values (at 40% in this example) as the form is completed:
ol::before {
content: '';
height: 8px;
background:
linear-gradient(to right, #BFA15F 0, #BFA15F 40%, #A8A9AD 40%, #A8A9AD 100%);
position: absolute;
left: 50px;
right: 50px;
top: 6px;
}
Style the numbers
The numbers are inserted with ol li::before, which can be styled further:
border-radius: 50% to create a circle
text-align: center and line-height: 20px to perfectly center in the circle
a background colour which is changed as the steps are completed.
Complete Example
Note: There is no whitespace between the closing </li> tag and the next opening <li>. This prevents a gap between the inline-block list items. Read more here.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: arial;
}
ol {
list-style: none;
counter-reset: counter;
position: relative;
width: 600px;
margin: 50px auto;
white-space: nowrap;
/*white-space: nowrap; means -- don't wrap the text*/
}
ol::before {
content: '';
position: absolute;
height: 8px;
background: linear-gradient(to right, #BFA15F 0, #BFA15F 40%, #A8A9AD 40%, #A8A9AD 100%);
left: 50px;
right: 50px;
top: 6px;
}
ol li {
counter-increment: counter;
display: inline-block;
position: relative;
text-transform: uppercase;
font-size: 0.7em;
padding-top: 30px;
width: 100px;
text-align: center;
}
ol li::before {
content: counter(counter, decimal);
position: absolute;
background: #A8A9AD;
top: 0;
left: 50%;
margin-left: -10px;
width: 20px;
height: 20px;
line-height: 20px;
/*Matches height value*/
text-align: center;
border-radius: 50%;
color: #FFF;
font-weight: bold;
}
ol li.complete::before {
background: #BFA15F;
}
<ol>
<li class="complete">Personal</li><li class="complete">Profile</li><li>Experience</li><li>Setting</li><li>Certificate</li><li>Submit</li>
</ol>
Animated example
If the progress bar should animate, you could create it with two pseudo elements, instead of the gradient, with the gold line sliding over the gray.
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: arial;
}
ol {
list-style: none;
counter-reset: counter;
position: relative;
width: 600px;
margin: 50px auto;
white-space: nowrap;
/*white-space: nowrap; means -- don't wrap the text*/
}
ol::before {
content: '';
position: absolute;
height: 8px;
background: #A8A9AD;
left: 50px;
right: 50px;
top: 6px;
}
ol::after {
content: '';
position: absolute;
height: 8px;
background: #BFA15F;
left: 50px;
top: 6px;
animation: stretch 2s linear infinite;
}
ol li {
counter-increment: counter;
display: inline-block;
position: relative;
text-transform: uppercase;
font-size: 0.7em;
padding-top: 30px;
width: 100px;
text-align: center;
}
ol li::before {
content: counter(counter, decimal);
position: absolute;
background: #A8A9AD;
top: 0;
left: 50%;
margin-left: -10px;
width: 20px;
height: 20px;
line-height: 20px;
/*Matches height value*/
text-align: center;
border-radius: 50%;
color: #FFF;
font-weight: bold;
z-index: 1;
}
ol li.complete::before {
background: #BFA15F;
}
#keyframes stretch {
0% {
width: 0;
}
100% {
width: calc(100% - 100px);
}
}
<ol>
<li class="complete">Personal</li><li class="complete">Profile</li><li>Experience</li><li>Setting</li><li>Certificate</li><li>Submit</li>
</ol>

Chrome 64bit - CSS animation causes positioning bug

Hallo I am trying to create a button aligned to the right of the screen which leads to the next article.
Everything works as I want it, till the point when I add the css transition.
As you can see in the fiddle I have twice the exact same code, except that the blue bar does have a css transition property and the green bar does not have a transition.
I am using the 64bit version of chrome (45.0.2453.0 dev-m) and while in here the green bar works as supposed when hovered, the content from the blue bar with the transition does have some major alignment bug. It seems that the content of the containers pops out of the containers.
<nav class="nav-next">
<a href="link" class="link">
<div class="thumbnail">
<img width="100" height="100" src="http://travelwithoutplan.com/wp-content/uploads/DSC01985_Vibrance-100-200x200.jpg" class="attachment-100x100 wp-post-image" alt="DSC01985 Vibrance 100" />
</div>
<div class="headline">Travel Information for Liechtenstein</div>
</a>
</nav>
CSS (without transition it works - but with transition it causes an alignment bug)
/*
.nav-next {
-moz-transition: width .5s;
-o-transition: width .5s;
-webkit-transition: width .5s;
transition: width .5s;
}
*/
.nav-next {
background-color: lightblue;
overflow: hidden;
position: fixed;
top: 50px;
left: auto;
right: 0;
box-sizing: border-box;
width: 30px;
height: 120px;
}
.nav-next:hover {
width: 330px;
}
.nav-next .headline:after, .nav-next .link {
display: block;
border-top: 1px solid #8c8c8c;
}
.nav-next .link {
background: #fff;
height: 120px;
width: 300px;
box-sizing: border-box;
padding: 10px;
position: absolute;
right: 0;
top: 0;
margin-left: 30px;
margin-right: 30px;
border: 1px solid #8c8c8c;
border-right: none;
}
.nav-next:hover .link {
margin-left: 0;
}
.nav-next .link:before {
color: #262626;
left: auto;
right: -23px;
position: absolute;
top: 52px;
font-size: 16px;
font-size: 1rem;
content: "\e12e";
font-family: wp-svg-plugin-icon-set1!important;
}
.nav-next .thumbnail {
position: relative;
width: 100px;
float: left;
margin-left: 0;
margin-right: 5px;
}
.nav-next .headline {
color: #595959;
height: 100px;
overflow: hidden;
padding-right: 10px;
padding-top: 5px;
position: relative;
left: 4px;
right: 0;
font-size: 14px;
}
.nav-next .headline:after {
content: "Next Article";
position: absolute;
width: 100%;
bottom: 0;
padding-top: 5px;
text-align: right;
}
http://jsfiddle.net/64g0vzq1/4/
Here you can see how with Chrome 64bit-version (45.0.2453.0 dev-m) the aligment of the content from the hovered blue bar (with css transition) is wrong. The text disappears behind the image, the image positionig is wrong etc.
Below the content of the green bar (without css transition) is shown correctly.
Is this a css error or something? How can I fix it?
Many thanks in advance!