I want a stacked bar with inner vertical text. I failed to put it in the right position. This is how I want it:
This is my code and output:
.colWrapper{
height:200px;
width:100px;
position:relative;
border:1px solid #ccc;
}
.barContainer{
position:absolute;
bottom:0;
width:100%;
}
.bar{
widith:100%;
padding:10px;
transform: rotate(90deg);
text-align:center;
margin:0
}
<div class="colWrapper">
<div class="barContainer">
<div class="bar" style="background-color:#b4cde2;">Software</div>
<div style="clear:both;"></div>
<div class="bar" style="background-color:#7ca7cc;">Banking</div>
</div>
</div>
You need to use -90deg and also, use the transform-origin:
.colWrapper {
height: 200px;
width: 100px;
position: relative;
border: 1px solid #ccc;
}
.barContainer {
bottom: 0;
width: 100%;
}
.bar {
padding: 10px;
transform: rotate(-90deg);
text-align: center;
margin: 0;
left: -25px;
transform-origin: right bottom;
position: absolute;
width: 100px;
bottom: 120px;
}
.bar:first-child {
left: -80px;
}
<div class="colWrapper">
<div class="barContainer">
<div class="bar" style="background-color:#b4cde2;">Software</div>
<div class="bar" style="background-color:#7ca7cc;">Banking</div>
</div>
</div>
Second Method:
.colWrapper {
height: 200px;
width: 100px;
position: relative;
border: 1px solid #ccc;
}
.barContainer {
bottom: -5px;
width: 100%;
transform: rotate(-90deg);
position: absolute;
left: 5px;
}
.bar {
padding: 10px;
text-align: center;
margin: 0 0 15px;
sposition: absolute;
}
.bar:first-child {
left: -80px;
}
<div class="colWrapper">
<div class="barContainer">
<div class="bar" style="background-color:#b4cde2;">Software</div>
<div class="bar" style="background-color:#7ca7cc;">Banking</div>
</div>
</div>
You can also take a look at writing-mode and flex-box.
https://developer.mozilla.org/fr/docs/Web/CSS/writing-mode
div {
display: inline-flex;
flex-flow: column wrap;
height: 320px;
width: 270px;
vertical-align: middle;
}
span {
padding: 20px 5px;
background: #1E84C6;
-webkit-writing-mode: vertical-lr;
/* old Win safari */
writing-mode: vertical-lr;
writing-mode: tb-lr;
text-align: right;
margin: 10px;
height: 100px;
width: 60px;
font-size: 30px;
line-height: 60px;
}
span:nth-child(3) {
height: 260px;
}
a {
display: inline-block;
text-decoration: none;
letter-spacing: 2px;
text-transform: uppercase;
font-family: helvetica;
color: white;
}
div + div a {
transform: scale(-1, -1);
/* reverse writing direction optionnal*/
btext-align: left;
transform-origin: 1em 1.25em;
}
span:nth-child(2) {
background: #283F4F;
}
span:nth-child(4) {
background: #1DC685;
}
-
<div>
<span> <a href>one</a></span>
<span> <a href>two</a></span>
<span> <a href>three</a></span>
<span> <a href>four</a></span>
<span> <a href>five</a></span>
</div>
or
<div>
<span> <a href>one</a></span>
<span> <a href>two</a></span>
<span> <a href>three</a></span>
<span> <a href>four</a></span>
<span> <a href>five</a></span>
</div>
and so on ...
Related
Element 2 is an image for the youtube logo. Element 1 is a button with a visual hover effect with three bars stacked on top of each other.
I want the button on the left and the image right next to it.
I need them in the upper left corner.
Here is a screenshot so far https://postimg.cc/Mn2B8wCR
Here is the code I have so far
.element1 {
display: inline-block;
width: 500px;
}
.element2 {
display: inline-block;
width: 500px;
}
.wrapper {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.hamburger {
width: 100px;
height: 100px;
position: relative;
cursor: pointer;
background: #636363;
border-radius: 5px;
}
.hamburger>div {
position: absolute;
height: 10px;
background: rgb(255, 255, 255);
border: 5px;
}
.first {
width: 55px;
top: 25px;
left: 20px;
}
.second {
width: 40px;
top: 45px;
left: 20px;
}
.third {
width: 50px;
top: 65px;
left: 20px;
}
.hamburger:hover div {
width: 60px;
transition: width 0.3s ease;
}
<div class="element1">
<div class="wrapper">
<div class="hamburger">
<div class="first"></div>
<div class="second"></div>
<div class="third"></div>
</div>
</div>
</div>
<div class="element2">
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e1/Logo_of_YouTube_%282015-2017%29.svg" alt="Youtube logo" class="logo">
</div>
You can wrap it in a container and use display: flex;.
.nav-container{
display: flex;
width: 100%;
}
.element1{
display: inline-block;
width: 120px;
}
.wrapper{
padding-left: 10px;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.hamburger{
width: 100px;
height: 100px;
position: relative;
cursor: pointer;
background: #636363;
border-radius: 5px;
}
.hamburger > div{
position: absolute;
height: 10px;
background: rgb(255, 255, 255);
border: 5px;
}
.first{
width: 55px;
top: 25px;
left: 20px;
}
.second{
width: 40px;
top: 45px;
left: 20px;
}
.third{
width: 50px;
top: 65px;
left: 20px;
}
.hamburger:hover div{
width: 60px;
transition: width 0.3s ease;
}
.element2{
display: inline-block;
width: 500px;
}
<div class="nav-container">
<div class="element1">
<div class="wrapper">
<div class="hamburger">
<div class="first"></div>
<div class="second"></div>
<div class="third"></div>
</div>
</div>
</div>
<div class="element2">
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e1/Logo_of_YouTube_%282015-2017%29.svg" alt="Youtube logo" class="logo">
</div>
</div>
In HTML, wrap all of element 1 and 2 with a 'container' div:
<div class="container">
<div class="element1">
<div class="wrapper">
<div class="hamburger">
<div class="first"></div>
<div class="second"></div>
<div class="third"></div>
</div>
</div>
</div>
<div class="element2">
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e1/Logo_of_YouTube_%282015-2017%29.svg" alt="Youtube logo" class="logo">
</div>
</div>
In CSS, make div container flex and into a row.
.container {
display: flex;
flex-direction: row;
}
Change your positions of your hamburger and wrapper class:
.wrapper{
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.hamburger{
width: 100px;
height: 100px;
cursor: pointer;
background: #636363;
border-radius: 5px;
}
Is this you want to do?
Edit:
Here I done below changes:
Removed all styles of the .wrapper which don't need there
Added vertical-align: middle for .element1 and .element2
Removed width from .element1 which don't need there
Added margin-left to .element2 for space
.element1{
display: inline-block;
vertical-align: middle
}
.element2{
margin-left: 30px;
display: inline-block;
vertical-align: middle
}
.hamburger{
width: 100px;
height: 100px;
position: relative;
cursor: pointer;
background: #636363;
border-radius: 5px;
}
.hamburger > div{
position: absolute;
height: 10px;
background: rgb(255, 255, 255);
border: 5px;
}
.first{
width: 55px;
top: 25px;
left: 20px;
}
.second{
width: 40px;
top: 45px;
left: 20px;
}
.third{
width: 50px;
top: 65px;
left: 20px;
}
.hamburger:hover div {
width: 60px;
transition: width 0.3s ease;
}
.logo {
width: 300px
}
<div class="element1">
<div class="wrapper">
<div class="hamburger">
<div class="first"></div>
<div class="second"></div>
<div class="third"></div>
</div>
</div>
</div>
<div class="element2">
<img src="https://upload.wikimedia.org/wikipedia/commons/e/e1/Logo_of_YouTube_%282015-2017%29.svg" alt="Youtube logo" class="logo">
</div>
you can use this
.container {
display:inline-block;
margin-right:auto }
/* the margin right auto is to force the elements to be on the left corner */ps it should be only the imge and the button inside this div(class='container')
I have searched all over stack overflow but I am unable to find any clue and I am struck here. I used flex container and child items in my code to some extent but I couldn't move beyond that. Thing is when we hover a child item, a new child item need to be created as shown in the expected result. Should we need to use pseudo element or any other flex properties to achieve this. Thanks much in advance.
My code:
https://jsfiddle.net/k2qr398u/1/
My result
https://imgur.com/kRHNHuu
Expected result:
https://imgur.com/2B6CkYF
/**CSS**/
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
background-color: #400017;
}
.img-css {
width: 50px;
height: 50px;
}
.main-heading {
display: block;
text-align: center;
color: #fc065d;
margin-bottom: 70px;
}
.img-js {
width: 50px;
height: 50px;
}
.container {
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
border: 3px solid #360310;
max-width: 610px;
height: 310px;
text-align: center;
margin: 0 auto;
flex-direction: row;
/* transform: translate(-50%,-50%); */
}
.col {
width: 130px;
height: 100px;
margin: 0 auto;
border: 3px solid #5e0a1f;
padding-top: 44px;
padding-left: 26px;
padding-right: 26px;
color: #fff;
background-color: #010001;
border-radius: 30px;
z-index: 20;
/* position: relative; */
}
.col p {
font-size: 16px;
font-weight: bold;
}
.col-2 p {
position: relative;
top: 55px;
text-align: center;
font-weight: bold;
}
<!--**HTML**-->
<body>
<div class="container">
<div class="col col-1">
<img src="images/css.svg" alt="CSS logo" class="img-css">
<br>
<p>I am</p>
</div>
<div class="col col-2">
<p class="my-name">Sri</p>
</div>
<div class="col col-3">
<img src="images/javascript.svg" alt="JS logo" class="img-js">
<p>Developer
</p>
</div>
</div>
</body>
P.S: Sorry if this question sounds very silly or dumb, I am a beginner trying to learn web dev skillsets.
I have created something similar to your expected result. Please run the code snippet for the result.
UPDATE: To include the hover off transition.
/**CSS**/
body {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: sans-serif;
background-color: #400017;
}
.img-css {
width: 50px;
height: 50px;
}
.main-heading {
display: block;
text-align: center;
color: #fc065d;
margin-bottom: 70px;
}
.img-js {
width: 50px;
height: 50px;
}
.container {
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
border: 3px solid #360310;
max-width: 610px;
height: 310px;
text-align: center;
margin: 0 auto;
flex-direction: row;
/* transform: translate(-50%,-50%); */
}
.col {
width: 130px;
height: 100px;
margin: 0 auto;
border: 3px solid #5e0a1f;
padding-top: 44px;
padding-left: 26px;
padding-right: 26px;
color: #fff;
background-color: #010001;
border-radius: 30px;
z-index: 20;
position: relative;
}
.col p {
font-size: 16px;
font-weight: bold;
}
/*
.col-2 p {
position: relative;
top: 55px;
text-align: center;
font-weight: bold;
}
*/
.col-1,
.col-2-1,
.col-2-2,
.col-3 {
position: absolute;
left: 0;
top: 0;
transition: 1s;
}
.wrapper {
position: relative;
}
.wrapper:hover .col-1 {
transition: 1s;
left: -200px;
}
.wrapper:hover .col-2-1 {
transition: 1s;
top: -170px;
}
.wrapper:hover .col-2-2 {
transition: 1s;
top: 170px;
}
.wrapper:hover .col-3 {
transition: 1s;
left: 200px;
}
<!--**HTML**-->
<body>
<div class="container">
<div class="wrapper">
<div class="col"> Underneath</div>
<div class="col col-1">
<img src="images/css.svg" alt="CSS logo" class="img-css">
<br>
<p>I am</p>
</div>
</div>
<div class="wrapper">
<div class="col"> Underneath</div>
<div class="col col-2-1">
<p class="my-name">Sri</p>
</div>
<div class="col col-2-2">
<p class="my-name">Pratham</p>
</div>
</div>
<div class="wrapper">
<div class="col"> Underneath</div>
<div class="col col-3">
<img src="images/javascript.svg" alt="JS logo" class="img-js">
<p>Developer
</p>
</div>
</div>
</div>
</body>
The idea is:
Overlay some content over main content.
On hover reveal it :)
.card {
width: 150px;
height: 80px;
border: 1px solid #999;
background: #ccc;
border-radius: 8px;
position: relative;
margin: 20% auto;
}
.card:hover > .o-top {
top: -80px;
background: #f00;
}
.card:hover > .o-bottom {
bottom: -80px;
}
.o-top {
top: 0;
transition: top 1.5s, background 2s;
}
.o-bottom {
bottom: 0;
transition: bottom 1.5s, background 2s;
}
.card-overlay {
position: absolute;
height: 100%;
width: 100%;
background: #333;
pointer-events: none;
color: #fff;
}
<div class="card">
<div class="card-overlay o-top">TOP OVERLAY</div>
<div class="card-overlay o-bottom">BOTTOM OVERLAY</div>
<H3>INTERNAL CONTENT</H3>
</div>
I have a screenshot as shown below which I have to replicate in HTML/CSS. In the following screenshot I wasn't able to make colored left and right arrows in between the squares.
At this moment, I am able to replicate this in fiddle without colored left and right arrows.
The snippets of CSS code which I have used in order to make series of small squares are:
.squares .square {
width: 200px;
text-align: center;
height: 200px;
background-color: white;
border-radius: 15px;
}
Problem Statement:
I am wondering what CSS codes I should add in the fiddle so that colored left and right arrows in between the squares shows up in the fiddle.
You can do that by HTML special characters like below:
.squares {
display: flex;
justify-content: space-between;
align-items:center;
padding: 1rem;
background-color: rgb(238, 238, 238);
flex-wrap: wrap;
}
.squares .square {
width: 200px;
text-align: center;
height: 200px;
background-color: white;
border-radius: 15px;
}
.squares .square p
{
text-align: center;
vertical-align: bottom;
}
.arrows {
text-align:center;
}
.arrows span {
display:block;
font-size:48px;
line-height:32px;
color:green;
font-weight:bold;
}
.arrows span:first-child {
color:#C90;
}
<div class="squares">
<div class="square"><p>Franchise Hub Hierarchy</p><img src="https://s7.postimg.cc/jvu89zp17/Layer_30.png" alt=""/></div>
<div class="arrows">
<span>→</span>
<span>←</span>
</div>
<div class="square"><p>System wide user permissions</p><img src="https://s7.postimg.cc/6ronxc7a3/Layer_33.png" alt=""/></div>
<div class="arrows">
<span>→</span>
<span>←</span>
</div>
<div class="square"><p>Custom Corporate Branding</p><img src="https://s7.postimg.cc/wn8egkbor/Layer_46.png" alt=""/></div>
<div class="arrows">
<span>→</span>
<span>←</span>
</div>
<div class="square"><p>Configurable Workflow</p><img src="https://s7.postimg.cc/k8lmg8rwb/Layer_47.png" alt=""/></div>
<div class="arrows">
<span>→</span>
<span>←</span>
</div>
<div class="square"><p>Orders, C.R.M. and P.O.S</p><img src="https://s7.postimg.cc/9yj7h0hgb/Shape_33.png" alt=""/></div>
</div>
You can try font awesome arrows
https://fontawesome.com/icons/arrow-left?style=solid
or make arrows using CSS borders
#arrow {
width: 0;
height: 0;
border-top: 20px solid transparent;
border-left: 40px solid red;
border-bottom: 20px solid transparent;
margin-left: 20px;
}
#arrow:before {
content: "";
position: absolute;
width: 30px ;
height: 10px;
background: red;
left: 0;
top: 22px;
}
<div id="arrow"></div>
and if you want your text towards the bottom of your box, You should write <p> after <img>.
<div class="square">
<img src="https://s7.postimg.cc/jvu89zp17/Layer_30.png" alt=""/>
<p>Franchise Hub Hierarchy</p>
</div>
Here is the cure CSS and simplest solution for your problem.
I have done this for you, just add a div between every square div
<div class="arrowWrapper">
<span class="arrow redArrow"></span><br>
<span class="arrow greenArrow"></span>
</div>
and this css to your code:
.arrow {
display:block;
height: 2px;
margin: 3px 0;
width: 35px;
position: relative;
}
.arrow.redArrow {background-color: red;}
.arrow.greenArrow {background-color: green;}
.arrowWrapper { margin-right: -20px; margin-left: -20px;}
.arrow.redArrow:after{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: red;
right: -1px;
transform: rotate(45deg);
top: -4px;
}
.arrow.redArrow:before{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: red;
right: -1px;
transform: rotate(135deg);
top: 4px;
}
.arrow.greenArrow:after{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: green;
left: -1px;
transform: rotate(135deg);
top: -4px;
}
.arrow.greenArrow:before{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: green;
left: -1px;
transform: rotate(45deg);
top: 4px;
}
Complete code is in below snippetenjoy
.squares {
display: flex;
justify-content: space-between;
align-items:center;
padding: 1rem;
background-color: rgb(238, 238, 238);
flex-wrap: wrap;
}
.squares .square {
width: 200px;
text-align: center;
height: 200px;
background-color: white;
border-radius: 15px;
}
.squares .square p
{
text-align: center;
vertical-align: bottom;
}
.arrow {
display:block;
height: 2px;
margin: 3px 0;
width: 35px;
position: relative;
}
.arrow.redArrow {background-color: red;}
.arrow.greenArrow {background-color: green;}
.arrowWrapper { margin-right: -20px; margin-left: -20px;}
.arrow.redArrow:after{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: red;
right: -1px;
transform: rotate(45deg);
top: -4px;
}
.arrow.redArrow:before{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: red;
right: -1px;
transform: rotate(135deg);
top: 4px;
}
.arrow.greenArrow:after{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: green;
left: -1px;
transform: rotate(135deg);
top: -4px;
}
.arrow.greenArrow:before{
position: absolute;
content: "";
height: 2px;
width: 12px;
background: green;
left: -1px;
transform: rotate(45deg);
top: 4px;
}
<div class="squares">
<div class="square"><p>Franchise Hub Hierarchy</p><img src="https://s7.postimg.cc/jvu89zp17/Layer_30.png" alt=""/></div>
<div class="arrowWrapper">
<span class="arrow redArrow"></span><br>
<span class="arrow greenArrow"></span></div>
<div class="square"><p>System wide user permissions</p><img src="https://s7.postimg.cc/6ronxc7a3/Layer_33.png" alt=""/></div>
<div class="square"><p>Custom Corporate Branding</p><img src="https://s7.postimg.cc/wn8egkbor/Layer_46.png" alt=""/></div>
<div class="square"><p>Configurable Workflow</p><img src="https://s7.postimg.cc/k8lmg8rwb/Layer_47.png" alt=""/></div>
<div class="square"><p>Orders, C.R.M. and P.O.S</p><img src="https://s7.postimg.cc/9yj7h0hgb/Shape_33.png" alt=""/></div>
</div>
I have icons that I want centered both horizontally and vertically.
See codepen and snippet below:
div {
border: 1px solid black;
}
.icon-placeholder {
height: 34px;
overflow: hidden;
width: 34px;
}
.icon {
color: hotpink;
font-size: 400%;
}
.icon::before {
content: '+';
}
<div class="icon-placeholder">
<span class="icon"></span>
</div>
How can I do that regardless of .icon's font size.
I have tried transform, position: absolute, display: table with no luck. I can't use flex.
You can achieve it using transform and absolute positioning
div {
border: 1px solid black;
margin: 10px;
}
.icon-placeholder {
height: 34px;
overflow: hidden;
width: 34px;
position: relative;
}
.icon {
color: hotpink;
font-size: 400%;
margin-top: -10%;
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
left: 50%;
}
.icon::before {
content: '+';
}
.plus-symbol{
font-size: 400%;
outline: dotted 1px red;
color: hotpink;
}
.left, .right{
width: 45%;
padding: 20px;
box-sizing: border-box;
}
.left{
float: left;
}
.right{
float: right;
}
.custom-plus-icon, .custom-plus-icon:before{
position: absolute;
width: 10%;
border-radius: 1px;
background-color: hotpink;
height: 80%;
margin: auto;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
.custom-plus-icon:before{
content: '';
width: 100%;
height: 100%;
transform: rotate(90deg);
}
<div class="left">
<h3>Plus symbol using font</h3>
<span class="plus-symbol">+</span>
<br/>
<br/>
<label>Font-size : 400%</label>
<div class="icon-placeholder">
<span class="icon"></span>
</div>
<label>Font-size : 300%</label>
<div class="icon-placeholder">
<span class="icon" style="font-size: 300%;"></span>
</div>
<label>Font-size : 200%</label>
<div class="icon-placeholder">
<span class="icon" style="font-size: 200%;"></span>
</div>
<label>Font-size : 100%</label>
<div class="icon-placeholder">
<span class="icon" style="font-size: 100%;"></span>
</div>
</div>
<div class="left">
<h3>Plus symbol using pseudo element</h3>
<div class="icon-placeholder">
<span class="custom-plus-icon"></span>
</div>
</div>
On thing to note though, a + isn't necessarily centered in the first place depending on the font.
div {
border: 1px solid black;
}
.icon-placeholder {
height: 34px;
overflow: hidden;
position: relative;
width: 34px;
}
.icon {
color: hotpink;
font-size: 400%;
}
.icon::before {
content: '0';
display: inline-block;
position: absolute;
right: 50%;
bottom: 50%;
transform: translate(50%, 50%);
}
<div class="icon-placeholder">
<span class="icon"></span>
</div>
The following is my markup:
.play-controls {
.fa-play, .fa-pause {
font-size: 25px;
}
}
.volume-controls {
display: inline-block;
position: relative;
.overlay {
background-color: $highlight;
height: 10px;
border-radius: 5px;
width: 0px;
position: absolute;
z-index: 15;
}
.background {
background-color: $text-color;
width: 100px;
height: 10px;
border-radius: 5px;
position: absolute;
z-index: 10;
}
.circle {
border-radius: 100%;
position:absolute;
background-color: #fff;
border: 1px solid;
height: 15px;
width: 15px;
z-index: 20;
top: -3px;
}
}
.player {
#album-artwork {
width: 80px;
height: 80px;
vertical-align: middle;
display:inline-block;
margin-right: 10px;
}
.wrapper {
display:inline-block;
.information {
margin-bottom: 5px;
#song-title {
font-size: 22px;
font-weight:bold;
margin-right: 5px;
}
#artist-album {
font-size: 18px;
}
}
.progress-bar {
position: relative;
.overlay {
background-color: $highlight;
height: 10px;
border-radius: 5px;
width: 0px;
position: absolute;
z-index: 15;
}
.background {
background-color: $text-color;
width: 600px;
height: 10px;
border-radius: 5px;
position: absolute;
z-index: 10;
}
.circle {
border-radius: 100%;
position:absolute;
background-color: #fff;
border: 1px solid;
height: 15px;
width: 15px;
z-index: 20;
top: -3px;
}
}
}
}
<div class="play-controls">
<i class="fa fa-play" id="playpause"></i>
</div>
<div class="volume-controls">
<div class="background"></div>
<div class="circle"></div>
<div class="overlay"></div>
</div>
<div class="player">
<img id="album-artwork" src="build/images/guero.jpg">
<div class="wrapper">
<div class="information">
<span id="song-title">Go It Alone</span>
<span id="artist-album">Beck - Guero</span>
</div>
<div class="progress-bar">
<div class="background"></div>
<div class="circle"></div>
<div class="overlay"></div>
</div>
</div>
</div>
The divs with classes background, circle, and overlay in volume-controls are all position: absolute; with volume-controls as position: relative;.
Upon making play-controls, volume-controls, and player inline, play-controls is inline with volume-controls, but volume-controls is overlapping the player.
How would I be able to set everything in one line, without any overlapping?
EDIT: JSFiddle
You could float:left; the 3 main parts or display:inline-block; them the issue the player is over the volume-controls is because of the absolute positioned elements in the volume-controls. You could add a width to volume-controls.
.volume-controls {
display: inline-block;
position: relative;
width:150px;
}
Here is the fiddle