Set background on pseudo element created arrow - html

I have a bunch of div content boxes. I also used pseudo before and after selectors to create arrows for each box. Now I have put background colors for the content boxes. I want to put the respective background color Inside the arrows also.
I tried this but it it creates the background color outside the arrows not inside:
.timeline .post:nth-child(1n) .timeline-content.bg-blue::before, .timeline .post:nth-child(1n) .timeline-content.border-blue::before {background-color: blue;}

You're going about making the arrows a strange way.
This is the most common method.
.content {
width: 50%;
height: 100px;
background: orange;
margin: 10px auto;
position: relative;
}
.content:before {
content: '';
position: absolute;
width: 0;
height: 0;
border: 15px solid transparent;
top: 10px;
}
.left:before {
right: 100%;
border-right-color: orange;
}
.right:before {
left: 100%;
border-left-color: orange;
}
<div class="content left">
</div>
<div class="content right">
</div>

Working solution..
HTML
<div class="container_24">
<div class="grid_24">
<section id="timeline">
<div class="content">
<div class="timeline">
<article class="post">
<div class="timeline-time">
<time>January, 2005-2010</time>
</div>
<div class="timeline-content tc-left bg-blue wow slideInLeft" id="tc1">
<h2 class="entry-title">
Title 1 Goes Here
</h2>
<div class="entry-content">
Content 1 Goes Here
</div>
</div>
</article><!-- .post -->
<article class="post">
<div class="timeline-time">
<time>Jan 1, 2005</time>
</div>
<div class="timeline-content bg-green wow slideInRight" id="tc2">
<h2 class="entry-title">
Title Goes Here
</h2>
<div class="entry-content">
<p>Content 2 Goes Here</p>
</div>
</div>
</article>
<article class="post">
<div class="timeline-time">
<time>Jan 1, 2006</time>
</div>
<div class="timeline-content tc-left bg-red wow slideInLeft" id="tc3">
<h2 class="entry-title">
Title Goes Here
</h2>
<div class="entry-content">
<p>Content 3 Goes Here</p>
</div>
</div>
</article><!-- .post -->
<article class="post">
<div class="timeline-time">
<time>Jan 1, 2008</time>
</div>
<div class="timeline-content bg-orange wow slideInRight" id="tc4">
<h2 class="entry-title">
Title Goes Here
</h2>
<div class="entry-content">
<p>
Content 4 Goes Here
</p>
</div>
</div>
</article>
<article class="post">
<div class="timeline-time">
<time>Jan 1, 2010</time>
</div>
<div class="timeline-content tc-left bg-gray wow slideInLeft" id="tc5">
<h2 class="entry-title">
Title Goes Here
</h2>
<div class="entry-content">
<p>Content 5 Goes Here</p>
</div>
</div>
</article><!-- .post -->
</div><!-- end timeline -->
</div><!-- end content -->
</section><!-- end section -->
CSS
/*************************
Timeline Styles
*************************/
.timeline {
padding: 20px 0;
position: relative;
}
.timeline:before {
background-color: #d2d2d2;
background-color: rgba(0, 0, 0, 0.2);
border-radius: 2px;
content: "";
display: block;
height: 100%;
left: 50%;
margin-left: -2px;
position: absolute;
top: 0;
width: 4px;
}
.timeline .post {
border: 0 none;
margin: 0;
padding: 0 40px 5px 0;
width: 50%;
}
.timeline .post:last-child, .timeline .post:nth-child(even):last-child {
padding-bottom: 0;
}
.timeline .post:nth-child(even) {
margin-left: 50%;
padding: 0 0 5px 40px;
}
.timeline .post:nth-child(even) .timeline-time {
left: auto;
margin: 31px 40px 0 0;
right: 50%;
text-align: right;
}
.timeline .post:nth-child(even) .timeline-content:before {
border: 15px solid transparent;
border-right-color: #ccc;
left: -30px;
right: auto;
}
.timeline .post:nth-child(even) .timeline-content:after {
border: 14px solid transparent;
left: -28px;
right: auto;
}
.timeline .post .timeline-time {
color: #999;
left: 50%;
margin: 31px 0 0 40px;
position: absolute;
}
.timeline .post .timeline-content {
border: 1px solid #ccc;
border-radius: 3px;
padding: 46px;
position: relative;
}
.timeline .post .timeline-content:before, .timeline .post .timeline-content:after {
border: 15px solid transparent;
border-left-color: #ccc;
content: "";
display: block;
position: absolute;
right: -30px;
top: 26px;
}
.timeline .post .timeline-content:after {
border: 14px solid transparent;
right: -28px;
top: 27px;
}
.tc-left {right: 40px;}
.bg-blue {background: blue;}
.bg-green {background: green;}
.bg-red {background: red;}
.bg-orange {background: orange;}
.bg-gray {background: gray;}
.timeline .post:nth-child(1n) .timeline-content.bg-blue::before, .timeline .post:nth-child(1n) .timeline-content.border-blue::before {background-color: #fff;border-left-color: blue;}
.timeline .post:nth-child(2n) .timeline-content.bg-green::before, .timeline .post:nth-child(2n) .timeline-content.border-green::before {border-color: #fff;border-right-color: green;}
.timeline .post:nth-child(3n) .timeline-content.bg-red::before, .timeline .post:nth-child(3n) .timeline-content.border-red::before {border-color: #fff;border-left-color: red;}
.timeline .post:nth-child(4n) .timeline-content.bg-orange::before, .timeline .post:nth-child(4n) .timeline-content.border-orange::before {border-color: #fff;border-right-color: orange;}
.timeline .post:nth-child(5n) .timeline-content.bg-gray::before, .timeline .post:nth-child(5n) .timeline-content.border-gray::before {border-color: #fff;border-left-color: gray;}
Check out this Fiddle too

Related

HTML/CSS - Timeline makes page too long with white space

I'm trying to create this timeline telling people about graffiti art. I have a problem where I couldn't cut short my page and it would let me scroll down to nothingness. Here is the code with only CSS and HTML.
EDIT:
Here is a Gif about my problem is, I tried to remove the timeline: 3000px, but it only works for the snippet, didn't work for Dreamweaver. I tried to run on both Chrome and Firefox
GIF OF MY PROBLEM
#charset "utf-8";
.timeline {
list-style: none;
padding: 20px 0 20px;
position: relative;
height: 3000px;
}
body {
max-height: 3000px;
}
ul {
max-height: 3000px;
}
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #eeeeee;
left: 50%;
margin-left: -1.5px;
}
.timeline > li {
margin-bottom: 20px;
position: relative;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li > .timeline-panel {
width: 46%;
float: left;
border: 1px solid #d4d4d4;
border-radius: 2px;
padding: 20px;
position: relative;
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
}
.timeline > li > .timeline-panel:before {
position: absolute;
top: 26px;
right: -15px;
display: inline-block;
border-top: 15px solid transparent;
border-left: 15px solid #ccc;
border-right: 0 solid #ccc;
border-bottom: 15px solid transparent;
content: " ";
}
.timeline > li > .timeline-panel:after {
position: absolute;
top: 27px;
right: -14px;
display: inline-block;
border-top: 14px solid transparent;
border-left: 14px solid #fff;
border-right: 0 solid #fff;
border-bottom: 14px solid transparent;
content: " ";
}
.timeline > li > .timeline-badge {
color: #fff;
width: 50px;
height: 50px;
line-height: 50px;
font-size: 22px;
text-align: center;
position: absolute;
top: 16px;
left: 50%;
margin-left: -25px;
background-color: #999999;
z-index: 100;
border-top-right-radius: 50%;
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
border-bottom-left-radius: 50%;
}
.timeline > li.timeline-inverted > .timeline-panel {
float: right;
}
.timeline > li.timeline-inverted > .timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto;
}
.timeline > li.timeline-inverted > .timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
}
.timeline-badge.primary {
background-color: #2e6da4;
}
.timeline-badge.success {
background-color: #3f903f;
}
.timeline-badge.warning {
background-color: #f0ad4e;
}
.timeline-badge.danger {
background-color: #d9534f;
}
.timeline-badge.info {
background-color: #5bc0de;
}
.timeline-title {
margin-top: 0;
color: inherit;
}
.timeline-body > p,
.timeline-body > ul {
margin-bottom: 0;
}
.timeline-body > p + p {
margin-top: 5px;
}
.timeline-body {
text-align: left;
margin: 0px;
font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", "serif";
}
.timeline-panel .timeline-body .img-responsive {
padding-top: 5px;
}
#media screen and (max-width:768px){
#closer1 {
top: -200px;
}
#closer2 {
top: -200px;
}
#closer3 {
top: -200px;
}
#closer4 {
top: -200px;
}
#closer5 {
top: -200px;
}
#closer6 {
top: -200px;
}
#closer7 {
top: -200px;
}
}
<body>
<div class="container">
<div class="page-header">
<h1 id="timeline">History</h1>
</div>
<ul class="timeline">
<li>
<div class="timeline-badge">1970</div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>n modern times, paint (particularly spray paint) and marker pens have become the most commonly used graffiti materials. </p>
</div>
</li>
<li class="timeline-inverted" id="closer">
<!--<div class="timeline-badge warning"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>A train full with what consider vandalism at that time.</p>
</div>
</div>
</li>
<li id="closer1">
<!--<div class="timeline-badge danger"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>In most countries, marking or painting property without the property owner's permission is considered defacement and vandalism, which is a punishable crime</p>
</div>
</div>
</li>
<li class="timeline-inverted" id="closer2">
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">1970s</h4>
</div>
<div class="timeline-body">
<p>Soon art galleries in New York began buying graffiti but it was around that time when John Lindsey, the mayor of New York at that time, declared the first war on graffiti in 1972. A few die-hard artists refused to be beaten and kept the art form alive during this period.</p>
</div>
</div>
</li>
<li id="closer3">
<div class="timeline-badge info">1980</div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>Graffiti is considered one of the four elements of hip-hop (along with emceeing, DJing, and B-Boying). Graffiti is a central part of this subculture. The origins of all of these can be traced to the Bronx, in New York City.</p>
</div>
</div>
</li>
<li class="timeline-inverted" id="closer4">
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Modern graffiti</h4>
</div>
<div class="timeline-body">
<p>On top of the political aspect of graffiti as a movement, political groups and individuals may also use graffiti as a tool to spread their point of view.</p>
</div>
</div>
</li>
<li id="closer5">
<!--<div class="timeline-badge success"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Banksy's work</h4>
</div>
<div class="timeline-body">
<p>Banksy displays his art on publicly visible surfaces such as walls and self-built physical prop pieces.</p>
</div>
</div>
</li>
<li class="timeline-inverted in" id="closer6">
<!--<div class="timeline-badge success"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Another Banksy works</h4>
</div>
<div class="timeline-body">
<p>Both Mickey Mouse and Ronald McDonald are two family-friendly faces of American capitalism, the same country that dropped Napalm on Vietnam</p>
</div>
</div>
</li>
<li id="closer7">
<!--<div class="timeline-badge success"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Lady Pink</h4>
</div>
<div class="timeline-body">
<p>Lady Pink was born in Ecuador, raised in NYC and currently resides in the countryside north of the city</p>
</div>
</div>
</li>
</ul>
</div>
</body>
As you can see, I try to reduce the height of the page by using max-height in both body and container. But It just didn't work.
Thank you in advance!
.timeline {
height: 3000px;
}
This is the problem. I deleted the height: 3000px and it looks fine now. Also I don't think the max-height: 3000px in body and ul is necessary anymore.
#charset "utf-8";
.timeline {
list-style: none;
padding: 20px 0 20px;
position: relative;
}
body {
}
ul {
}
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: " ";
width: 3px;
background-color: #eeeeee;
left: 50%;
margin-left: -1.5px;
}
.timeline > li {
margin-bottom: 20px;
position: relative;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li:before,
.timeline > li:after {
content: " ";
display: table;
}
.timeline > li:after {
clear: both;
}
.timeline > li > .timeline-panel {
width: 46%;
float: left;
border: 1px solid #d4d4d4;
border-radius: 2px;
padding: 20px;
position: relative;
-webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
box-shadow: 0 1px 6px rgba(0, 0, 0, 0.175);
}
.timeline > li > .timeline-panel:before {
position: absolute;
top: 26px;
right: -15px;
display: inline-block;
border-top: 15px solid transparent;
border-left: 15px solid #ccc;
border-right: 0 solid #ccc;
border-bottom: 15px solid transparent;
content: " ";
}
.timeline > li > .timeline-panel:after {
position: absolute;
top: 27px;
right: -14px;
display: inline-block;
border-top: 14px solid transparent;
border-left: 14px solid #fff;
border-right: 0 solid #fff;
border-bottom: 14px solid transparent;
content: " ";
}
.timeline > li > .timeline-badge {
color: #fff;
width: 50px;
height: 50px;
line-height: 50px;
font-size: 22px;
text-align: center;
position: absolute;
top: 16px;
left: 50%;
margin-left: -25px;
background-color: #999999;
z-index: 100;
border-top-right-radius: 50%;
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
border-bottom-left-radius: 50%;
}
.timeline > li.timeline-inverted > .timeline-panel {
float: right;
}
.timeline > li.timeline-inverted > .timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto;
}
.timeline > li.timeline-inverted > .timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto;
}
.timeline-badge.primary {
background-color: #2e6da4;
}
.timeline-badge.success {
background-color: #3f903f;
}
.timeline-badge.warning {
background-color: #f0ad4e;
}
.timeline-badge.danger {
background-color: #d9534f;
}
.timeline-badge.info {
background-color: #5bc0de;
}
.timeline-title {
margin-top: 0;
color: inherit;
}
.timeline-body > p,
.timeline-body > ul {
margin-bottom: 0;
}
.timeline-body > p + p {
margin-top: 5px;
}
.timeline-body {
text-align: left;
margin: 0px;
font-family: Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", "serif";
}
.timeline-panel .timeline-body .img-responsive {
padding-top: 5px;
}
#media screen and (max-width:768px){
#closer1 {
top: -200px;
}
#closer2 {
top: -200px;
}
#closer3 {
top: -200px;
}
#closer4 {
top: -200px;
}
#closer5 {
top: -200px;
}
#closer6 {
top: -200px;
}
#closer7 {
top: -200px;
}
}
<body>
<div class="container">
<div class="page-header">
<h1 id="timeline">History</h1>
</div>
<ul class="timeline">
<li>
<div class="timeline-badge">1970</div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>n modern times, paint (particularly spray paint) and marker pens have become the most commonly used graffiti materials. </p>
</div>
</li>
<li class="timeline-inverted" id="closer">
<!--<div class="timeline-badge warning"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>A train full with what consider vandalism at that time.</p>
</div>
</div>
</li>
<li id="closer1">
<!--<div class="timeline-badge danger"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>In most countries, marking or painting property without the property owner's permission is considered defacement and vandalism, which is a punishable crime</p>
</div>
</div>
</li>
<li class="timeline-inverted" id="closer2">
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">1970s</h4>
</div>
<div class="timeline-body">
<p>Soon art galleries in New York began buying graffiti but it was around that time when John Lindsey, the mayor of New York at that time, declared the first war on graffiti in 1972. A few die-hard artists refused to be beaten and kept the art form alive during this period.</p>
</div>
</div>
</li>
<li id="closer3">
<div class="timeline-badge info">1980</div>
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title"></h4>
</div>
<div class="timeline-body">
<p>Graffiti is considered one of the four elements of hip-hop (along with emceeing, DJing, and B-Boying). Graffiti is a central part of this subculture. The origins of all of these can be traced to the Bronx, in New York City.</p>
</div>
</div>
</li>
<li class="timeline-inverted" id="closer4">
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Modern graffiti</h4>
</div>
<div class="timeline-body">
<p>On top of the political aspect of graffiti as a movement, political groups and individuals may also use graffiti as a tool to spread their point of view.</p>
</div>
</div>
</li>
<li id="closer5">
<!--<div class="timeline-badge success"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Banksy's work</h4>
</div>
<div class="timeline-body">
<p>Banksy displays his art on publicly visible surfaces such as walls and self-built physical prop pieces.</p>
</div>
</div>
</li>
<li class="timeline-inverted in" id="closer6">
<!--<div class="timeline-badge success"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Another Banksy works</h4>
</div>
<div class="timeline-body">
<p>Both Mickey Mouse and Ronald McDonald are two family-friendly faces of American capitalism, the same country that dropped Napalm on Vietnam</p>
</div>
</div>
</li>
<li id="closer7">
<!--<div class="timeline-badge success"></div>-->
<div class="timeline-panel">
<div class="timeline-heading">
<h4 class="timeline-title">Lady Pink</h4>
</div>
<div class="timeline-body">
<p>Lady Pink was born in Ecuador, raised in NYC and currently resides in the countryside north of the city</p>
</div>
</div>
</li>
</ul>
</div>
</body>
So after a while i figured out myself what was the problem.
The problems are:
1/ .timeline
This is the parent and the position is relative. I set this max-height to 3000px
2/ The height that i set for each #closer is bigger and bigger and they are also relative. (-200px each)
Because of those 2 things, i accidentally expand my .body height higher and higher
The reason why i didn't notice this earlier because in my original file, i put it -400px for #closer1 and -800px for #closer2. This however expand my total max-height of timeline to over (3000px). This was the reason cause my page longer than before.
So yeah, when i delete the max-height and change each #closer to -200px, it's worked
All thank to #lnhtmn for his solution

