I am trying to assemble specific div layout, but I am running into two issues:
At the bottom of header blocks, there is a slight spacing, I can't seem to get rid of that
Metric values on the header blocks do not have the bottom border extended to full width. I've tried to setting to 100% or auto but it just keeps messing the layout to double rows and missmatches itself.
div.detail-block .detail-value{
width: 100%;
}
This makes it into two colums instead of below each other.
div.detail-block .detail-value{
width: auto;
}
Could you please help me figure out where the issue is?
I think I am using wrongly the display attributes in combinations with others, maybe I should try different approach?
div.detail-block {
position: relative;
border-left: 30px solid #9e9e9e;
display: inline-block;
}
div.detail-block h3 {
font-family: Calibri, system-ui;
font-size: 1.4rem;
color: #f4f5f7;
text-transform: uppercase;
margin-left: -35px;
position: absolute;
bottom: -45px;
left: 5px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-ms-transform-origin: 0 0;
-o-transform-origin: 0 0;
transform-origin: 0 0;
}
div.detail-container {
width: 100%;
}
div.detail-row:hover {
background: #ffffff;
}
div.detail-row {
border-bottom: 1px solid #dddddd;
line-height: 0.9;
}
div.detail-row .detail-key {
width: 230px;
background: #dfe1e5;
border: 1px solid #ffffff;
font-family: Calibri, system-ui;
font-size: 16px;
font-weight: 900;
display: table-cell;
padding: 3px 10px;
text-align: right;
justify-content: left;
}
div.detail-block .detail-key{
width: 200px;
}
div.detail-row .detail-value {
font-family: Consolas, system-ui;
text-align: left;
display: table-cell;
padding: 3px 10px;
}
div.detail-block .detail-value{
width: 500px;
}
.detail-container{
display: table;
width: 600px;
}
<div class="detail-container">
<div class="detail-table">
<div class="detail-row">
<div class="detail-key">Name</div>
<div class="detail-value">Value</div>
</div>
<div class="detail-row">
<div class="detail-key">Description</div>
<div class="detail-value">Value</div>
</div>
<div class="detail-block">
<h3>HEADER</h3>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
</div>
<div class="detail-block">
<h3>HEADER</h3>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Value</div>
</div>
</div>
</div>
My attempt so far is : https://jsfiddle.net/gbr23tnj/
1- line-height: 0;
2- rather than setting the .detaul-value class we can set its parent to width:100%; it will fix the issue.
div.detail-block{
width: 100%;
}
div.detail-block {
position: relative;
border-left: 30px solid #9e9e9e;
display: inline-block;
width: 100%;
}
div.detail-block h3 {
font-family: Calibri, system-ui;
font-size: 1.4rem;
color: #f4f5f7;
text-transform: uppercase;
margin-left: -35px;
position: absolute;
bottom: 5px;
left: 20px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
-webkit-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-ms-transform-origin: 0 0;
-o-transform-origin: 0 0;
transform-origin: 0 0;
}
div.detail-container {
width: 100%;
}
div.detail-row:hover {
background: #ffffff;
}
div.detail-row {
border-bottom: 1px solid #dddddd;
line-height: 0.9;
}
div.detail-row .detail-key {
width: 230px;
background: #dfe1e5;
border: 1px solid #ffffff;
font-family: Calibri, system-ui;
font-size: 16px;
font-weight: 900;
display: table-cell;
padding: 3px 10px;
text-align: right;
justify-content: left;
}
div.detail-block .detail-key{
width: 200px;
}
div.detail-row .detail-value {
font-family: Consolas, system-ui;
text-align: left;
display: table-cell;
padding: 3px 10px;
}
div.detail-block .detail-value{
/* width: 500px;
No need to use it i will set the conatiner of this element to width:100%
*/
}
.detail-container{
display: table;
width: 600px;
line-height: 0;
/*line-height works with tables to remove the space between two cells
}
<div class="detail-container">
<div class="detail-table">
<div class="detail-row">
<div class="detail-key">Name</div>
<div class="detail-value">Value</div>
</div>
<div class="detail-row">
<div class="detail-key">Description</div>
<div class="detail-value">Value</div>
</div>
<div class="detail-block">
<h3>HEADER</h3>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
</div>
<div class="detail-block">
<h3>HEADER</h3>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Values</div>
</div>
</div>
<div class="detail-row">
<div class="detail-key">Metric</div>
<div class="detail-value">Value</div>
</div>
</div>
</div>
</div>
Related
I developed a bootstrap card, inside that bootstrap card I am putting another one.
My problem is that when I reduce the screen size the text comes out of the card and also overlays the image, how can I solve this?
Demo
code
<div class="card-deck cardsZone">
<div class="card myCards">
<div class="card-body">
<div *ngFor="let pr of ProgressDashTasks">
<div class="card mysmallCcards">
<div class="card-body">
<div class="row">
<div class="col-sm-2">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgDash">
</div>
<div class="col-sm-8">
<span class="brandName">MY PERCENTAGE</span>
<p class="subtitledash">New percentage</p>
</div>
</div>
<hr class="solid">
<div class="row">
<div class="col-xs-6">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgusersDash">
</div>
<div class="col-xs-6">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgusersDash">
</div>
<div class="col-xs-6">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgusersDash">
</div>
</div>
Card link
Another link
</div>
</div>
</div>
</div>
</div>
</div>
Image Problem
On .cardsZone you have to use a relative width and not an absolute one. Use width: fit-content:
.cardsZone{
margin-top: 5%;
width: fit-content;
height: 70%;
margin-right: auto;
margin-left: auto;
}
.myCards{
background: #E7EAF180 0% 0% no-repeat padding-box;
box-shadow: 0px 3px 20px #BCBCCB47;
border-radius: 8px;
border: none;
}
.card-deck .card {
margin-left: 0px;
}
.mysmallCcards{
width: 100%;
background: #FFFFFF 0% 0% no-repeat padding-box;
box-shadow: 0px 3px 20px #BCBCCB47;
border-radius: 8px;
border: none;
margin-top: 20px;
}
.card-header:first-child {
border-radius: calc(9px - 1px) calc(9px - 1px) 0 0;
}
.mycardHeader{
background-color: white;
}
.imgDash{
width: 40px;
height: 40px;
border-radius: 8px;
}
.brandName{
text-align: left;
font-family: 'Noto Sans', sans-serif;
font-size: 22px;
letter-spacing: 0;
color: #4D4F5C;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
line-height: 0px;
font-weight: re;
}
.subtitledash{
text-align: left;
font-family: 'Noto Sans', sans-serif;
font-size: 13px;
font-weight: bold;;
letter-spacing: 0;
color: #4D4F5C;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.imgusersDash{
width: 24px;
height: 24px;
transform: matrix(1, 0, 0, 1, 0, 0);
border-radius: 8px;
margin-left: 15px;
}
hr.solid {
border-top: 1px solid #999;
width:100%
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<div class="card-deck cardsZone">
<div class="card myCards">
<div class="card-body">
<div *ngFor="let pr of ProgressDashTasks">
<div class="card mysmallCcards">
<div class="card-body">
<div class="row">
<div class="col-sm-2">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgDash">
</div>
<div class="col-sm-8">
<span class="brandName">MY PERCENTAGE</span>
<p class="subtitledash">New percentage</p>
</div>
</div>
<hr class="solid">
<div class="row">
<div class="col-xs-6">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgusersDash">
</div>
<div class="col-xs-6">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgusersDash">
</div>
<div class="col-xs-6">
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Circle-icons-tools.svg/1024px-Circle-icons-tools.svg.png" class="img-responsive imgusersDash">
</div>
</div>
Card link
Another link
</div>
</div>
</div>
</div>
</div>
</div>
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);
}
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.
I'm trying to achieve this CSS animation but don't know how to do it. I want to rotate the top-border around the circle but the whole thing is rotating including text. I just want to rotate the top-border on 360 degree. Here is my code snippet below:
div#skill {
/*background: url(../img/white.jpg) center no-repeat;
background-size: cover;*/
background-color: rgba(144, 0, 64,0.8);
color: #fff;
padding: 10px 0;
}
div#skill h3 {
color: #fff;
text-transform: none;
}
div#skill .row {
margin-right: -15px;
margin-left: -15px;
padding: 15px 150px;
}
div#skill .circle {
height: 120px;
width: 120px;
border: 5px solid #ccc;
border-top-color: orange;
border-radius: 60px;
background-color: #74002f;
/*Making the top border to spin*/
animation: spin 2s linear infinite;
}
div#skill .circle:after {
content: url(../img/icons/arrow-point-to-right.png);
position: absolute;
top: 25px;
right: 0;
}
div#skill .circle.last:after{
display: none;
}
.circle .caption {
font-weight: bold;
padding: 20px 24px;
}
.caption h6 {
font-size: 15px;
}
/*Animation on circle*/
#keyframes spin {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
<div id="skill">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h3>My development process</h3>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="circle">
<div class="caption text-center">
<h6>1</h6>
<h6>Concept</h6>
</div>
</div>
</div>
<div class="col-md-3">
<div class="circle">
<div class="caption text-center">
<h6>2</h6>
<h6>Design</h6>
</div>
</div>
</div>
<div class="col-md-3">
<div class="circle">
<div class="caption text-center">
<h6>3</h6>
<h6>Code</h6>
</div>
</div>
</div>
<div class="col-md-3">
<div class="circle last">
<div class="caption text-center">
<h6 class="text-center">4</h6>
<h6 class="text-center">Launch</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>about my skills</h3>
</div>
<div class="col-md-6">
</div>
</div>
</div>
</div>
Please help me out! Will really appreciate your help in this.Thank you in advance!
div#skill {
/*background: url(../img/white.jpg) center no-repeat;
background-size: cover;*/
background-color: rgba(144, 0, 64, 0.8);
color: #fff;
padding: 10px 0;
}
div#skill h3 {
color: #fff;
text-transform: none;
}
div#skill .row {
margin-right: -15px;
margin-left: -15px;
padding: 15px 150px;
}
div#skill .circle {
height: 120px;
width: 120px;
border: 5px solid #ccc;
border-top-color: orange;
border-radius: 50%;
background-color: #74002f;
/*Making the top border to spin*/
animation: spin 2s linear infinite;
}
div#skill .circle:after {
content: url(../img/icons/arrow-point-to-right.png);
position: absolute;
top: 25px;
right: 0;
}
div#skill .circle.last:after {
display: none;
}
.circle .caption {
font-weight: bold;
padding: 20px 24px;
}
.caption h6 {
font-size: 15px;
}
/*Animation on circle*/
#keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.col-md-3 {
position: relative;
}
.caption {
position: absolute;
z-index: 10;
text-align: center;
left: 65px; /* (120px width + 5+5px border )/2 */
transform: translate(-50%, 0);
}
<div id="skill">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h3>My development process</h3>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="caption text-center">
<h6>1</h6>
<h6>Concept</h6>
</div>
<div class="circle">
</div>
</div>
<div class="col-md-3">
<div class="caption text-center">
<h6>2</h6>
<h6>Design</h6>
</div>
<div class="circle">
</div>
</div>
<div class="col-md-3">
<div class="caption text-center">
<h6>3</h6>
<h6>Code</h6>
</div>
<div class="circle">
</div>
</div>
<div class="col-md-3">
<div class="caption text-center">
<h6 class="text-center">4</h6>
<h6 class="text-center">Launch</h6>
</div>
<div class="circle last">
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>about my skills</h3>
</div>
<div class="col-md-6">
</div>
</div>
</div>
</div>
The solution is to make another div that will be behind the .circle with position:absolute; that how, it will "take" the .circle size but not contains the .circle content.
div#skill {
/*background: url(../img/white.jpg) center no-repeat;
background-size: cover;*/
background-color: rgba(144, 0, 64,0.8);
color: #fff;
padding: 10px 0;
}
div#skill h3 {
color: #fff;
text-transform: none;
}
div#skill .row {
margin-right: -15px;
margin-left: -15px;
padding: 15px 150px;
}
div#skill .circle {
position:relative;
height: 120px;
width: 120px;
border: 5px solid #ccc;
/*border-top-color: orange;*/
border-radius: 50%;
background-color: #74002f;
}
div#skill .circle:after {
content: url(../img/icons/arrow-point-to-right.png);
position: absolute;
top: 25px;
right: 0;
}
div#skill .circle.last:after{
display: none;
}
.circle .caption {
font-weight: bold;
padding: 20px 24px;
position:relative;
z-index:1;
}
.caption h6 {
font-size: 15px;
}
.circle-rotate {
height: 100%;
width: 100%;
border-top: 5px solid orange;
border-radius: 60px;
background-color: #74002f;
/*Making the top border to spin*/
animation: spin 2s linear infinite;
position:absolute;
top:0;
left:0;
}
/*Animation on circle*/
#keyframes spin {
from {transform: rotate(0deg);}
to {transform: rotate(360deg);}
}
<div id="skill">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h3>My development process</h3>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="circle">
<div class="circle-rotate"></div>
<div class="caption text-center">
<h6>1</h6>
<h6>Concept</h6>
</div>
</div>
</div>
<div class="col-md-3">
<div class="circle">
<div class="caption text-center">
<h6>2</h6>
<h6>Design</h6>
</div>
</div>
</div>
<div class="col-md-3">
<div class="circle">
<div class="caption text-center">
<h6>3</h6>
<h6>Code</h6>
</div>
</div>
</div>
<div class="col-md-3">
<div class="circle last">
<div class="caption text-center">
<h6 class="text-center">4</h6>
<h6 class="text-center">Launch</h6>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3>about my skills</h3>
</div>
<div class="col-md-6">
</div>
</div>
</div>
</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>