I want to make a responsive step bar with year on top side of step circle and text in bottom of the circle like this one:
Here is my html code.
<div class="container">
<ul class="progressbar">
<li>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li id="last-child"></li>
</ul>
</div>
Demo
The problem is I am not getting how to add these years, circle in start and arrow in the end. Please help me how I can do this and make it responsive.I'll be very thankful to you for your help.
Hope this helps. thanks
.container {
width: 1000px;
margin: 100px auto;
}
.progressbar {
counter-reset: step;
}
.progressbar li {
list-style-type: none;
width: 16.6%;
float: left;
font-size: 10px;
position: relative;
text-align: center;
color: #444972;
}
.progressbar li:before {
width: 30px;
height: 30px;
content: counter(step);
counter-increment: step;
line-height: 30px;
border: 3px solid #444972;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
background-color: white;
}
.progressbar li:after {
width: 100%;
height: 3px;
content: '';
position: absolute;
background-color: #444972;
top: 15px;
left: -50%;
z-index: -1;
}
#last-child:after {
width: 100%;
height: 3px;
content: '';
position: absolute;
background-color: #444972;
top: 15px;
left: -50%;
z-index: -1;
}
#last-child:before {
display: none;
}
.progressbar li:first-child:after {
/*content: none;*/
}
#circle{
font-size: 24px;
position: absolute;
left: 7%;
top: 16.29%;
color: #444972;
}
.outer{position:realative}
.year{
position: absolute;
top: -40px;
left: 50%;
transform: translatex(-50%);
}
.progressbar{position:relative;}
.progressbar:before{
content: "";
position: absolute;
height: 10px;
width: 10px;
border-radius: 50%;
background-color: black;
left: -10px;
top: 12px;
}
.progressbar:after{
content: "";
position: absolute;
width: 0;
height: 0;
border-right: 10px solid transparent;
border-bottom: 10px solid transparent;
border-top: 10px solid transparent;
border-left: 10px solid black;
right: 63px;
top: 5px;
}
<div class="container">
<ul class="progressbar">
<li>
<div class="outer"><p class="year">1990</p>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</div></li>
<li>
<div class="outer"><p class="year">1990</p>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</div></li>
<li>
<div class="outer"><p class="year">1990</p>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</div></li>
<li>
<div class="outer"><p class="year">1990</p>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</div></li>
<li>
<div class="outer"><p class="year">1990</p>Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</div></li>
<li id="last-child"></li>
</ul>
</div>
use label with in your li and try this
label{
position: absolute;
top:-40%;
left: 0;
bottom: 0;
right: 0;
margin: auto;
font-size:18px;
}
.container {
width: 1000px;
margin: 100px auto;
}
.progressbar {
counter-reset: step;
}
.progressbar li {
list-style-type: none;
width: 16.6%;
float: left;
font-size: 10px;
position: relative;
text-align: center;
color: #444972;
}
.progressbar li:before {
width: 30px;
height: 30px;
content: counter(step);
counter-increment: step;
line-height: 30px;
border: 3px solid #444972;
display: block;
text-align: center;
margin: 0 auto 10px auto;
border-radius: 50%;
background-color: white;
}
.progressbar li:after {
width: 100%;
height: 3px;
content: '';
position: absolute;
background-color: #444972;
top: 15px;
left: -50%;
z-index: -1;
}
#last-child:after {
width: 100%;
height: 3px;
content: '';
position: absolute;
background-color: #444972;
top: 15px;
left: -50%;
z-index: -1;
}
#last-child:before {
display: none;
}
.progressbar li:first-child:after {
/*content: none;*/
}
#circle{
font-size: 24px;
position: absolute;
left: 7%;
top: 16.29%;
color: #444972;
}
label{
position: absolute;
top:-40%;
left: 0;
bottom: 0;
right: 0;
margin: auto;
font-size:18px;
}
/*for circle use this class*/
.dot {
height: 18px;
width: 18px;
background-color: #444972;
border-radius: 50%;
display: inline-block;
position: absolute;
top:8px;
left: -60%;
bottom: 0;
right: 0;
}
/*for triangle use this class*/
.triangle {
width: 0;
height: 0;
overflow: hidden;
}
.triangle:after {
content: "";
display: block;
width: 0;
height: 0;
margin-top:5px;
margin-left:78px;
border-top: 12px solid transparent;
border-bottom: 12px solid transparent;
border-left: 12px solid #444972;
}
<div class="container">
<ul class="progressbar">
<li>
<span class="dot"></span>
<label>1998</label>
Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>
<label>2004</label>
Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>
<label>2006</label>
Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>
<label>2014</label>
Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li>
<label>2015</label>
Visionet was founded lorem ipsum dolor sit amet New York USA by Arshad Masood</li>
<li id="last-child">
<span class="triangle"></span>
</li>
</ul>
</div>
Related
Im trying to toggle sidebar. I want it to be above the content but when i close the sidebar , content moves down. Probably its because of i used overflow:hidden but with display:none i cant use animation. How can i manage that?
Text.jsx
const Test = () => {
const [open,SetOpen] = useState(true);
function handleClick(){
SetOpen(!open)
}
return (
<div className="main">
<div className={open ? "sidebar" : "sidebar_collapsed"}>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
<button onClick={handleClick} className="btn">X</button>
</div>
<div className='content'>
<button onClick={handleClick} className="btn">X</button>
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</div>
</div>
)
}
test.css
.main{
width: 100%;
height: 100%;
margin: 0;
}
.sidebar{
display: flex;
position: absolute;
left: 0;
top: 0;
z-index: 1;
background:white;
width: 20%;
box-shadow: 2px 0 4px rgba(0,0,0,0.5);
transition: width .35s;
overflow: hidden;
height: 100%;
}
.sidebar_collapsed{
width: 0px;
}
.btn{
width: 30px;
height: 30px;
margin: 5px;
top: 0;
right: 0;
}
.content{
margin: 50px;
overflow: auto;
width: 100%;
height: 100%;
}
I would like to change the border of the message displayed in chat box , it should like the one in image , please suggest how to implement itas i have no idea how to do it .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Example</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<style type="text/css">
body{margin-top:20px;}
#import url(https://fonts.googleapis.com/css?family=Oswald:400,300);
#import url(https://fonts.googleapis.com/css?family=Open+Sans);
body
{
font-family: 'Open Sans', sans-serif;
}
.chat_box .chat_message_wrapper ul.chat_message > li + li {
margin-top: 4px;
}
.chat_box_wrapper.chat_box_small.chat_box_active {
background:#e1e3e5;
height: 600px;
overflow-y: auto;
width: 450px;
}
.chat_box {
padding: 16px;
}
.chat_box .chat_message_wrapper::after {
clear: both;
}
.chat_box .chat_message_wrapper::after, .chat_box .chat_message_wrapper::before {
content: " ";
display: table;
}
.chat_box .chat_message_wrapper .chat_user_avatar {
float: left;
}
.chat_box .chat_message_wrapper {
margin-bottom: 20px;
}
.md-user-image {
border-radius: 50%;
width: 48px;
height:48px;
}
img {
border: 0 none;
box-sizing: border-box;
height: auto;
max-width: 100%;
vertical-align: middle;
}
.chat_box .chat_message_wrapper ul.chat_message, .chat_box .chat_message_wrapper ul.chat_message > li {
list-style: outside none none;
padding: 0;
}
.chat_box .chat_message_wrapper ul.chat_message {
float: left;
margin: 0 0 0 20px;
max-width: 67%;
}
.chat_box.chat_box_colors_a .chat_message_wrapper ul.chat_message > li:first-child::before {
border-right-color: #616161;
}
.chat_box .chat_message_wrapper ul.chat_message > li:first-child::before {
border-color: transparent #ededed transparent transparent;
border-style: solid;
border-width: 0 16px 16px 0;
content: "";
height: 0;
left: -14px;
position: absolute;
top: 0;
width: 0;
}
.chat_box.chat_box_colors_a .chat_message_wrapper ul.chat_message > li {
background: #FCFBF6 none repeat scroll 0 0;
color: #000000;
}
.chat_box .chat_message_wrapper ul.chat_message > li {
background: #ededed none repeat scroll 0 0;
border-radius: 4px;
clear: both;
color: #212121;
display: block;
float: left;
font-size: 13px;
padding: 8px 16px;
position: relative;
word-break: break-all;
}
.chat_box .chat_message_wrapper ul.chat_message, .chat_box .chat_message_wrapper ul.chat_message > li {
list-style: outside none none;
padding: 0;
}
.chat_box .chat_message_wrapper ul.chat_message > li {
margin: 0;
}
.chat_box .chat_message_wrapper ul.chat_message > li p {
margin: 0;
}
.chat_box.chat_box_colors_a .chat_message_wrapper .chat_message_time {
color: rgba(185, 186, 180, 0.9);
}
.chat_box .chat_message_wrapper .chat_message_time {
color: #e1e3e5;
text-align:center;
display: block;
font-size: 11px;
padding-top: 2px;
font-size:14px;
text-transform: uppercase;
}
.chat_box .chat_message_wrapper.chat_message_right .chat_user_avatar {
float: right;
}
.chat_box .chat_message_wrapper.chat_message_right ul.chat_message {
float: right;
margin-left: 0 !important;
margin-right: 24px !important;
}
.chat_box.chat_box_colors_a .chat_message_wrapper.chat_message_right ul.chat_message > li:first-child::before {
border-left-color: #83acc5;
}
.chat_box.chat_box_colors_a .chat_message_wrapper ul.chat_message > li:first-child::before {
border-right-color: #FCFBF6;
}
.chat_box .chat_message_wrapper.chat_message_right ul.chat_message > li:first-child::before {
border-color: transparent transparent transparent #ededed;
border-width: 0 0 29px 29px;
left: auto;
right: -14px;
}
.chat_box .chat_message_wrapper ul.chat_message > li:first-child::before {
border-color: transparent #ededed transparent transparent;
border-style: solid;
border-width: 0 29px 29px 0;
content: "";
height: 0;
left: -14px;
position: absolute;
top: 0;
width: 0;
}
.chat_box.chat_box_colors_a .chat_message_wrapper.chat_message_right ul.chat_message > li {
background: #83acc5 none repeat scroll 0 0;
}
.chat_box .chat_message_wrapper ul.chat_message > li {
background: #ededed none repeat scroll 0 0;
border-radius: 12px;
clear: both;
color: #212121;
display: block;
float: left;
font-size: 13px;
padding: 8px 16px;
position: relative;
}
</style>
</head>
<body>
<div class="container">
<div id="chat" class="chat_box_wrapper chat_box_small chat_box_active" style="opacity: 1; display: block; transform: translateX(0px);">
<div class="chat_box touchscroll chat_box_colors_a">
<div class="chat_message_wrapper">
<div class="chat_user_avatar">
<a href="https://web.facebook.com/iamgurdeeposahan" target="_blank" >
<img src="http://bootdey.com/img/Content/avatar/avatar1.png" class="md-user-image">
</a>
</div>
<span class="chat_message_time">13:38</span>
<ul class="chat_message">
<li>
<p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio, eum? </p>
</li>
<li>
<p> Lorem ipsum dolor sit amet </p>
</li>
</ul>
</div>
<div class="chat_message_wrapper chat_message_right">
<div class="chat_user_avatar">
<a href="https://web.facebook.com/iamgurdeeposahan" target="_blank" >
<img src="http://bootdey.com/img/Content/avatar/avatar1.png" class="md-user-image">
</a>
</div>
<span class="chat_message_time">13:34</span>
<ul class="chat_message">
<li>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. natus nulla perspiciatis quae quasi, quis recusandae, saepe, sunt totam.
</p>
</li>
</ul>
</div>
<div class="chat_message_wrapper chat_message_right">
<div class="chat_user_avatar">
<a href="https://web.facebook.com/iamgurdeeposahan" target="_blank" >
<img src="http://bootdey.com/img/Content/avatar/avatar1.png" class="md-user-image">
</a>
</div>
<span class="chat_message_time">13:34</span>
<ul class="chat_message">
<li>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit.atus nulla perspiciatis quae quasi, quis recusandae, saepe, sunt totam.
</p>
</li>
</ul>
</div>
<div class="chat_message_wrapper">
<div class="chat_user_avatar">
<a href="https://web.facebook.com/iamgurdeeposahan" target="_blank" >
<img src="http://bootdey.com/img/Content/avatar/avatar1.png" class="md-user-image">
</a>
</div>
<span class="chat_message_time">13:34</span>
<ul class="chat_message">
<li>
<p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Distinctio, eum? </p>
</li>
<li>
<p> Lorem ipsum dolor sit amet </p>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>
My image:
How about a positioned pseudo-element with a radial gradient background?
This should get you close.
.chat {
width: 50%;
height: 75px;
margin: 1em auto;
border-radius: 12px;
background: darkseagreen;
position: relative;
}
.left {
border-bottom-left-radius: 0;
}
.right {
border-bottom-right-radius: 0;
}
.chat::after {
content: '';
width: 1.5em;
height: 1.5em;
position: absolute;
bottom: 0;
}
.left::after {
left: 0;
transform: translateX(-100%);
background: radial-gradient(circle at 0 0, transparent, transparent 72%, darkseagreen 72%);
}
.right::after {
right: 0;
transform: translateX(100%);
background: radial-gradient(circle at 100% 0, transparent, transparent 72%, darkseagreen 72%);
}
<div class="chat left"></div>
<div class="chat right"></div>
I've been struggling with this for a while and couldn't find the right solution.
At the bottom of the page I've a footer that's full width. Inside it I want to display I list of messages and right next to its left an icon, in this case it's a Font Awesome icon.
The message list needs to be centered both vertically and horizontally and the icon has to be centered vertically.
I've tried doing this using ul elements with display: inline-block and text-align: center.
The messages displays correctly but the icon is stuck in the same place no matter the size of its container.
Here's what I've so far:
<div class="error-message-container">
<ul class="error-message-bell">
<li aria-hidden="true" class="fa fa-bell-slash-o"></li>
</ul>
<ul class="error-message-list">
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit</li>
<li>consectetur adipiscing elit</li>
<li>Lorem ipsum dolor sit amet</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit</li>
<li>Lorem</li>
<li>ipsum</li>
</ul>
</div>
and the css:
.error-message-container {
border: 1px solid blue;
bottom: 0;
color: light-blue;
font-size: 12px;
left: 0;
position: fixed;
text-align: center;
width: 100%;
}
.error-message-container .error-message-bell {
display: inline-block;
font-size: 20px;
height: 100%;
margin-top: 0;
padding: 0;
vertical-align: middle;
}
.error-message-container .error-message-list {
display: inline-block;
font-weight: 500;
line-height: 1.2;
list-style-type: none;
margin-bottom: 11px;
margin-top: 11px;
padding-left: 8px;
}
https://jsfiddle.net/b1rw80jz/1/
Does anyone know how can I accomplish this?
Thanks
If you need only one icon, you can use pseudo-elements::before for the bell
.error-message-container {
border: 1px solid blue;
bottom: 0;
color: light-blue;
font-size: 12px;
left: 0;
position: fixed;
text-align: center;
width: 100%;
}
.error-message-container .error-message-list {
display: inline-block;
font-weight: 500;
line-height: 1.2;
list-style-type: none;
margin-bottom: 11px;
margin-top: 11px;
padding-left: 8px;
position: relative; /** this provides reference to the ::before element **/
}
.error-message-list::before {
content: "\f1f6"; /** refers to awesome font **/
font-family: FontAwesome; /** refers to awesome font **/
position: absolute; /** this will stick to error-message-list **/
top: 50%; /** this will position the icon 50% height of the error-message-list **/
margin-top: -10px; /** minus half the icon height to truely vertically centered **/
left: -20px; /** this will push it to the left out the error-message-list **/
}
https://jsfiddle.net/b1rw80jz/6/
You could use flex-box like this:
+CSS
.error-message-container {
border: 1px solid blue;
bottom: 0;
color: light-blue;
font-size: 12px;
left: 0;
position: fixed;
text-align: center;
width: 100%;
}
.error-message-container .error-message-bell {
display: inline-block;
font-size: 20px;
height: 100%;
margin: 0;
padding: 0;
}
.error-message-container .error-message-list {
display: inline-block;
font-weight: 500;
line-height: 1.2;
list-style-type: none;
margin-bottom: 11px;
margin-top: 11px;
padding-left: 8px;
}
.center {
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
display: flex;
flex-flow: row wrap;
justify-content: center;
-ms-flex-align: center;
-webkit-align-items: center;
-webkit-box-align: center;
align-items: center;
}
+HTML
<div class="error-message-container center">
<ul class="error-message-bell center">
<li aria-hidden="true" class="fa fa-bell-slash-o"></li>
</ul>
<ul class="error-message-list">
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit</li>
<li>consectetur adipiscing elit</li>
<li>Lorem ipsum dolor sit amet</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit</li>
<li>Lorem</li>
<li>ipsum</li>
</ul>
</div>
Demo
You could add line-height: 5; vertical-align: top; to .error-message-container .error-message-bell.
Fiddle: https://jsfiddle.net/b1rw80jz/1/
Try to change the .error-message-list display to block and add margin-bottom: -5px; to .error-message-bell instead of margin-top
https://jsfiddle.net/b1rw80jz/3/
HTML
<div class="error-message-container">
<div class="inner-container">
<ul class="error-message-bell">
<li aria-hidden="true" class="fa fa-bell-slash-o"></li>
</ul>
<ul class="error-message-list">
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit</li>
<li>consectetur adipiscing elit</li>
<li>Lorem ipsum dolor sit amet</li>
<li>Lorem ipsum dolor sit amet, consectetur adipiscing elit</li>
<li>Lorem</li>
<li>ipsum</li>
</ul>
</div>
</div>
CSS
.inner-container{margin: 0 auto;
display: inline-block;}
.error-message-container .error-message-bell {
display: table-cell;
font-size: 20px;
height: 100%;
margin: 0 auto;
padding: 0;
vertical-align: middle;}
.error-message-container .error-message-list {
display: table-cell;
font-weight: 500;
line-height: 1.2;
list-style-type: none;
margin-bottom: 11px;
margin-top: 11px;
padding-left: 8px;}
Font-Awesome already does it for you by using the <i> element and nesting it within your <li>. Refer to documentation. BTW, I put a DANGER! icon in just for the hell of it.
<li><i class="fa fa-bell-slash-o" aria-hidden="true"></i> ERROR!</li>
FIDDLE
Another vertical alignment question...
Given the following,
HTML:
<div class="thing">
<h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et tempus mauris. Vivamus imperdiet congue iaculis.</h2>
</div>
<div class="thing">
<h2>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec et tempus mauris.</h2>
</div>
CSS:
.thing{
background: #eee;
margin: 0 auto 10px;
width: 625px
}
h2{
display: inline-block;
font-size: 15px;
line-height: 20px;
margin: 0 0 0 40px;
vertical-align: middle;
}
.thing:before{
background: red;
content: '';
display: inline-block;
height: 40px;
position: absolute;
vertical-align: middle;
width: 40px;
}
What do I need to do in order to have the text and the red box vertically centered? This should work for headings of any height.
Fiddle
You just need to remove the position:Absolute that breaks the inline-block behavior. Instead use some trick to fight the space between inline-block elements and be sure the two elements can be aside on the containers width. Try this:
.thing{
font-size:0; /*ADD*/
}
h2{
/*margin: 0 0 0 40px; REMOVE*/
width:585px; /*ADD*/
}
.thing:before{
/*position: absolute; REMOVE*/
}
Check this Demo Fiddle
I guess your question has two answers.
Here's solution one: (Make the red box equal the height of the .thing content.
.thing{
background: #eee;
margin: 0 auto 10px;
position: relative; // Make .thing:before relate it's position to this
width: 625px
}
h2{
font-size: 15px;
line-height: 20px;
margin: 0 0 0 40px;
}
.thing:before{
background: red;
content: '';
height: 100%; // Height will equal .thing height
position: absolute;
width: 40px;
}
Demo 1
Second solution: (Make text center vertically)
.thing{
background: #eee;
margin: 0 auto 10px;
min-height: 40px;
position: relative;
width: 625px
}
h2{
font-size: 15px;
line-height: 20px;
margin: 0 0 0 40px;
position: absolute;
top: 50%;
transform: translateY(-50%);
}
.thing:before{
background: red;
content: '';
height: 40px;
left: 0;
position: absolute;
top: 0;
width: 40px;
}
Demo 2
the should be a green tinted rectangular box at the base of grid_4, but it appears to be slightly shifted to the right and overlapping. What have I done wrong here?
.sellerdiv {
bottom: 0;
text-align: center;
position: absolute;
width: 100%;
height: 12%;
background-color: rgba(0, 255, 0, .2);
}
.sellerpic {
width: 11%;
position: absolute;
border-radius:80px;
}
}
.container {
width: 96%;
margin: 30px auto;
padding: 0 auto;
float:none;
text-align: center;
display: inline-block;
}
.grid_4 {
display: inline-block;
width: 28%;
margin-top: 15;
margin-left: 10px;
margin-right: 10px;
height: 400px;
vertical-align: top;
padding-top: 6px;
padding-left: 6px;
padding-right: 6px;
position: relative;
cursor: pointer;
background-color:#f1f1f1;
border-radius: 3px;
}
.overlayname {z-index: 3; color: #ffffff;
left: 4%;
font-size: 22px;
position: absolute;
font-family: helvetica;
top:5%;
padding: 3px 8px 3px 8px;
background: rgba(0,0,0,.65);
}
.overlayprice {z-index: 3; color: #ffffff;
left: 4%;
font-size: 12px;
position: absolute;
top: 33%;
font-family: helvetica;
padding: 3px 8px 3px 8px;
background: rgba(0,0,0,.5);
}
.profilepic {
margin: 40px 0px 0px 0px;
border: 7px solid white;
border-radius: 70px;
}
.sellerdiv {
bottom: 0;
text-align: center;
position: absolute;
width: 100%;
height: 12%;
background-color: rgba(0, 255, 0, .2);
}
.sellerpic {
width: 11%;
position: absolute;
border-radius:80px;
<body>
<div class="container">
<div class="grid_4">
<div class="imgcontainer">
<img src="test.jpg" alt="" />
<div class="overlayname">test title</div>
<div class="overlayprice">test price</div>
</div>
<div class="textcontainer">
<p>Description</p>
</div>
<div class="sellerdiv">
<div class="sellerpic"><img src="test.jpg"></div>
</div>
</div>
<div class="grid_4">
<img src="test.jpg" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
<div class="grid_4">
<img src="test3.jpg" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>
http://jsfiddle.net/autoboxer/3583nazg/ note: if you full screen or expand the result window, you will see the boxes appear in 3 columns as intended.
Just give a left: 0; style to your .sellerdiv.
.sellerdiv {
...
left: 0;
}
Here is the working JSFiddle.
And here is the whole code.
.sellerdiv {
bottom: 0;
text-align: center;
position: absolute;
width: 100%;
height: 12%;
background-color: rgba(0, 255, 0, .2);
}
.sellerpic {
width: 11%;
position: absolute;
border-radius:80px;
}
}
.container {
width: 96%;
margin: 30px auto;
padding: 0 auto;
float:none;
text-align: center;
display: inline-block;
}
.grid_4 {
display: inline-block;
width: 28%;
margin-top: 15;
margin-left: 10px;
margin-right: 10px;
height: 400px;
vertical-align: top;
padding-top: 6px;
padding-left: 6px;
padding-right: 6px;
position: relative;
cursor: pointer;
background-color:#f1f1f1;
border-radius: 3px;
}
.overlayname {z-index: 3; color: #ffffff;
left: 4%;
font-size: 22px;
position: absolute;
font-family: helvetica;
top:5%;
padding: 3px 8px 3px 8px;
background: rgba(0,0,0,.65);
}
.overlayprice {z-index: 3; color: #ffffff;
left: 4%;
font-size: 12px;
position: absolute;
top: 33%;
font-family: helvetica;
padding: 3px 8px 3px 8px;
background: rgba(0,0,0,.5);
}
.profilepic {
margin: 40px 0px 0px 0px;
border: 7px solid white;
border-radius: 70px;
}
.sellerdiv {
bottom: 0;
left: 0;
text-align: center;
position: absolute;
width: 100%;
height: 12%;
background-color: rgba(0, 255, 0, .2);
}
.sellerpic {
width: 11%;
position: absolute;
border-radius:80px;
}
<div class="container">
<div class="grid_4">
<div class="imgcontainer">
<img src="test.jpg" alt="" />
<div class="overlayname">test title</div>
<div class="overlayprice">test price</div>
</div>
<div class="textcontainer">
<p>Description</p>
</div>
<div class="sellerdiv">
<div class="sellerpic"><img src="test.jpg"></div>
</div>
</div>
<div class="grid_4">
<img src="test.jpg" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
<div class="grid_4">
<img src="test3.jpg" alt="" />
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>