Responsive fixed width 3 column layout with full width drawer in Desktop and Mobile

I have a 3 column tile responsive design that's 1 column in mobile and 3 columns in desktop and each tile has a content drawer that needs to stretch the FULL width of the screen (complete with blue background).
I have a working model in a pen below but can't get the drawers to stretch full width?
Not sure if it's CSS or if there's a more optimum HTML layout as doing the mobile first design and it works, just not in Desktop/wider views.
Codepen:
<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.7/js/bootstrap.min.js"></script>
function openDrawer(tile) {
var drawer = $(tile).attr("drawer");
if ( $(tile).hasClass("ESGActive") ){ // Already is active?
$(".ESGTile").removeClass("ESGActive");
$("#" + drawer).slideUp();
} else {
// Get all tiles with class="ESGActive" and remove it
$(".ESGTile").removeClass("ESGActive");
// Get all elements with class="ESGDrawer" and hide them
$(".ESGDrawer").slideUp();
// Show the current tab drawer, add "active" class to the button
$("#" + drawer).slideDown();
$(tile).addClass("ESGActive");a
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
.ESGTiles > div{
display:inline;
padding:0;
}
.ESGDrawer {
float:left;
margin:0;
}
.ESGTile > img{
display:none;
}
#media screen and (min-width: 1024px){
.ESGTile > img, .FAQTile > img {
display:block;
}
.ESGTiles > div{
padding:15px;
}
}
#media screen and (max-width: 1024px){
.ESGDrawer {
margin-top: 0!important;
padding: 2em 0!important;
}
.FAQTile img, .ESGDrawer img {
display: none;
}
.ESGTile, .FAQTile {
margin: 0.2em 0;
}
span.drawerToggle {
position: relative;
width: 24px!important;
height: 24px!important;
float:right;
}
.call-to-action img {
width: 70%;
margin: 0 auto 2em auto;
}
}
.FAQTile {
background: #36872a!important;
width: 100%;
}
.drawerToggle{
position: relative;
width: 30px;
height: 30px;
float:right;
}
.drawerToggle:before, .drawerToggle:after{
content: "";
position: absolute;
background-color: white;
transition: transform 0.25s ease-out;
}
.drawerToggle:before{
top: -1px;
left: 50%;
width: 2px;
height: 100%;
margin-left: -1px;
}
.drawerToggle:after{
top: 50%;
left: 0;
width: 100%;
height: 2px;
margin-top: -2px;
}
/**.ESGTile:hover .drawerToggle:before{ transform: rotate(90deg); }
.ESGTile:hover .drawerToggle:after{ transform: rotate(180deg); }**/
.ESGActive .drawerToggle:before{ transform: rotate(90deg); }
.ESGActive .drawerToggle:after{ transform: rotate(180deg); }
.ESGTile, .FAQTile {
display: block;
position: relative;
cursor: pointer;
overflow: hidden;
background-color: #1f335a;
color: #fff;
z-index: 100;
font-weight: 700;
}
.ESGTile h3, .FAQTile h3 {
color: #fff;
}
.ESGTile:hover {
background-color: #344794;
color: #fff;
text-decoration: none;
}
.FAQTile:hover {
background-color: #00a651!important;
color: #fff;
text-decoration: none;
}
.ESGActive {
background: #344794;
}
.ESGActive:after {
bottom: -3px;
left: 50%;
border: solid transparent;
content: " ";
height: 0;
width: 0;
position: absolute;
z-index: 120;
pointer-events: none;
border-color: rgba(255, 255, 255, 0);
border-bottom-color: #fff;
border-width: 10px;
margin-left: -10px;
}
.ESGTile h3, .FAQTile h3 {
font-size: 1.2em;
}
.ESGLabel, .FAQLabel {
margin: 0;
display: block;
padding: 0.8em 15px;
}
.ESGDrawer {
display: none;
background: #1f335a;
color: #fff;
padding: 4em 0;
margin-top: 0.3em;
z-index: 90;
position:inline-block;
width:100vw;
left:0;
}
.ESGDrawer h4 {
font-size: 1.8em;
margin-bottom: 1em;
}
.ESGDrawer p {
line-height: 1.4em;
}
.ESGDrawer p.cta-wrapper {
margin: 0.3em 0 0 0;
}
.ESGDrawer p.cta-wrapper a:before {
bottom: 0;
}
.ESGDrawer a:link, .ESGDrawer a:hover, .ESGDrawer a:visited {
text-decoration: none;
color: #fff;
}
hr {
display: none;
}
.call-to-action {
padding: 3em 0;
}
footer {
margin-top: 0;
}
<div class="container">
<div class="row">
<!-- TILE 1 *********************** -->
<div class="col-xs-12 col-md-4">
<!-- Tile -->
<a class="ESGTile" onclick="openDrawer(this)" drawer="title-1">
<img class="img-responsive" src="http://www.kamunga.com/test.jpg" height="360" width="640">
<h3 class="ESGLabel">Title 1<span class="drawerToggle"></span></h3>
</a>
<!-- Drawer -->
<div id="title-1" class="container-fluid ESGDrawer">
<div class="container ESGMiddleDrawerContent">
<div class="row">
<div class="col-xs-12 col-md-6">
<h4>Title 1</h4>
<p>Lorem ipsum</p><p>Lorem ipsum</p>
</div>
</div>
</div>
</div>
</div>
<!-- TILE 2 *********************** -->
<div class="col-xs-12 col-md-4">
<!-- Tile -->
<a class="ESGTile" onclick="openDrawer(this)" drawer="title-2">
<img class="img-responsive" src="http://www.kamunga.com/test.jpg" height="360" width="640">
<h3 class="ESGLabel">Title 2<span class="drawerToggle"></span></h3>
</a>
<!-- Drawer -->
<div id="title-2" class="container-fluid ESGDrawer">
<div class="container ESGMiddleDrawerContent">
<div class="row">
<div class="col-xs-12 col-md-6">
<h4>Title 2</h4>
<p>Lorem ipsum</p><p>Lorem ipsum</p>
</div>
</div>
</div>
</div>
</div>
<!-- TILE 3 *********************** -->
<div class="col-xs-12 col-md-4">
<!-- Tile -->
<a class="ESGTile" onclick="openDrawer(this)" drawer="title-3">
<img class="img-responsive" src="http://www.kamunga.com/test.jpg" height="360" width="640">
<h3 class="ESGLabel">Title 3<span class="drawerToggle"></span></h3>
</a>
<!-- Drawer -->
<div id="title-3" class="container-fluid ESGDrawer">
<div class="container ESGMiddleDrawerContent">
<div class="row">
<div class="col-xs-12 col-md-6">
<h4>Title 3</h4>
<p>Lorem ipsum</p><p>Lorem ipsum</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Here you're
I added this code at the end of the CSS
.body {
position: relative;
}
.ESGDrawer {
position: absolute;
top: 247px;
left: 0px;
width: 100%;
}
.x{
position: inherit;
}
and I add a new classname to each of your col-xs-12 col-md-4 divs
Check the working demo here
https://codepen.io/anon/pen/JaQPjN

