How to place a vertical line between two div elements?
.flex-container {
display: -webkit-flex;
margin: 0 auto;
text-align: center;
}
.flex-container .column {
width: 320px;
text-align: center;
}
.vr {
border-left: 2px dotted black;
width: 2px;
margin: 0px 5px 0px 5px;
height: 200px;
}
<div>
<div class="flex-container mt-3 d-flex justify-content-center align-items-center">
<div class="column">Karvat group was established in Mumbai.</div>
<div class="vr "></div>
<div class="column2 bg-alt box arrow-left ml-15 "> 1952</div>
</div>
</div>
Rough way of getting this done.
HTML
<div class="timeline">
<div class="container left">
<div class="content">
<h2>2017</h2>
<p>Lorem ipsum..</p>
</div>
</div>
<div class="container right">
<div class="content">
<h2>2016</h2>
<p>Lorem ipsum..</p>
</div>
</div>
</div>
CSS
* {
box-sizing: border-box;
}
/* Set a background color */
body {
background-color: #474e5d;
font-family: Helvetica, sans-serif;
}
/* The actual timeline (the vertical ruler) */
.timeline {
position: relative;
max-width: 1200px;
margin: 0 auto;
}
/* The actual timeline (the vertical ruler) */
.timeline::after {
content: '';
position: absolute;
width: 6px;
background-color: white;
top: 0;
bottom: 0;
left: 50%;
margin-left: -3px;
}
/* Container around content */
.container {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
/* The circles on the timeline */
.container::after {
content: '';
position: absolute;
width: 25px;
height: 25px;
right: -17px;
background-color: white;
border: 4px solid #FF9F55;
top: 15px;
border-radius: 50%;
z-index: 1;
}
/* Place the container to the left */
.left {
left: 0;
}
/* Place the container to the right */
.right {
left: 50%;
}
/* Add arrows to the left container (pointing right) */
.left::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
right: 30px;
border: medium solid white;
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent white;
}
/* Add arrows to the right container (pointing left) */
.right::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
left: 30px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Fix the circle for containers on the right side */
.right::after {
left: -16px;
}
/* The actual content */
.content {
padding: 20px 30px;
background-color: white;
position: relative;
border-radius: 6px;
}
/* Media queries - Responsive timeline on screens less than 600px wide */
#media screen and (max-width: 600px) {
/* Place the timelime to the left */
.timeline::after {
left: 31px;
}
/* Full-width containers */
.container {
width: 100%;
padding-left: 70px;
padding-right: 25px;
}
/* Make sure that all arrows are pointing leftwards */
.container::before {
left: 60px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
/* Make sure all circles are at the same spot */
.left::after, .right::after {
left: 15px;
}
/* Make all right containers behave like the left ones */
.right {
left: 0%;
}
}
Output:
Here is the sample code for it, You can also take some help from online codepen's https://codepen.io/havardob/pen/dyKoOjX
.stepper{
height: 400px;
width: 1px;
border-right: 2px dashed black;
position: relative;
}
.stepper:before,
.stepper:after
{
content: "";
position: absolute;
width: 10px;
height: 10px;
right: -7px;
border-radius: 50%;
border: 1px solid black;
background: #fff;
}
.stepper:after{
top: 50px;
}
<div class="stepper">
</div>
Related
I am not sure why the position for the circle and container for the left side can't fix like the right side. When I resize the screen, the circle of the right container can still remind in the middle of the line but the left side cant. Does anyone know what is the error?
.timeline {
position: relative;
max-width: 100%;
margin: 0 auto;
}
.timeline::after {
content: '';
position: absolute;
width: 0.375em;
background-color: #D5D5D5;
top: 0;
bottom: 0;
left: 50%;
margin-left: -0.1875em;
}
.container2 {
padding: 0.625em 2.5em;
position: relative;
background-color: inherit;
width: 40%;
}
.container2::after {
content: '';
position: absolute;
width: 1.5625em;
height: 1.5625em;
right: -1.0625em;
background-color: white;
border: 0.25em solid #86B5D0;
top: 0.9375em;
border-radius: 50%;
z-index: 1;
}
.left {
left: 2.2%;
}
.right {
left: 50%;
}
.right::after {
left: -1em;
}
.left::before {
content: " ";
height: 0;
position: absolute;
top: 1.375em;
width: 0;
z-index: 1;
right: 1.875em;
border: medium solid #2D336A;
border-width: 0.625em 0 0.625em 0.625em;
border-color: transparent transparent transparent #2D336A;
}
.right::before {
content: " ";
height: 0;
position: absolute;
top: 1.375em;
width: 0;
z-index: 1;
left: 1.875em;
border: medium solid #2D336A;
border-width: 0.625em 0.625em 0.625em 0;
border-color: transparent #2D336A transparent transparent;
}
.content {
padding: 1.25em 1.875em;
background-color: #2D336A;
position: relative;
border-radius: 0.375em;
}
#media screen and (max-width: 40%) {
/* Place the timelime to the left */
.timeline::after {
left: 1.9375em;
}
/* Full-width containers */
.container2 {
width: 100%;
padding-left: 4.375em;
padding-right: 1.5625em;
}
/* Make sure that all arrows are pointing leftwards */
.container2::before {
left: 3.75em;
border: medium solid white;
border-width: 0.625em 0.625em 0.625em 0;
border-color: transparent white transparent transparent;
}
/* Make sure all circles are at the same spot */
.left::after,
.right::after {
left: 0.9375em;
}
/* Make all right containers behave like the left ones */
.right {
left: 0%;
}
}
<div class="timeline">
<div class="container2 left">
<div class="content">
<font class="titleText1">1</font><br><br> ABC
</div>
</div>
<div class="container2 right">
<div class="content">
<font class="titleText">2</font><br><br> ABC
</div>
</div>
</div>
Your .container2 elements are positioned with relative so that they remain in a vertical flow. When you position the .right one with left: 50%, it shifts it exactly over the timeline: great!
Now you'd like to do the opposite for the .left one, which would be right: 50%. But that won't work as it's not positioned in absolute, so it will shift from its natural position within the page flow.
Fix this by setting it float: right so it starts from the far right and ends up spot-on the timeline. But it breaks the flow again.
So add clear: both to .container2 to restore vertical flow and you're finally there.
One of the very rare instances where float can actually help!
.timeline {
position: relative;
max-width: 100%;
margin: 0 auto;
}
.timeline::after {
content: '';
position: absolute;
width: 0.375em;
background-color: #D5D5D5;
top: 0;
bottom: 0;
left: 50%;
margin-left: -0.1875em;
}
.container2 {
clear: both; /* Add this */
padding: 0.625em 2.5em;
position: relative;
background-color: inherit;
width: 40%;
}
.container2::after {
content: '';
position: absolute;
width: 1.5625em;
height: 1.5625em;
right: -1.0625em;
background-color: white;
border: 0.25em solid #86B5D0;
top: 0.9375em;
border-radius: 50%;
z-index: 1;
}
.left {
float: right; /* Add this */
right: 50%; /* Change this */
}
.right {
left: 50%;
}
.right::after {
left: -1em;
}
.left::before {
content: " ";
height: 0;
position: absolute;
top: 1.375em;
width: 0;
z-index: 1;
right: 1.875em;
border: medium solid #2D336A;
border-width: 0.625em 0 0.625em 0.625em;
border-color: transparent transparent transparent #2D336A;
}
.right::before {
content: " ";
height: 0;
position: absolute;
top: 1.375em;
width: 0;
z-index: 1;
left: 1.875em;
border: medium solid #2D336A;
border-width: 0.625em 0.625em 0.625em 0;
border-color: transparent #2D336A transparent transparent;
}
.content {
padding: 1.25em 1.875em;
background-color: #2D336A;
position: relative;
border-radius: 0.375em;
}
#media screen and (max-width: 40%) {
/* Place the timelime to the left */
.timeline::after {
left: 1.9375em;
}
/* Full-width containers */
.container2 {
width: 100%;
padding-left: 4.375em;
padding-right: 1.5625em;
}
/* Make sure that all arrows are pointing leftwards */
.container2::before {
left: 3.75em;
border: medium solid white;
border-width: 0.625em 0.625em 0.625em 0;
border-color: transparent white transparent transparent;
}
/* Make sure all circles are at the same spot */
.left::after,
.right::after {
left: 0.9375em;
}
/* Make all right containers behave like the left ones */
.right {
left: 0%;
}
}
<div class="timeline">
<div class="container2 left">
<div class="content">
<font class="titleText1">1</font><br><br> ABC
</div>
</div>
<div class="container2 right">
<div class="content">
<font class="titleText">2</font><br><br> ABC
</div>
</div>
</div>
I am trying to teach myself how ot build a timeline and add images. I found this on W3. I want to add images left / right of each text-container displaying what is writte in the text.
I experimented around a lot trying to make it work but I dont completely understand. Also there are some parts within this code I dont completely understand yet. It would be helpful I think, if you could break it down into pieces are explain a little on what each code of line does. But my main problem is to add images next to (left or right) the text-containers.
Thank you.
* {
box-sizing: border-box;
}
body {
background-color: #474e5d;
font-family: Helvetica, sans-serif;
}
.timeline {
position: relative;
max-width: 1200px;
margin: 0 auto;
}
.timeline::after {
content: '';
position: absolute;
width: 6px;
background-color: white;
top: 0;
bottom: 0;
left: 50%;
margin-left: -3px;
}
.container {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
.container::after {
content: '';
position: absolute;
width: 25px;
height: 25px;
right: -17px;
background-color: white;
border: 4px solid #FF9F55;
top: 15px;
border-radius: 50%;
z-index: 1;
}
.left {
left: 0;
}
.right {
left: 50%;
}
.left::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
right: 30px;
border: medium solid white;
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent white;
}
.right::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
left: 30px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
.right::after {
left: -16px;
}
.content {
padding: 20px 30px;
background-color: white;
position: relative;
border-radius: 6px;
}
<div class="timeline">
<div class="container left">
<div class="content">
<h2>2017</h2>
<p>Lorem ipsum..</p>
</div>
</div>
<div class="container right">
<div class="content">
<h2>2016</h2>
<p>Lorem ipsum..</p>
</div>
</div>
</div>
You can add the image to existing container using <img> tag.
<div class="container left">
<div class="content">
<h2>2017</h2>
<p>Lorem ipsum..</p>
</div>
<img src="https://placehold.it/200x200" /> <!-- image tag inside the container -->
</div>
I added the below additional CSS and used CSS flexbox layout.
/* Newly added CSS begin*/
.container {
display: flex; /*this makes the container flexbox layout*/
}
.container.left .content {
order: 2; /* order changes the content order within container */
margin-left: auto; /* pushes the left content box to extreme left */
}
.container.right .content {
margin-right: auto;
}
.container img {
margin: 0 20px;
}
/* Newly added CSS ends */
Updated code is below:
* {
box-sizing: border-box;
}
body {
background-color: #474e5d;
font-family: Helvetica, sans-serif;
}
/* Newly added CSS begin*/
.container {
display: flex;
}
.container.left .content {
order: 2;
margin-left: auto;
}
.container.right .content {
margin-right: auto;
}
.container img {
margin: 0 20px;
}
/* Newly added CSS ends */
.timeline {
position: relative;
max-width: 1200px;
margin: 0 auto;
}
.timeline::after {
content: '';
position: absolute;
width: 6px;
background-color: white;
top: 0;
bottom: 0;
left: 50%;
margin-left: -3px;
}
.container {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
.container::after {
content: '';
position: absolute;
width: 25px;
height: 25px;
right: -17px;
background-color: white;
border: 4px solid #FF9F55;
top: 15px;
border-radius: 50%;
z-index: 1;
}
.left {
left: 0;
}
.right {
left: 50%;
}
.left::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
right: 30px;
border: medium solid white;
border-width: 10px 0 10px 10px;
border-color: transparent transparent transparent white;
}
.right::before {
content: " ";
height: 0;
position: absolute;
top: 22px;
width: 0;
z-index: 1;
left: 30px;
border: medium solid white;
border-width: 10px 10px 10px 0;
border-color: transparent white transparent transparent;
}
.right::after {
left: -16px;
}
.content {
padding: 20px 30px;
background-color: white;
position: relative;
border-radius: 6px;
}
<div class="timeline">
<div class="container left">
<div class="content">
<h2>2017</h2>
<p>Lorem ipsum..</p>
</div>
<img src="http://placehold.it/200x200" />
</div>
<div class="container right">
<div class="content">
<h2>2016</h2>
<p>Lorem ipsum..</p>
</div>
<img src="http://placehold.it/200x200" />
</div>
</div>
Fiddle
Updated Fiddle with Adjacent images
Please run the example below. I'm trying to stretch the left line further to the left to compensate the parent's padding as you can see in the second example, while keeping the title centered relative to the parent like in the first example. I can't seem to have both.
(For anyone who's familiar, the divider I'm trying to tweak comes from ant-design)
#container {
height: 100px;
width: 400px;
background: #EFEFEF;
padding: 24px;
}
/* Normal use case */
.divider {
position: relative;
line-height: 23px;
height: 1px;
display: table;
margin: 16px 0;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
font-size: 15px;
white-space: nowrap;
text-align: center;
background: transparent;
}
.divider::before, .divider::after {
position: relative;
top: 50%;
display: table-cell;
width: 50%;
border-top: 1px solid #AAA;
-webkit-transform: translateY(50%);
-ms-transform: translateY(50%);
transform: translateY(50%);
content: '';
}
.divider-text {
display: inline-block;
padding: 0 24px;
}
/* Trying to stretch the left line to further to the left without puting the title off-center */
.divider.stretched-left {
left: -24px;
width: calc(100% + 24px);
min-width: calc(100% + 24px);
}
<div id="container">
<div class="divider">
<span class="divider-text">Title</span>
</div>
<div class="divider stretched-left">
<span class="divider-text">Title</span>
</div>
</div>
First, I would use flexbox instead of table layout then adjust the margin/padding:
Kept only the relevant code for the demo
#container {
width: 400px;
background: #EFEFEF;
padding: 24px;
}
/* Normal use case */
.divider {
display: flex;
margin: 16px 0;
align-items:center;
}
.divider::before, .divider::after {
flex:1;
height: 1px;
background:#AAA;
content: '';
}
.divider::before {
margin-right:24px;
}
.divider::after {
margin-left:24px;
}
.divider.stretched-left:before {
margin-left:-24px;
padding-left: 24px;
}
.divider.stretched-right:after {
margin-right:-24px;
padding-right: 24px;
}
<div id="container">
<div class="divider">
<span class="divider-text">Title</span>
</div>
<div class="divider stretched-left">
<span class="divider-text">another Title</span>
</div>
<div class="divider stretched-right">
<span class="divider-text">Title</span>
</div>
<div class="divider stretched-right">
<span class="divider-text">another Title</span>
</div>
<div class="divider stretched-left stretched-right">
<span class="divider-text">another Title</span>
</div>
</div>
With your original code you can try this:
#container {
height: 100px;
width: 400px;
background: #EFEFEF;
padding: 24px;
}
/* Normal use case */
.divider {
position: relative;
line-height: 23px;
height: 1px;
display: table;
margin: 16px 0;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
font-size: 15px;
white-space: nowrap;
text-align: center;
background: transparent;
}
.divider::before, .divider::after {
position: relative;
top: 50%;
display: table-cell;
width: 50%;
border-top: 1px solid #AAA;
transform: translateY(50%);
content: '';
}
.divider-text {
display: inline-block;
padding: 0 24px;
}
/* Trying to stretch the left line to further to the left without puting the title off-center */
.divider.stretched-left {
left: -24px;
width: calc(100% + 48px); /* Updated */
}
/* Added */
.divider.stretched-left:after {
border-image:linear-gradient(to left,transparent 24px, #aaa 24px) 1;
}
<div id="container">
<div class="divider">
<span class="divider-text">Title</span>
</div>
<div class="divider stretched-left">
<span class="divider-text">Title</span>
</div>
</div>
#container {
height: 100px;
width: 400px;
background: #EFEFEF;
padding: 24px;
}
.divider {
position: relative;
line-height: 23px;
height: 1px;
display: table;
margin: 16px 0;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
font-size: 15px;
white-space: nowrap;
text-align: center;
background: transparent;
width: 100%; /* SOLUTION – this is new */
}
.divider::before, .divider::after {
position: absolute; /* SOLUTION – this has changed */
top: 50%;
display: table-cell;
width: 41%; /* SOLUTION – changed, matches desired layout best */
border-top: 1px solid #AAA;
-webkit-transform: translateY(50%);
-ms-transform: translateY(50%);
transform: translateY(50%);
content: '';
}
.divider::before{
left: -24px; /* SOLUTION – compensate #container padding */
width: calc( 41% + 24px ); /* SOLUTION – add the offset to the width */
}
.divider::after{
right: 0px; /* SOLUTION */
}
.divider-text {
display: inline-block;
padding: 0 24px;
}
<div id="container">
<div class="divider">
<span class="divider-text">Title</span>
</div>
</div>
.divider.stretched-left {
left: -24px;
width: calc(100% + 48px);
min-width: calc(100% + 48px);
}
Just You have to replace last css lines code with above given code.
Solution with minimum CSS, without flex, without transform.
.divider {
position: relative;
text-align:center;
}
.divider:before {
content:'';
position: absolute;
top:50%;
height: 1px;
width: 100%;
background: #000;
left: 0;
z-index: -1;
}
.divider span{
padding: 0 24px;
z-index: 1;
background: #fff;
display: inline-block;
}
<div class="divider">
<span>Title</span>
</div>
I want to remove the first line from the CSS timeline I created, I just want the timeline circle to show up first not to have a line before it. I also want to style each dot different color, how can I do both these?
I have tried to add a class to one of the timeline containers called .not_complete but it doesnt change the color of the circle of the timeline.
/* The actual timeline (the vertical ruler) */
.timelinex {
position: relative;
max-width: 1200px;
margin: 0 auto;
padding-bottom: 5em;
}
/* The actual timeline (the vertical ruler) */
.timelinex:before {
content: '';
position: absolute;
width: 0px;
background-color: #fff;
top: auto;
bottom: 0;
left: 50%;
margin-left: -3px;
}
.timelinex::after {
content: '';
position: absolute;
width: 4px;
background-color: #e3e3e3;
top: 0;
bottom: 0;
left: 50%;
margin-left: -3px;
}
/* Container around content */
.containerx {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
/* The circles on the timeline */
.containerx::after {
content: '';
position: absolute;
width: 12px;
height: 12px;
right: -5px;
background-color: #e3e3e3;
top: 15px;
border-radius: 50%;
z-index: 1;
}
.containerx::after .not_complete {
background-color: #e3e3e3 !important;
}
/* Place the container to the left */
.leftx {
left: 0;
}
/* Place the container to the right */
.rightx {
left: 50%;
}
/* Fix the circle for containers on the right side */
.rightx::after {
left: -7px;
}
/* The actual content */
.contentx {
padding: 2px 3px;
position: relative;
border-radius: 6px;
}
<div class="timelinex">
<div class="containerx leftx not_complete">
<div class="contentx">
<p>
<img src="assets/img/therapist1.jpg" style="border-radius: 0.5em;border-top-left-radius: 120px; border-bottom-right-radius: 120px">
</p>
<h5 style="color:#999;font-style: 0.5em"> DAY 1 </h5>
<div> Test Timeline Step 1</div>
</div>
</div>
</div>
The selector here is invalid:
.containerx::after .not_complete {
It would select the child of the ::after pseudo element. You need to use:
.containerx.not_complete::after {
The above selector selects any element's ::after pseudo element, with the classes containerx and not_complete. So kindly replace your code with:
.containerx.not_complete::after {
background-color: #e3e3e3 !important;
}
Hope this solves your issue.
Complete Snippet
/* The actual timeline (the vertical ruler) */
.timelinex {
position: relative;
max-width: 1200px;
margin: 0 auto;
padding-bottom: 5em;
}
/* The actual timeline (the vertical ruler) */
.timelinex:before {
content: '';
position: absolute;
width: 0px;
background-color: #fff;
top: auto;
bottom: 0;
left: 50%;
margin-left: -3px;
}
.timelinex::after {
content: '';
position: absolute;
width: 4px;
background-color: #e3e3e3;
top: 0;
bottom: 0;
left: 50%;
margin-left: -3px;
}
/* Container around content */
.containerx {
padding: 10px 40px;
position: relative;
background-color: inherit;
width: 50%;
}
/* The circles on the timeline */
.containerx::after {
content: '';
position: absolute;
width: 12px;
height: 12px;
right: -5px;
background-color: #e3e3e3;
top: 15px;
border-radius: 50%;
z-index: 1;
}
.containerx.not_complete::after {
background-color: #e3e3e3 !important;
}
/* Place the container to the left */
.leftx {
left: 0;
}
/* Place the container to the right */
.rightx {
left: 50%;
}
/* Fix the circle for containers on the right side */
.rightx::after {
left: -7px;
}
/* The actual content */
.contentx {
padding: 2px 3px;
position: relative;
border-radius: 6px;
}
<div class="timelinex" >
<div class="containerx leftx not_complete">
<div class="contentx">
<p><img src="assets/img/therapist1.jpg" style="border-radius: 0.5em;border-top-left-radius: 120px; border-bottom-right-radius: 120px"></p>
<h5 style="color:#999;font-style: 0.5em"> DAY 1 </h5>
<div> Test Timeline Step 1</div>
</div>
</div>
</div>
Update: For Even / Odd Styling and First Child.
To create odd and even styling, you need to use :nth-child() selector. An example of having it blue and red is here:
li {
display: block;
width: 200px;
padding: 10px;
color: #fff;
}
li:nth-child(odd) {
background: #00f;
}
li:nth-child(even) {
background: #f00;
}
li:first-child {
background: #000;
font-weight: bold;
}
<ul>
<li>First Child</li>
<li>Even</li>
<li>Odd</li>
<li>Even</li>
<li>Odd</li>
</ul>
I am having trouble adding gray color to the left of that div.
<div class="full-width">
<div class="footer-nav">
<div class="footer-nav-left">
<p class="text-center"> © Copyright 2016. All Rights Reserved </p>
</div>
<div class="footer-nav-right">
Nav links here
</div>
</div>
</div>
Please check link below for full code:
JS Fiddle
What I need is:
A 60 deg angle requires uneven borders.
.footer-nav-left:after { /* note, now an 'after' */
content: '';
line-height: 0;
font-size: 0;
width: 0;
height: 0;
border-top: 80px solid gray;
border-bottom: 0px solid transparent;
border-left: 0px solid transparent;
border-right: 40px solid transparent; /* half border-top */
position: absolute;
top: 0;
left: 100%;
}
For the grey background extending to the left side of the viewport, use another pseudo-element
.footer-nav-left:before {
content: '';
line-height: 0;
font-size: 0;
width: 50vw;
height: 100%;
background: inherit;
position: absolute;
top: 0;
right: 100%;
}
body {
margin: 0;
}
.full-width {
background-color: black;
overflow: hidden;
/* no scroll bar */
}
.footer-nav {
min-height: 80px;
width: 480px;
margin: 0 auto;
}
.footer-nav-left {
background-color: gray;
min-height: 80px;
position: relative;
float: left;
color: #FFFFFF;
z-index: 1001;
}
.footer-nav-left:before {
content: '';
line-height: 0;
font-size: 0;
width: 50vw;
height: 100%;
background: green;
/* for demo purposes: use inherit for production */
position: absolute;
top: 0;
right: 100%;
z-index: -1;
}
.footer-nav-left:after {
content: '';
line-height: 0;
font-size: 0;
width: 0;
height: 0;
border-top: 80px solid gray;
border-bottom: 0px solid transparent;
border-left: 0px solid transparent;
border-right: 40px solid transparent;
position: absolute;
top: 0;
left: 100%;
}
.footer-nav-left p {
margin-top: 30px;
font-size: 15px;
}
<div class="full-width">
<div class="footer-nav">
<div class="footer-nav-left">
<p class="text-center">© Copyright 2016. All Rights Reserved</p>
</div>
<div class="footer-nav-right">
Nav links here
</div>
</div>
</div>
Note: the angled border only works (as would any) because the height of the parent is known. Percentage width borders are not yet possible.
Like this?
New css:
.footer-nav{
min-height: 80px;
width:100%; // <-- changed
margin:0 auto;
}
.footer-nav-left p{
margin-top: 30px;
font-size:15px;
margin-left: 80px; // <-- changed
}
Updated fiddle
Not sure about your border issue;
.footer-nav-left p{
margin-top: 30px;
font-size:15px;
margin-left:80px;
}
.footer-nav{
min-height: 80px;
width:960px;
margin:0 auto;
position:relative;
}
.footer-nav-left{
background-color:gray;
min-height:80px;
position: absolute;
left:0;
color:#FFFFFF;
z-index:1001;
}