split div into 2 columns doesn't work - html

Can you please help me, it took me so much time trying to fixe this problem.
i have 2 slider and i need to split each slide into 2 colums. The problem is that the second column which is float: right doesn't show in both sliders .
Here is a code pen that shows the problem codepen
thank you
Here is my structure:
.Dash_map_wrapSlider {
position: absolute;
overflow: hidden;
height: 100%;
width: calc(100% - 3rem);
bottom: calc(-80% + 10rem);
left: 3rem;
background: #fff;
border: 1px solid;
transition: 0.5s;
z-index: 1;}
.Dash_map_wrapSlider:hover{
bottom: 0rem;
transition: 0.5s;}
.Dash_map_wrapSlider:hover{
bottom: 0rem;
transition: 0.5s;}
.Dash_map_wrapSliderchoise {
background: #3E474F;
box-shadow: 0 .5em 1em #111;
position: absolute;
left: 0;
bottom: 0;
z-index: 900;
width: 100%;
height: 2rem;
line-height: 2rem;
text-align: center;
vertical-align: middle;}
.Dash_map_sumSlide {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 100%;
z-index: 10;
background-color: #fff;
transition: left 0s .75s;}
.clsDashMap_sumSlideInput {
display: none;
height: 11rem;}
.clsDashMap_sumSlideTitle {
position : absolute;
top:0;
width: 100%;
height: 2rem;
left: inherit;
color: #fff;
background-color: #73b9ff;
text-align: center;
font-weight: bold;
font-size: 1.20rem;}
.clsDashMap_sumSlideContentBoxTitle {
font-weight: bold;
color: #666;}
.clsDashMap_sumSlideSiteContentSummary {
position : absolute;
top: 2rem;
width: 100%;
height: 16rem;
color: #000000;
background-color: aliceblue;
text-align: center;}
.clsDashMap_sumSlideContent {
position: absolute;
top: 20rem;
margin: auto;
width: 100%;
color: #000000;}
[id^="Dash"]:checked + .Dash_map_sumSlide {
left: 0;
z-index: 100;
transition: left .65s ease-out;}
.Dash_map_wrapSliderchoise label {
color: #fff;
cursor: pointer;
display: inline-block;
line-height: 2rem;
font-size: 0.75rem;
font-weight: bold;
padding: 0 1em;}
.clsDashMap_sumSlideContentBox {
margin: auto;
float: left;
padding: 10px;
text-align: center;}
<div class="Dash_map_wrapSlider">
<div style="border: 1px solid red;width: 100%;">
<input id="Dash_map_sumSlideSite" class="clsDashMap_sumSlideInput" type="radio" name="slides" checked>
<div class="Dash_map_sumSlide slide_Site " style="float: left;width: 50%;border: 2px solid yellow;">
<div class="clsDashMap_sumSlideTitle">SITE</div>
<div class="clsDashMap_sumSlideSiteContentSummary">
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Etat</div>
<div class="green led">OK</div>
<div class="red led">KO</div>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">AlarmesSite</div>
<canvas id="pieChartAlm" ></canvas>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">TicketsSite</div>
<canvas id="pieChartTkt" ></canvas>
</div>
</div>
<div class="clsDashMap_sumSlideContent">put here content</div>
</div>
<div class="Dash_map_sumSlide slide_Alarme" style="float: right;width: 50%; border: 2px solid green;">
<div class="clsDashMap_sumSlideTitle" >ALARME</div>
<div class="clsDashMap_sumSlideSiteContentSummary">
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Etat</div>
<div class="green led">OK</div>
<div class="red led">KO</div>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">ALARME1Alm</div>
<canvas id="pieChartAlm" ></canvas>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Tickets1Alm</div>
<canvas id="pieChartTkt" ></canvas>
</div>
</div>
<div class="clsDashMap_sumSlideContent">put here content</div>
</div>
</div>
<div style="border: 1px solid red;">
<input id="Dash_map_sumSlideAlarme" class="clsDashMap_sumSlideInput" type="radio" name="slides" checked>
<div class="Dash_map_sumSlide slide_Site " style="width: 50%;border: 2px solid black;">
<div class="clsDashMap_sumSlideTitle">TECHNICIEN</div>
<div class="clsDashMap_sumSlideSiteContentSummary">
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Etat</div>
<div class="green led">OK</div>
<div class="red led">KO</div>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Alarmes2Tech</div>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Tickets2Tech</div>
</div>
</div>
<div class="clsDashMap_sumSlideContent">put here content</div>
</div>
<div class="Dash_map_sumSlide slide_Alarme" style="width: 50%; float: right;border: 2px solid darkturquoise;">
<div class="clsDashMap_sumSlideTitle" style="position: initial;">ACTION</div>
<div class="clsDashMap_sumSlideSiteContentSummary">
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Etat</div>
<div class="green led">OK</div>
<div class="red led">KO</div>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">alarme3Act</div>
</div>
<div class="clsDashMap_sumSlideContentBox">
<div class="clsDashMap_sumSlideContentBoxTitle">Tickets3Act</div>
</div>
</div>
<div class="clsDashMap_sumSlideContent">put here content</div>
</div>
</div>

Instead of float: right; give left: 50%; to the second column

Have you tried out Bootstrap Grid? I think it is just what you need.

Related

Add labels to a horizontal bar chart

I am new to HTML. In the following chart, how can I add some labels such as
Team 1up
Team blue
Team tigers
Team watermelon
Team crazyred
Team Melt
At the left side of the chart tracks all right aligned?
$(function() {
$('.progress-fill span').each(function(){
var percent = $(this).html();
$(this).parent().css('width', percent);
});
});
body {
background: #999;
}
.container {
width: 500px;
margin: 20px;
background: #fff;
padding: 20px;
overflow: hidden;
float: left;
}
.horizontal .progress-bar {
float: left;
height: 18px;
width: 100%;
padding: 3px 0;
}
.horizontal .progress-track {
position: relative;
width: 100%;
height: 20px;
background: #ebebeb;
}
.horizontal .progress-fill {
position: relative;
background: #666;
height: 20px;
width: 50%;
color: #fff;
text-align: center;
font-family: "Lato","Verdana",sans-serif;
font-size: 12px;
line-height: 20px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container horizontal flat">
<h2>Team performances</h2>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>100%</span>
</div>
</div>
</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>75%</span>
</div>
</div>
</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>60%</span>
</div>
</div>
</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>20%</span>
</div>
</div>
</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>34%</span>
</div>
</div>
</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>82%</span>
</div>
</div>
</div>
</div>
You can create a component called progress-group and put progress-label and progress-bar in it. progress-group takes care of responsibility for children alignment. I used flex which makes sense in this case. This gives you much more control if you want to add extra components in future.
https://codepen.io/anon/pen/oPVyYm
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="container horizontal flat">
<h2>Team performances</h2>
<div class="progress-group">
<div class="progress-label">Team 1up</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>100%</span>
</div>
</div>
</div>
</div>
<div class="progress-group">
<div class="progress-label">Team blue</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>75%</span>
</div>
</div>
</div>
</div>
<div class="progress-group">
<div class="progress-label">Team tigers</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>60%</span>
</div>
</div>
</div>
</div>
<div class="progress-group">
<div class="progress-label">Team watermelon</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>20%</span>
</div>
</div>
</div>
</div>
<div class="progress-group">
<div class="progress-label">Team crazyred</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>34%</span>
</div>
</div>
</div>
</div>
<div class="progress-group">
<div class="progress-label">Team Melt</div>
<div class="progress-bar horizontal">
<div class="progress-track">
<div class="progress-fill">
<span>82%</span>
</div>
</div>
</div>
</div>
</div>
body {
background: #999;
}
.container {
width: 500px;
margin: 20px;
background: #fff;
padding: 20px;
overflow: hidden;
float: left;
}
.horizontal .progress-bar {
float: left;
height: 18px;
width: 100%;
padding: 3px 0;
}
.horizontal .progress-track {
position: relative;
width: 100%;
height: 20px;
background: #ebebeb;
}
.horizontal .progress-fill {
position: relative;
background: #666;
height: 20px;
width: 50%;
color: #fff;
text-align: center;
font-family: "Lato","Verdana",sans-serif;
font-size: 12px;
line-height: 20px;
}
.progress-group {
display: flex;
}
.progress-label {
width: 170px;
text-align: right;
padding-right: 10px;
}
.progress-label::after {
content: ":";
}
$(function() {
$('.progress-fill span').each(function(){
var percent = $(this).html();
$(this).parent().css('width', percent);
});
});
Something like this sir?
https://codepen.io/JABedford/pen/RYdMjV
I have simply floated the bars over to the right and decreased the width to 80% and created another span for the relevant text.
<div class="progress-bar horizontal">
<span class="name">Team Name</span>
<div class="progress-track">
<div class="progress-fill">
<span>75%</span>
</div>
</div>
body {
background: #999;
}
.container {
width: 500px;
margin: 20px;
background: #fff;
padding: 20px;
overflow: hidden;
float: left;
}
.horizontal .progress-bar {
float: right;
height: 18px;
width: 100%;
padding: 3px 0;
}
.horizontal .progress-track {
position: relative;
float: left;
width: 80%;
height: 20px;
background: #ebebeb;
}
.horizontal .progress-fill {
position: relative;
background: #666;
height: 20px;
width: 50%;
color: #fff;
text-align: center;
font-family: "Lato","Verdana",sans-serif;
font-size: 12px;
line-height: 20px;
}

CSS nth-child(odd) not working

I need to alternate the background color of the class jl-member-info but this doesn’t work. I have this code:
.uk-grid .jl-member-item .jl-member-info:nth-child(odd) {
position: relative;
padding: 0 0.9rem;
background-color: rgba(0, 198, 197, 0.89);
width: 100%;
margin-top: -95px;
}
.uk-grid .jl-member-item .jl-member-info:nth-child(even) {
position: relative;
padding: 0 0.9rem;
background-color: #090963;
width: 100%;
margin-top: -95px;
}
<div class="jl-member ">
<div class=" uk-grid-large uk-grid uk-grid-width-small-1-2 uk-grid-width-medium-1-2 uk-grid-width-large-1-4" data-uk-grid-margin="">
<div class="jl-member-item default uk-row-first">
<div class="jl-member-item-img">
<img class="uk-overlay-spin" src="/templates/g5_helium/custom/images/Alain.jpg?595f26c4">
</div>
<div class="jl-member-info">
<div class="jl-member-name">Alain</div>
<div class="jl-member-role">Maire</div>
<div class="jl-member-desc"><span class="cloaked_email">mail#test.fr</span>
</div>
</div>
</div>
<div class="jl-member-item default">
<div class="jl-member-item-img">
<img class="uk-overlay-spin" src="/templates/g5_helium/custom/images/Alain.jpg?595f26c4">
</div>
<div class="jl-member-info">
<div class="jl-member-name">Alain</div>
<div class="jl-member-role">Maire</div>
<div class="jl-member-desc"><span class="cloaked_email">mail#test.fr</span>
</div>
</div>
</div>
<div class="jl-member-item default">
<div class="jl-member-item-img">
<img class="uk-overlay-spin" src="/templates/g5_helium/custom/images/Alain.jpg?595f26c4">
</div>
<div class="jl-member-info">
<div class="jl-member-name">Alain</div>
<div class="jl-member-role">Maire</div>
<div class="jl-member-desc"><span class="cloaked_email">mail#test.fr</span>
</div>
</div>
</div>
</div>
</div>
You need to recode like this, because you have only one .jl-member-info in .jl-member-item it will always be odd!
.uk-grid .jl-member-item .jl-member-info {
position: relative;
padding: 0 0.9rem;
width: 100%;
margin-top: -95px;
background-color: #090963;
}
.uk-grid .jl-member-item:nth-child(odd) .jl-member-info {
background-color: rgba(0, 198, 197, 0.89);
}

Center Font Awesome icons in circles

I have list items with text and they have a plus icon in a circle after them done with the pseudo-element :before. How could I center all the plus icons?
.advantages .item-list-section .item {
position: relative;
margin-bottom: 15px;
}
.advantages .item-list-section .item .inner {
position: relative;
display: inline-block;
}
.advantages .item-list-section .item .inner:after {
position: absolute;
font-family: 'FontAwesome';
content: "\f067";
color: #ef6611;
width: 14px;
height: 14px;
border: 1px solid;
border-radius: 30px;
top: 5px;
right: -30px;
font-size: 8px;
line-height: 14px;
text-align: center;
display:block;
}
.advantages .item-list-section .item .inner.bottom-icon:after {
top: 100%;
margin-top: -18px;
}
.advantages .item-list-section .item.active .inner:after {
background: #f13a01;
color: #ffffff;
content: "\f068";
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"/>
<section class="advantages primary">
<div class="container">
<div class="row">
<div class="col-sm-3 col-sm-offset-1 item-list-section">
<div class="item-list">
<div class="item">
<div class="inner">
<p>Продолжительный<br/>
срок службы</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Компактные<br/>
размеры</p>
</div>
</div>
<div class="item active">
<div class="inner">
<p>Насос с сухим ротором</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Котел способен стабильно<br/>работать даже при самом<br/>низком давлении</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Встроенная защита от<br/>
перепадов напряжения</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Надежная система<br/>
безопасности</p>
</div>
</div>
<div class="item">
<div class="inner">
<p>Наличие аварийных<br/>
режимов работы</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
Update Css
.advantages .item-list-section .item .inner:after {
position: absolute;
font-family: 'FontAwesome';
content: "\f067";
color: #ef6611;
width: 14px;
height: 14px;
border: 1px solid;
border-radius: 30px;
top: 5px;
right: -30px;
font-size: 8px;
line-height: 16px;
text-align: center;
display:block;
}
Live Demo Here

Footer not on bottom of page

I'm trying to create a footer class however it seems to be at the bottom of my .body-wrap class as opposed to the actual page.
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
border: 1px black solid;
position: relative;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
}
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
I'm also using a bootstrap sidebar template. Found here: http://startbootstrap.com/template-overviews/simple-sidebar/
Help would be appreciated.
Please try to add this code:
.footer-wrap {
border: 1px black solid;
position: fixed;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
width: 100%;
bottom: 0;
left: 0;
}
Use position:fixed with bottom:0 it will remain stable at bottom of page
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
border: 1px black solid;
position: fixed;
bottom:0;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
}
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
You would need position: fixed and bottom: 0 on your footer-wrap. Check the update below!
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
border: 1px black solid;
position: fixed;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
bottom: 0;
left: 0;
width: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
.body-wrap {
height: 100%;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
}
.footer-wrap {
width:100%;
border: 1px black solid;
position: absolute;
bottom:0px;
z-index: 10;
height: 3em;
margin-top: -3em;
text-align: center;
}
<div id="page-content-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="header-wrap">
<a href="#menu-toggle" class="menu-toggle">
<img class="hamburger-toggle" src="./img/menu.svg">
</a>
<img class="logo" src="./img/Spark.svg">
<img class="text-logo" src="./img/Spark-grey-text.svg">
</div>
<div class="body-wrap">
<h1>Hi Dave.</h1>
<h2>Got an idea? Share it on Spark.</h2>
</div>
<div class="footer-wrap">
<p>footer text.</p>
</div>
</div>
</div>
</div>
</div>
Add width and height to your .body-wrap and width to footer too. Changes footer position as in below codes.
.body-wrap {
width:200px;
height: 200px;
padding-top: 3%;
padding-left: 20%;
padding-right: 20%;
background:#111;
color:#fff;
}
.footer-wrap {
border: 1px black solid;
z-index: 9;
height: 3em;
text-align: center;
background:#f22;
bottom:0;
position:absolute;
width:100%;
}

Styling Divs - Drop Shadow through the middle of other div

I'm trying to create CSS styles that LOOK like a flip counter but don't actually function as one. I've got the general look and feel figured out, but I can't seem to get my box-shadow to overlap the display number.
This is what I have so far:
.numberwrapper {
width: 50px;
height: 90px;
background-color: black;
border-radius: 5px;
position: relative;
display: inline-block;
}
.shadow {
width: 100%;
height: 50%;
z-index: 100;
box-shadow: 0px 5px 4px -2px #888888;
}
.number {
font-family: 'Tahoma', sans-serif;
top: -90;
color: #ffffff;
font-size: 85px;
line-height: 0px;
text-align: center;
}
.bigcomma {
font-family: 'Tahoma', sans-serif;
font-size: 85px;
color: black;
}
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
1
</div>
</div>
<span class="bigcomma">,</span>
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
2
</div>
</div>
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
3
</div>
</div>
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
4
</div>
</div>
Like I said, my biggest issue is that I can't get my .shadow div to show up on top of the number.
Add "position: relative" to .shadow for the z-index to kick in:
.numberwrapper {
width: 50px;
height: 90px;
background-color: black;
border-radius: 5px;
position: relative;
display: inline-block;
}
.shadow {
width: 100%;
height: 50%;
z-index: 100;
box-shadow: 0px 5px 4px -2px #888888;
position: relative;
}
.number {
font-family: 'Tahoma', sans-serif;
top: -90;
color: #ffffff;
font-size: 85px;
line-height: 0px;
text-align: center;
}
.bigcomma {
font-family: 'Tahoma', sans-serif;
font-size: 85px;
color: black;
}
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
1
</div>
</div>
<span class="bigcomma">,</span>
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
2
</div>
</div>
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
3
</div>
</div>
<div class="numberwrapper">
<div class="shadow">
</div>
<div class="number">
4
</div>
</div>