How to design the div box with arrow by using css according to my example?

this is what I want to do
and here is my css and a screenshot what this does:
.bread-list>.bread-item {
background: #B7B7B7;
font-size: 20px;
color: #FFFFFF;
padding: 20px;
margin-top: 2px;
}
.bread-item::after {
content: '';
position: absolute;
left: 42%;
top: 100%;
width: 0;
height: 0;
border-left: 20px solid transparent;
border-right: 20px solid transparent;
border-top: 20px solid #B7B7B7;
clear: both;
}
<div class="bread-list">
<div class="bread-item col-lg-12">
Clients
<div class="result-counter">
182 Total
</div>
<div class="brand-name">
Teva
</div>
</div>
<div class="bread-item col-lg-12">
Sections
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Teva UK
</div>
</div>
<div class="bread-item col-lg-12">
Projects
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Project 3
</div>
</div>
</div>
here is what my actual code shows to me
where I'm wrong exactly?
edit: I've added html-side with all relevant codes. I would like to do differently this for also first and last element.
try this
.bread-list>.bread-item {
background: #B7B7B7;
font-size: 20px;
color: #FFFFFF;
padding: 20px;
margin-top: 2px;
position: relative;
}
.bread-item::after {
content: '';
position: absolute;
left: 50%;
background: #B7B7B7;
width: 20px;
height: 20px;
border: solid #FFFFFF;
border-width: 0 2px 2px 0;
display: inline-block;
padding: 3px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
clear: both;
bottom: -16px;
z-index: 1;
}
Try this..
.bread-list>.bread-item {
background: #B7B7B7;
font-size: 20px;
color: #FFFFFF;
padding: 20px;
margin-top: 2px;
position: relative;
}
.bread-item::after {
content: '';
position: absolute;
left: 42%;
top: -9px;
width: 15px;
height: 15px;
border-right: 2px solid;
border-bottom: 2px solid;
clear: both;
transform: rotate(45deg);
background: #B7B7B7;
}
.bread-item:first-child::after{
display:none;
}
<div class="bread-list">
<div class="bread-item col-lg-12">
Clients
<div class="result-counter">
182 Total
</div>
<div class="brand-name">
Teva
</div>
</div>
<div class="bread-item col-lg-12">
Sections
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Teva UK
</div>
</div>
<div class="bread-item col-lg-12">
Projects
<div class="result-counter">
4 Total
</div>
<div class="brand-name">
Project 3
</div>
</div>
</div>
try add the following to .bread-list > .bread-item
position: relative;

Correct way to animate div resize with text in it

What is the correct way of resizing divs with text in it? I use the code below, but it leaves me with noticeable font distortion when resizing. Its kinda like the font has changed during animation. Also there is a flicker inside the circles. The effect isn't really visible on OSX, but it is on windows machines. How do I fix it?
.content-no-btn {
transition: all .2s ease-in-out;
}
.content-no-btn:hover {
transform: scale(1.05);
}
.entry-content {
border-style: solid;
border-color: #bbb;
border-width: 0px 3px 3px 3px;
padding-top: 20px;
}
#price {
text-align: center;
}
.plan {
display: inline-block;
margin: 10px 1%;
font-family: 'Lato', Arial, sans-serif;
}
.plan-inner {
background: #fff;
margin: 0 auto;
min-width: 280px;
max-width: 100%;
position: relative;
}
.entry-title {
background: #53CFE9;
height: 140px;
position: relative;
text-align: center;
color: #fff;
margin-bottom: 0px;
}
.entry-title>h3 {
background: #20BADA;
font-size: 20px;
padding: 5px 0;
text-transform: uppercase;
font-weight: 700;
margin: 0;
}
.entry-title .price {
position: absolute;
bottom: -25px;
background: #20BADA;
height: 95px;
width: 95px;
margin: 0 auto;
left: 0;
right: 0;
overflow: hidden;
border-radius: 50px;
border: 4px solid #fff;
line-height: 80px;
font-size: 23px;
font-weight: 700;
}
.price span {
position: absolute;
font-size: 8px;
bottom: -10px;
left: 30px;
font-weight: 400;
}
.entry-content {
color: #323232;
padding-top: 20px;
}
.entry-content ul {
margin: 0;
padding: 0;
list-style: none;
text-align: center;
}
.entry-content li {
border-bottom: 1px solid #E5E5E5;
padding: 10px 0;
}
.entry-content li:last-child {
border: none;
}
.btn {
padding: 5em 0 5em 0;
text-align: center;
}
.btn a {
background: #323232;
padding: 10px 30px;
color: #fff;
text-transform: uppercase;
font-weight: 700;
text-decoration: none
}
.hot {
position: absolute;
top: -7px;
background: #F80;
color: #fff;
text-transform: uppercase;
z-index: 2;
padding: 2px 5px;
font-size: 9px;
border-radius: 2px;
right: 10px;
font-weight: 700;
}
.basic .entry-title {
background: #f37920;
}
.basic .entry-title > h3 {
background: #E7680C;
}
.basic .price {
background: #f37920;
}
.standard .entry-title {
background: #4484c1;
}
.standard .entry-title > h3 {
background: #3772aa;
}
.standard .price {
background: #3772aa;
}
.ultimite .entry-title > h3 {
background: #DD4B5E;
}
.ultimite .entry-title {
background: #F75C70;
}
.ultimite .price {
background: #DD4B5E;
}
.gratitude {
padding: 5em 20px 5em 20px;
height: 300px;
text-align: center;
background-color: #f8f9f9;
}
.orderDetailsContent {
max-width: 800px;
text-align: center;
display: table;
position: relative;
margin: auto;
}
<div id="price">
<!--price tab-->
<div class="plan">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title first-entry-title">
<h3>WHATUP </h3>
<div class="price">$0.99<span></span>
</div>
</div>
<div class="entry-content first-entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan basic">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title">
<h3>YEAH </h3>
<div class="price">$1.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan standard">
<div class="plan-inner">
<div class="content-no-btn">
<div class="hot">hot</div>
<div class="entry-title">
<h3>Superduper</h3>
<div class="price">$2.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan ultimite">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title">
<h3>JustGreat</h3>
<div class="price">$3.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
</div>
<div class="gratitude"></div>
Scale transformations of such a small percentage are notorious for this. The only way around it is better browsers.
Instead, consider a translate animation with a whole number of pixels, perhaps upwards. You can also get some scale effect by setting position:relative on .content-no-btn then adding an absolutely positioned ::before with 100% width and height, and scaling only that pseudo-element on hover.

Overlay on table cell on hover of first cell

I have create a table listing. When user hover the first cell that is with 3 dots Edit and Delete option are displayed and below that there is a transparent background.
Everything is fine when content is in single line.
Issue is when there is more content. The height of overlay does not adjust. I have tried top: 0; bottom: 0; height: 100% to the .action it covers the whole table.
body {
margin: 0
}
.table {
display: table;
width: 100%;
border-bottom: 1px solid #ccc
}
.tHead,
.tRow {
display: table-row;
position: relative;
}
.tCell {
display: table-cell;
padding: 5px;
background: #fff;
border-top: 1px solid #ccc;
}
.tHead .tCell {
background: #ccc;
}
.tRow:hover .tCell {
background: #f4f4f4;
border-color: #000;
}
.tRow:hover + .tRow .tCell {
border-color: #000;
}
.tRow .tCell:first-child {
width: 10px;
cursor: pointer;
opacity: 1
}
.menu {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: relative;
margin-left: 5px;
top: 3px;
z-index: 2;
}
.menu:before,
.menu:after {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: absolute;
content: " ";
top: -6px;
}
.menu:before {
top: -12px;
}
.actions {
display: none;
position: absolute;
white-space: nowrap;
z-index: 1;
left: 0;
right: 0;
margin-top: -19px;
background: rgba(255, 255, 255, 0.9);
padding: 5px 5px 5px 28px;
}
.tCell:hover .menu:before,
.tCell:hover .menu:after,
.tCell:hover .menu {
background: #000
}
.tCell:hover .actions {
display: block
}
<div class="table">
<div class="tHead">
<div class="tCell"></div>
<div class="tCell">Name</div>
<div class="tCell">Age</div>
<div class="tCell">Gender</div>
<div class="tCell">Job Profile</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Kelly</div>
<div class="tCell">28</div>
<div class="tCell">Female</div>
<div class="tCell">Web Developer</div>
</div>
<div class="tRow hovered">
<div class="tCell"><span class="menu"></span>
<span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jack
</div>
<div class="tCell">32</div>
<div class="tCell">Male</div>
<div class="tCell">Java Developer</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">
Janaya
</div>
<div class="tCell">26</div>
<div class="tCell">Female</div>
<div class="tCell">.Net Developer</div>
</div>
<div class="tRow ">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jim</div>
<div class="tCell">24</div>
<div class="tCell">Male</div>
<div class="tCell">Full Stack Developer</div>
</div>
</div>
Hope this helps you.
Use :before for the overlay on the cell and target the cells using ~ operator. I had same requirement. This is how I handled it.
body {
margin: 0
}
.table {
display: table;
width: 100%;
}
.tHead,
.tRow {
display: table-row;
position: relative;
}
.tCell {
display: table-cell;
padding: 5px;
background: #fff;
border-top: 1px solid #ccc;
position: relative
}
.tRow:last-child .tCell {
border-bottom: 1px solid #ccc;
}
.tHead .tCell {
background: #ccc;
}
.tRow:hover .tCell {
background: #f4f4f4;
border-color: #000;
}
.tRow .tCell:before {
content: "";
position: absolute;
height: 100%;
width: 100%;
background: rgba(255, 255, 255, 0.9);
top: 0;
left: 0;
display: none;
}
.tRow:hover + .tRow .tCell {
border-color: #000;
}
.tRow .tCell:first-child {
width: 10px;
cursor: pointer;
opacity: 1
}
.menu {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: relative;
margin-left: 5px;
top: 3px;
z-index: 3;
}
.menu:before,
.menu:after {
display: block;
height: 3px;
width: 3px;
background: #ccc;
position: absolute;
content: " ";
top: -6px;
}
.menu:before {
top: -12px;
}
.actions {
display: none;
position: absolute;
white-space: nowrap;
z-index: 4;
left: 0;
right: 0;
margin-top: -19px;
padding: 5px 5px 5px 28px;
}
.tCell:hover .menu:before,
.tCell:hover .menu:after,
.tCell:hover .menu {
background: #000
}
.tCell:hover .actions {
display: block
}
.tRow:hover .tCell:first-child:hover:before,
.tRow:hover .tCell:first-child:hover ~ .tCell:before {
display: block;
}
<div class="table">
<div class="tHead">
<div class="tCell"></div>
<div class="tCell">Name</div>
<div class="tCell">Age</div>
<div class="tCell">Gender</div>
<div class="tCell">Job Profile</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Kelly</div>
<div class="tCell">28</div>
<div class="tCell">Female</div>
<div class="tCell">Web Developer</div>
</div>
<div class="tRow hovered">
<div class="tCell"><span class="menu"></span>
<span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jack
</div>
<div class="tCell">32</div>
<div class="tCell">Male</div>
<div class="tCell">Java Developer</div>
</div>
<div class="tRow">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">
Janaya
</div>
<div class="tCell">26</div>
<div class="tCell">Female</div>
<div class="tCell">.Net Developer</div>
</div>
<div class="tRow ">
<div class="tCell"><span class="menu"></span><span class="actions">
Edit |
Delete
</span>
</div>
<div class="tCell">Jim</div>
<div class="tCell">24</div>
<div class="tCell">Male</div>
<div class="tCell">Full Stack Developer</div>
</div>
</div>
#Tushar .. I noticed that the bottom line of the table, the div border never gets updated on the hover.. fiddle example
.tCell:hover .menu:before,
.tCell:hover .menu:after,
.tCell:hover .menu {
background: #000;
}