How to position product cards and make them look proper? - html

Need to position and make my product cards look more like the ones shown in the image below
https://prnt.sc/mip9eb
i have tried using float:left; but it only made 2 of the product cards position correctly.
These were made using bootstrap
.container {
width: 100%;
height: 100%;
}
.container .product {
width: 390px;
height: 130px;
display: flex;
margin: 1em 0;
border-radius: 5px;
overflow: hidden;
cursor: pointer;
box-shadow: 0px 0px 21px 3px rgba(0, 0, 0, 0.15);
transition: all .1s ease-in-out;
float: left;
}
.container .product .img-container {
flex: 2;
}
.container .product .img-container img {
object-fit: cover;
width: 100%;
height: 100%;
}
.container .product .product-info {
background: #fff;
flex: 3;
}
.container .product .product-info .product-content {
padding: .2em 0 .2em 1em;
}
.container .product .product-info .product-content h1 {
font-size: 1.5em;
}
.container .product .product-info .product-content p {
color: #636363;
font-size: .9em;
font-weight: bold;
width: 90%;
}
.container .product .product-info .product-content ul li {
color: #636363;
font-size: 9em;
margin-left: 0;
}
.container .product .product-info .product-content .buttons {
padding-top: .4em;
}
.container .product .product-info .product-content .buttons .button {
text-decoration: none;
color: #5e5e5e;
font-weight: bold;
padding: .3em .65em;
border-radius: 2.3px;
transition: all .1s ease-in-out;
}
.container .product .product-info .product-content .buttons .buy {
border: 1px #5e5e5e solid;
}
<div class="container">
<div class="product">
<div class="img-container">
<img src="https://icdn2.digitaltrends.com/image/oculus-go-press-720x720.jpg">
</div>
<div class="product-info">
<div class="product-content">
<h1>Oculus Go</h1>
<ul>
<li>Lorem ipsum dolor sit ametconsectetu.</li>
<li>adipisicing elit dlanditiis quis ip.</li>
</ul>
<div class="buttons">
<a class="button buy" href="#">More Info</a>
</div>
</div>
</div>
</div>
</div>
Can someone guide me on how i can make the individual product cards look more like the ones in the image and how to position all 3 of them in a row

I think this is more like what you want.. You needed to wrap your product divs in bootstrap col-12 col-lg-4 columns. (see example full screen so the boxes don't wrap). This will show you 1 column layout on mobile and 3 column layout on large devices like desktops.
Some help on your original code:
- You didn't need the float values
- Your font size was also way too big for your boxes.
- Also, try not to specify height and width for the boxes so that the content fits.
.container .product {
display: flex;
margin: 1em 0;
border-radius: 5px;
cursor: pointer;
box-shadow: 0px 0px 21px 3px rgba(0, 0, 0, 0.15);
transition: all .1s ease-in-out;
}
.container .product .img-container {
flex: 2;
justify-content: center;
align-items: center;
display: flex;
}
.container .product .img-container img {
width: 100%;
height: auto;
}
.container .product .product-info {
background: #fff;
flex: 3;
}
.container .product .product-info .product-content {
padding: .2em 0 .2em 1em;
}
.container .product .product-info .product-content h1 {
font-size: 1.5em;
}
.container .product .product-info .product-content p {
color: #636363;
font-size: .9em;
font-weight: bold;
width: 90%;
}
.container .product .product-info .product-content ul li {
color: #636363;
margin-left: 0;
}
.container .product .product-info .product-content .buttons {
padding-top: .4em;
}
.container .product .product-info .product-content .buttons .button {
text-decoration: none;
color: #5e5e5e;
font-weight: bold;
padding: .3em .65em;
border-radius: 2.3px;
transition: all .1s ease-in-out;
}
.container .product .product-info .product-content .buttons .buy {
border: 1px #5e5e5e solid;
}
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-12 col-lg-4">
<div class="product">
<div class="img-container">
<img src="https://icdn2.digitaltrends.com/image/oculus-go-press-720x720.jpg">
</div>
<div class="product-info">
<div class="product-content">
<h1>Oculus Go</h1>
<ul>
<li>Lorem ipsum dolor sit ametconsectetu.</li>
<li>adipisicing elit dlanditiis quis ip.</li>
</ul>
<div class="buttons">
<a class="button buy" href="#">More Info</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="product">
<div class="img-container">
<img src="https://icdn2.digitaltrends.com/image/oculus-go-press-720x720.jpg">
</div>
<div class="product-info">
<div class="product-content">
<h1>Oculus Go</h1>
<ul>
<li>Lorem ipsum dolor sit ametconsectetu.</li>
<li>adipisicing elit dlanditiis quis ip.</li>
</ul>
<div class="buttons">
<a class="button buy" href="#">More Info</a>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-lg-4">
<div class="product">
<div class="img-container">
<img src="https://icdn2.digitaltrends.com/image/oculus-go-press-720x720.jpg">
</div>
<div class="product-info">
<div class="product-content">
<h1>Oculus Go</h1>
<ul>
<li>Lorem ipsum dolor sit ametconsectetu.</li>
<li>adipisicing elit dlanditiis quis ip.</li>
</ul>
<div class="buttons">
<a class="button buy" href="#">More Info</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

You should use bootstrap their class names to trigger their styling, bootstap does not require alot of extra css.
You could try using this as a start to your project:
Boostrap Cards documentation
<div class="card-deck">
<div class="card">
<img class="card-img-top" src="https://icdn2.digitaltrends.com/image/oculus-go-press-720x720.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Oculus Go</h5>
<p class="card-text">Lorem ipsum dolor sit ametconsectetu.</p>
<p class="card-text"><small class="text-muted">adipisicing elit dlanditiis quis ip.</small></p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="https://icdn2.digitaltrends.com/image/oculus-go-press-720x720.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Oculus Go</h5>
<p class="card-text">Lorem ipsum dolor sit ametconsectetu.</p>
<p class="card-text"><small class="text-muted">adipisicing elit dlanditiis quis ip.</small></p>
</div>
</div>
<div class="card">
<img class="card-img-top" src="https://icdn2.digitaltrends.com/image/oculus-go-press-720x720.jpg" alt="Card image cap">
<div class="card-body">
<h5 class="card-title">Oculus Go</h5>
<p class="card-text">Lorem ipsum dolor sit ametconsectetu.</p>
<p class="card-text"><small class="text-muted">adipisicing elit dlanditiis quis ip.</small></p>
</div>
</div>
</div>

Use your each product inside bootstrap column just like below it will atomically position correctly also see the example here. In this example I remove float left and made width 100% from product class
<div class="container">
<div class="row">
<div class="col-lg-4">
<div class="product">
</div>
</div>
<div class="col-lg-4">
<div class="product">
</div>
</div>
<div class="col-lg-4">
<div class="product">
</div>
</div>
</div>
</div>

You can get your desired style by much more easier code by using Bootstrap classes. You can try this process:
.container {
margin-top: 50px;
}
.card {
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.css">
<div class="container">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="card">
<div class="card-body row">
<img class="card-img-top col-lg-5" src="https://via.placeholder.com/100x100.png?text=Oculus Go" alt="Card image cap">
<div class=" col-lg-7">
<h5 class="card-title">Oculus Go</h5>
<ul class="card-text">
<li>List Text One</li>
<li>List Text Two</li>
</ul>
More Info
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="card">
<div class="card-body row">
<img class="card-img-top col-lg-5" src="https://via.placeholder.com/100x100.png?text=HTC Vive" alt="Card image cap">
<div class=" col-lg-7">
<h5 class="card-title">HTC Vive</h5>
<ul class="card-text">
<li>List Text One</li>
<li>List Text Two</li>
</ul>
More Info
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="card">
<div class="card-body row">
<img class="card-img-top col-lg-5" src="https://via.placeholder.com/100x100.png?text=Cardboard" alt="Card image cap">
<div class=" col-lg-7">
<h5 class="card-title">Cardboard</h5>
<ul class="card-text">
<li>List Text One</li>
<li>List Text Two</li>
</ul>
More Info
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"></script>
<script type="text/javascript" src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"></script>
This design is responsive. Try full screen and different sizes.

Related

HTML CSS responsive Card

I am making a card with header in HTML and CSS. Appreciate your advice on how can I make it responsive. I tried so many ways but I can't seem to have it worked. Do I need to change some code so that the webpage will be responsive?
.section1{
margin-right: 0;
}
.section2{
width:95%;
height: 2.2rem;
background-color: #182035;
margin-right: 0;
margin-top: 7rem;
margin-left: 2.6rem;
text-align: center;
}
.section3{
width:95%;
height: 2.2rem;
background-color: #182035;
margin-right: 0;
margin-top: 30rem;
margin-left: 2.6rem;
text-align: center;
}
h3{
position: relative;
z-index: 40;
color:#ecb445;
margin-left: 3rem;
font-family: Coldiac;
}
.container{
background-color:#ecb445;
border-radius: 0.5rem;
padding-bottom: 1rem;
padding-top: 1rem;
}
/*CARD*/
.card {
width: 20rem;
height: 20rem;
background-color: #fff;
border:0.2rem solid #182035;
overflow: hidden;
position: relative;
display: flex;
cursor: pointer;
justify-content: center;
transition: all ease 0.4s
}
.card img {
width:22rem;
height:auto;
margin-top: -2.5rem;
transition: all ease 0.4s;
}
.card:hover img {
margin-top: 1rem;
}
.card .content {
width: 20.5rem;
height:17rem;
background: #fff;
position: absolute;
bottom: -70%;
margin-left: -8px;
transition: all ease 0.5s;
border-radius: 1rem;
box-shadow: 0px -3px 4px rgba(10, 10, 10, 0.09)
}
.card .content .category {
font-size: 17px;
font-weight: 600;
}
.card .content .price {
font-size: 17px;
font-weight: 500;
color: #000;
}
.card .content p {
font-weight: 500;
font-size: 12px
}
.card:hover .content {
bottom: 0%
}
.buttons button {
border-radius: 1px;
margin-bottom: 10px;
transition: all ease 0.3s
}
.content {
padding: 1rem 1rem;
font-size: 2rem;
}
.category{
padding-bottom: 1rem;
}
#btn2{
background-color:transparent;
border-color: #df4648;
color:#df4648;
}
#btn2:hover{
background-color:#df4648;
color: #fff;
}
<div class="container-fluid">
<div class="section2">
<h3> Paper Stock </h3>
<div class="container mt-4 mb-3">
<div class="row g-2">
<div class="col-md-4 col-sm-12 d-flex justify-content-center">
<div class="card">
<div class="text-center"> <img src="images/glossy.jpeg" class="img-fluid" width="200" /> </div>
<div class="content">
<div class="d-flex justify-content-between align-items-center"> <span class="category">Glossy
Paper</span> </div>
<p> <b> Description: </b>a semi-gloss finish, unlike glossy paper. Matte paper also produces a
high-quality print albeit loses the vibrant effect that Gloss paper has.
<br><br> <b> Size: </b> 8.5x11/A4 <br> <b> Black & White: </b> ₱1.50/page <br> <b> Slightly Colored:
</b> ₱5.00/ page <br> <b> Full Colored: </b> ₱8.00/ page
</p>
<div class="buttons d-flex justify-content-center"> <button class="btn btn-outline-primary mr-1"
id="btn2">Print Now </button></div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12 d-flex justify-content-center">
<div class="card">
<div class="text-center"> <img src="images/matte.jpg" class="img-fluid" width="200" /> </div>
<div class="content">
<div class="d-flex justify-content-between align-items-center"> <span class="category">Matte
Paper</span></div>
<p> <b> Description: </b>a smooth-coated paper designed to present an ultra-smooth and shiny appearance
<br><br>
<b> Size: </b> 8.5x11/A4 <br> <b> Black & White: </b> ₱1.50/page <br> <b> Slightly Colored: </b>
₱5.00/ page <br> <b> Full Colored: </b> ₱8.00/ page
</p>
<div class="buttons d-flex justify-content-center"> <button class="btn btn-outline-primary mr-1"
id="btn2">Print Now </button></div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12 d-flex justify-content-center">
<div class="card">
<div class="text-center"> <img src="images/textured.jpg" class="img-fluid" width="200" /> </div>
<div class="content">
<div class="d-flex justify-content-between align-items-center"> <span class="category">Textured
Paper</span></div>
<p> <b> Description: </b>has four different kinds; smooth, embossed, uncoated, and coated. Each of the
four kinds has their own unique appearance and texture.<br><br>
<b> Size: </b> 8.5x11/A4 <br> <b> Black & White: </b> ₱1.50/page <br> <b> Slightly Colored: </b>
₱5.00/ page <br> <b> Full Colored: </b> ₱8.00/ page
</p>
<div class="buttons d-flex justify-content-center"> <button class="btn btn-outline-primary mr-1"
id="btn2">Print Now</button></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="section3">
<h3>Ink</h3>
<div class="container mt-4 mb-3">
<div class="row g-2">
<div class="col-md-4 col-sm-12 d-flex justify-content-center">
<div class="card">
<div class="text-center"> <img src="images/hpink.jpg" class="img-fluid" width="200"/> </div>
<div class="content">
<div class="d-flex justify-content-between align-items-center"> <span class="category">Hewlett Packard</span> </div>
<p> <b> Description: </b>Hewlett Packard, or HP, uses cartridges which are recycled. HP cartridges also has a reputation for being “ink-spill-free.” <br><br> <b> HP GT52 </b> <br> <b> Product Type: </b> Ink Cartridge <br> <b> Yield: </b> Standard-Yield <br> <b> Price: </b> ₱360.00 </p>
<div class="buttons d-flex justify-content-center"> <button class="btn btn-outline-primary mr-1" id="btn2">Buy Now </button></div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12 d-flex justify-content-center">
<div class="card">
<div class="text-center"> <img src="images/epsonink.png" class="img-fluid" width="200" /> </div>
<div class="content">
<div class="d-flex justify-content-between align-items-center"> <span class="category">Epson</span></div>
<p> <b> Description: </b>Although inks manufactured by Epson costs a lot, they provide quality, true-to-life, and sharp prints for businesses. <br><br>
<b> Epson 664 </b> <br> <b> Product Type: </b> Ink Cartridge <br> <b> Yield: </b> Standard-Yield <br> <b> Price: </b> ₱299.00</p>
<div class="buttons d-flex justify-content-center"> <button class="btn btn-outline-primary mr-1" id="btn2">Buy Now</button></div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-12 d-flex justify-content-center">
<div class="card">
<div class="text-center"> <img src="images/canonink.png" class="img-fluid" width="200" /> </div>
<div class="content">
<div class="d-flex justify-content-between align-items-center"> <span class="category">Canon</span></div>
<p> <b> Description: </b>Canon inks has a history for having inks that blend well with other colors, they are sold at a fair price <br><br>
<b> Canon GT-790</b> <br> <b>Product Type: </b>Ink Cartridge<br> <b> Yield: </b> Standard-Yield <br> <b> Price: </b> ₱499.000 </p>
<div class="buttons d-flex justify-content-center"> <button class="btn btn-outline-primary mr-1" id="btn2">Buy Now</button></div>
</div>
</div>
</div>
</div>
</div>
</div>
Take help from this code:-
<!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.0" />
<title>Document</title>
</head>
<style>
.box {
width: 300px;
height: 250px;
color: blue;
border: 2px solid blue;
margin:3rem 3rem;
}
#box1 {
background-color: aqua;
}
#box2 {
background-color: rgb(229, 255, 0);
}
#box3 {
background-color: rgb(255, 0, 68);
}
#box4 {
background-color: rgb(255, 238, 0);
}
#box5 {
background-color: rgb(35, 57, 126);
}
#box6 {
background-color: rgb(25, 155, 43);
}
.container{
border:4px solid black;
display:flex;
flex-wrap: wrap;
padding:10px 10px;
}
</style>
<body>
<div class="container">
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
<div class="box" id="box3"></div>
<div class="box" id="box4"></div>
<div class="box" id="box5"></div>
<div class="box" id="box6"></div>
</div>
<body>
</html>

Item moving around when window resized

See Umbrella image in images:
Full-size window:
.
Reduced (ideal placement):
I would like to have my umbrella image in the centre of the screen no matter the size of the window.
It works from the point where the window shrinks and works in mobile view too.
I've tried various methods but it doesn't seem to be working, any tips would be greatly appreciated.
Here is my code:
HTML
<div class="wrapper">
<div class="page2">
<h2>Blog</h2>
<div class="wrap">
<div class="card">
<a href="welcome.html">
<img class="card-img" src="str3.jpg">
</a>
<div class="card-text">
<h3>Welcome</h3>
<p>Website Launch and my First Project</p>
</div>
</div>
<div class="card">
<a href="blog.html">
<img class="card-img" src="steve_roe_kyoto.jpg">
</a>
<div class="card-text">
<h3> Kyoto</h3>
<p>My Recent Trip</p>
</div>
</div>
<div class="card">
<a href="best.html">
<img class="card-img" src="str4.jpg">
</a>
<div class="card-text">
<h3>Best of 2018</h3>
<p>Neon Goodness from Last Year</p>
</div>
</div>
</div>
<div class="page3">
<footer>
<div class="umbrella_icon">
<img src="umbrella-02.png">
</div>
<div class="logo_footer">Steve Roe</div>
<div class="footer_menu">
<ul class="ul_footer">
<li>Work With Me</li>
<li>
Contact</li>
</ul>
</div>
</footer>
</div>
</div>
</div>
CSS
.page2{
width: 100%;
margin: 0 auto;
margin-top: 20px;
height: 100%;
}
//cards
.wrap{
width:960px;
margin:auto;
margin-top: 100px;
}
.card{
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.15);
transition: 0.4s;
width: 300px;
text-align: center;
font-size: 16px;
float:left;
margin:10px;
text-decoration: none;
}
.page3{
margin: 20px;
margin-top: 20px;
height: 30%;
}
.umbrella_icon {
text-align: center;
}
.footer {
z-index: 1000;
width: 960px;
margin: 0 auto;
}
Use dispaly:flex to .wrap
See working code
.page2{
width: 100%;
margin: 0 auto;
margin-top: 20px;
height: 100%;
}
.wrap{
margin: auto;
margin-top: 100px;
display: flex;
}
.card{
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.15);
transition: 0.4s;
width: 300px;
text-align: center;
font-size: 16px;
float:left;
margin:10px;
text-decoration: none;
}
.page3{
margin: 20px;
margin-top: 20px;
height: 30%;
}
.umbrella_icon {
text-align: center;
}
.footer {
z-index: 1000;
width: 960px;
margin: 0 auto;
}
<div class="wrapper">
<div class="page2">
<h2>Blog</h2>
<div class="wrap">
<div class="card">
<a href="welcome.html">
<img class="card-img" src="str3.jpg">
</a>
<div class="card-text">
<h3>Welcome</h3>
<p>Website Launch and my First Project</p>
</div>
</div>
<div class="card">
<a href="blog.html">
<img class="card-img" src="steve_roe_kyoto.jpg">
</a>
<div class="card-text">
<h3> Kyoto</h3>
<p>My Recent Trip</p>
</div>
</div>
<div class="card">
<a href="best.html">
<img class="card-img" src="str4.jpg">
</a>
<div class="card-text">
<h3>Best of 2018</h3>
<p>Neon Goodness from Last Year</p>
</div>
</div>
</div>
<div class="page3">
<footer>
<div class="umbrella_icon">
<img src="umbrella-02.png" alt="umbrella">
</div>
<div class="logo_footer">Steve Roe</div>
<div class="footer_menu">
<ul class="ul_footer">
<li>Work With Me</li>
<li>
Contact</li>
</ul>
</div>
</footer>
</div>
</div>
</div>
End The page 2 div before starting page 3 div.
Change the page3 css to
.page3{
margin: 50vh 50vw;
}
<h2>Blog</h2>
<div class="wrap">
<div class="card">
<a href="welcome.html">
<img class="card-img" src="str3.jpg">
</a>
<div class="card-text">
<h3>Welcome</h3>
<p>Website Launch and my First Project</p>
</div>
</div>
<div class="card">
<a href="blog.html">
<img class="card-img" src="steve_roe_kyoto.jpg">
</a>
<div class="card-text">
<h3> Kyoto</h3>
<p>My Recent Trip</p>
</div>
</div>
<div class="card">
<a href="best.html">
<img class="card-img" src="str4.jpg">
</a>
<div class="card-text">
<h3>Best of 2018</h3>
<p>Neon Goodness from Last Year</p>
</div>
</div>
</div>
</div>
<div class="page3">
<footer>
<div class="umbrella_icon">
<img src="umbrella-02.png" alt="umbrella Here">
</div>
<div class="logo_footer">Steve Roe</div>
<div class="footer_menu">
<ul class="ul_footer">
<li>Work With Me</li>
<li>
Contact</li>
</ul>
</div>
</footer>
</div>
Use flex for .wrap like this :
.wrap{
width:960px;
margin:auto;
margin-top: 100px;
display: flex;
justify-content: center;
}
this code make image in center horizontally.

color overlay images styling effect with text

im trying to create a overlay color to my images products, basically the overlay color will appear when i make hover to the images, but isnt working.
The idea is when i pass the mouse over the images a transparecy the title and price appears with the overlay color
Here is my code:
html:
<!-- List of products -->
<div id="products" class="row list-group">
<div class="item col-xs-4 col-lg-4">
<div class="thumbnail">
<img class="group list-group-image" src="images/products/1.png" alt="" />
<div class="caption">
<h4 class="group inner list-group-item-heading">
Product title</h4>
<div class="row go-bottom">
<div class="col-xs-12">
<p class="price">
80 € / 120 €</p>
</div>
</div>
</div>
</div>
</div>
<div class="item col-xs-4 col-lg-4">
<div class="thumbnail">
<img class="group list-group-image" src="images/products/1.png" alt="" />
<div class="caption">
<h4 class="group inner list-group-item-heading">
Product title</h4>
<div class="row go-bottom">
<div class="col-xs-12">
<p class="price">
80 € / 120 €</p>
</div>
</div>
</div>
</div>
</div>
<div class="item col-xs-4 col-lg-4">
<div class="thumbnail overlay">
<img class="group list-group-image" src="images/products/1.png" alt="" />
<div class="caption">
<h4 class="group inner list-group-item-heading">
Color Gold
</h4>
<div class="row go-bottom">
<div class="col-xs-12">
<p class="price">
80 € / 120 €</p>
</div>
</div>
</div>
</div>
</div>
</div>
css:
.thumbnail:after {
content:'\A';
position:absolute;
width:100%; height:100%;
top:0; left:0;
background:rgba(0,0,0,0.6);
opacity:0;
transition: all 0.5s;
-webkit-transition: all 0.5s;
}
.thumbnail:hover:after {
opacity:1;
}
.list-group-item:hover{
background:rgba(0,0,0,.7);
}
.shop-products .item .thumbnail{
border:none;
padding:0;
position: relative;
}
.shop-products .item .thumbnail .caption{
position: absolute;
bottom:0;
width: 100%;
height: 100%;
text-align: center;
}
h4.list-group-item-heading{
text-transform: uppercase;
font-weight: bold;
color:red;
letter-spacing: 3px;
}
.shop-products .item .thumbnail .caption .price{
color:red;
font-size:16px;
letter-spacing: 3px;
}
.go-bottom{
bottom:0px;
position: absolute;
width: 100%;
}
I'm not able to find the class list-group-item inside your code.
the caption should have the background-color.
.shop-products .item .thumbnail .caption{
position: absolute;
bottom:0;
left:0;
width: 100%;
height: 100%;
text-align: center;
display:none;
background:rgba(0,0,0,.7);
}
.shop-products .item .thumbnail:hover .caption{
display:block;
}

Bootstrap columns not working properly

I'm having some problems with Bootstrap columns, they are not working the way they are suppose to. In the picture below the 4 profile boxes have to be centered...the same way the 3 columns are centered in the "smart & creative" section. Unfortunately I can't link to a jsfiddle but I have provided code for you to look at below the image, In the code section scroll down for css.
<!-- smart and creative -->
<div class="smart-creative">
<div class="row">
<div class="container">
<div class="title col-xs-12">
<h2>Smart & Creative</h2>
<p>This is why you will use it :)</p>
</div>
</div>
</div>
<div class="row">
<div class="container">
<div class="circles col-md-4 col-sm-4">
<div class="circle1"></div>
<h4>Multi purpose</h4>
<p>Lorem ipsum dolor sit amet,<br /> consectetur adipisicing..</p>
</div>
<div class="circles col-md-4 col-sm-4">
<div class="circle2"></div>
<h4>Flat UI</h4>
<p>Lorem ipsum dolor sit amet,<br /> consectetur adipisicing..</p>
</div>
<div class="circles col-md-4 col-sm-4">
<div class="circle3"></div>
<h4>Creative Design</h4>
<p>Lorem ipsum dolor sit amet,<br /> consectetur adipisicing..</p>
</div>
</div>
</div>
</div>
<!-- Team -->
<div class="team">
<div class="row">
<div class="container">
<div class="team-title col-md-12">
<h2>Talented & Experts</h2>
<p>This is our team</p>
</div>
</div>
</div>
<div class="row">
<div class="container">
<div class="profile-wrapper">
<div class="profiles pic1 col-md-3 col-sm-3">
<div class="pic-holder">
</div>
<div class="desc">
<h5>Mahmoud Baghagho<h5>
<p>Senior UI Designer</p>
</div>
<div class="twitter-button">
<span class="fa fa-twitter">Follow</span>
</div>
</div>
<div class="profiles pic1 col-md-3 col-sm-3">
<div class="pic-holder">
</div>
<div class="desc">
<h5>Mahmoud Baghagho<h5>
<p>Senior UI Designer</p>
</div>
<div class="twitter-button">
<span class="fa fa-twitter">Follow</span>
</div>
</div>
<div class="profiles pic1 col-md-3 col-sm-3">
<div class="pic-holder">
</div>
<div class="desc">
<h5>Mahmoud Baghagho<h5>
<p>Senior UI Designer</p>
</div>
<div class="twitter-button">
<span class="fa fa-twitter">Follow</span>
</div>
</div>
<div class="profiles pic1 col-md-3 col-sm-3">
<div class="pic-holder">
</div>
<div class="desc">
<h5>Mahmoud Baghagho<h5>
<p>Senior UI Designer</p>
</div>
<div class="twitter-button">
<span class="fa fa-twitter">Follow</span>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
// Smart and Creative
.smart-creative{
background-color: $theme1-color;
color: white;
.title{
text-align: center;
padding-top: 10px;
p{
color: $header-color;
}
}
.circles{
padding-top: 25px;
h4,p{
text-align: center;
}
p{
color: $header-color;
}
.css-for-circle{
height: 100px;
width: 100px;
background-color: $header-color;
border-radius: 50px;
background-position: center;
background-repeat: no-repeat;
margin: 0 auto;
}
.circle1{
background-image: url("../imgs/multi.png");
#extend .css-for-circle;
}
.circle2{
background-image: url("../imgs/flat.png");
#extend .css-for-circle;
}
.circle3{
background-image: url("../imgs/creative.png");
#extend .css-for-circle;
}
}
}
// Team
.team{
background-color: $theme2-color;
.team-title{
h2,p{
text-align: center;
}
}
.profile-wrapper{
margin: 0 auto;
width: 95%;
overflow: hidden;
.profiles{
max-width: 230px;
height: 341px;
background-color: white;
border-radius: 5px;
.pic-holder{
max-width: 164px;
height: 164px;
border-radius: 82px;
background-color: $theme2-color;
margin: 0 auto;
position: relative;
top: 25px;
box-shadow: inset 3px 3px 6px -2px #48804B;
-moz-box-shadow: inset 3px 3px 6px -2px #48804B;
-webkit-box-shadow: inset 3px 3px 6px -2px #48804B;
-o-box-shadow: inset 3px 3px 6px -2px #48804B;
background-image: url("http://placehold.it/147x147");
background-repeat: no-repeat;
background-size: 90%;
background-position: center;
}
.desc{
padding: 45px 0 20px 0;
h5,p{
text-align: center;
}
}
.twitter-button{
max-width: 204px;
height: 43px;
background-color: $theme2-color;
margin: 0 auto;
border-radius: 2px;
.fa-twitter{
font-size: 35px;
color: white;
}
}
}
}
}
First of all, rows should be INSIDE containers.
But your real problem is setting a max-width here:
.profiles{max-width: 230px;}
You're not letting the columns expand to their natural width.
This div:
<div class="container">
should be the one holding:
<div class="row">
The correct way, for example:
<div class="container">
<div class="row">
<div class="title col-xs-12">
<h2>Smart & Creative</h2>
<p>This is why you will use it :)</p>
</div>
</div>
</div>
.team .profile-wrapper .profiles {
max-width: 230px;
}
Is making column width smaller then it should be.
I have created code-pan for you please check
http://codepen.io/payalpatel2299/pen/MbRwxo

Equal height and width boxes in Bootstrap?

I am trying to make the bottom right greyish box (the one without image) same height and width as other boxes with images. It is supposed to be responsive but if I manage to make it fit this resolution it doesn't work in other resolutions. I tried with flexbox but couldn't make it work. I am using Bootstrap as you can see. I also tried using vh and vw but no luck...
I would really appreciate if someone with more experience could tell me the proper way to do this? Thanks all for reading and trying to help!
Here is the screenshot of what I am trying to achieve:
Here is my code so far:
<!-- T E A M S E C T I O N -->
<section id="team" class="no-padding">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<h1><span class="orange">[ </span>Meet Our Team<span class="orange"> ]</span></h1>
<p>A perfect blend of creativity and technical wizardry.</br>The best people formula for great websites!</p>
</div>
</div>
<div class="row no-gutter">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/1.jpg" title="">
<img src="img/team/1.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/2.jpg" title="">
<img src="img/team/2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/3.jpg" title="">
<img src="img/team/3.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/4.jpg" title="">
<img src="img/team/4.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/5.jpg" title="">
<img src="img/team/5.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/6.jpg" title="">
<img src="img/team/6.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/7.jpg" title="">
<img src="img/team/7.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/8.jpg" title="">
<img src="img/team/8.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<div class="team-box">
<div class="team-box-last">
<h3>Want to join our team?</h3>
<p>We’re always looking for talented designers, developers, project managers and anyone who’s driven and has a passion for the digital industries.
</p>
<ul>
<li>Check our jobs page</li>
<li>Send us your CV</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
/* -------- TEAM SECTION -------- */
#team{
background-color: #fff;
text-align: center;
width: 100%;
}
#team h1{
color: #345;
font-weight: 700;
margin-top: 50px;
margin-bottom: 50px;
}
#team p{
color: #345;
font-size: 21px;
margin-top: 0px;
margin-bottom: 50px;
padding-left: 15px;
padding-right: 15px;
}
.no-padding {
padding: 0;
}
.no-gutter > [class*=col-] {
padding-right: 0;
padding-left: 0;
}
.team-box {
display: block;
position: relative;
margin: 0 auto;
max-width: 650px;
overflow: hidden;
}
.team-box img{
-moz-transition: all 1s;
-webkit-transition: all 1s;
transition: all 1s;
}
.team-box:hover img {
-moz-transform: scale(1.1);
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
.team-box .team-box-caption {
display: block;
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
text-align: center;
color: #fff;
opacity: 1;
background: transparent;
/* background: rgba(67,208,243,0.9);
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s; */
}
.team-box .team-box-caption .team-box-caption-content {
position: absolute;
bottom: 12px;
width: 100%;
text-align: left;
}
.team-box .team-box-caption .team-box-caption-content .name,
.team-box .team-box-caption .team-box-caption-content .position {
padding: 0 15px;
text-shadow: 0px 0px 5px #000;
}
.team-box .team-box-caption .team-box-caption-content .name {
text-transform: uppercase;
font-size: 12px;
font-weight: 700;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 12px;
text-transform: uppercase;
}
.team-box:hover .team-box-caption {
opacity: 1;
}
#media(min-width:768px) {
.team-box .team-box-caption .team-box-caption-content .name {
font-size: 15px;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 15px;
text-transform: uppercase;
}
}
.team-box-last{
text-align: left;
padding: 30px 30px;
}
.team-box:last-child{
background-color: #f3f3f3;
}
#team .team-box-last h3{
color: #345;
padding-top: 15px;
padding-left: 15px;
}
#team .team-box-last p{
font-size: 18px;
line-height: 23px;
padding-top: 15px;
margin-bottom: 30px;
}
#team .team-box-last ul{
padding-left: 15px;
}
#team .team-box-last ul li{
font-size: 18px;
font-weight: 500;
}
#team .team-box-last ul li{
list-style: none;
}
Well, you cannot really achieve this with CSS, you may add some Javascript code using jQuery to make it easier for you.
I am giving you an example just have a look to get an idea. The idea is to get the height of each image box which I have assigned id="getheight" and then add that height to the last box. Remember you need to use overflow:hidden if you want to see same height. I have altered your code and add some class and javascript to give you what you can do.
The problem in responsiveness in the last box is you need to also handle font-size or other stuff to make sure it always appears and perfect which I haven't touched that yet. However, you can still have scrollbar for longer text if you want.
All in all, this is one approach to solve your problem, there maybe more ways if spend more time.
** Please copy and see in bigger screen for responsiveness as well we watch console to see dynamic height. ***
var picHeight = $('#getheight').height();
$('.sameHeight').css('height',picHeight + 'px');
$('.team-box-last').css('height',picHeight + 'px')
$(window).on('resize',function(){
var picHeight = $('#getheight').height();
$('.sameHeight').css('max-height',picHeight + 'px');
})
/* -------- TEAM SECTION -------- */
#team{
background-color: #fff;
text-align: center;
width: 100%;
}
#team h1{
color: #345;
font-weight: 700;
margin-top: 50px;
margin-bottom: 50px;
}
#team p{
color: #345;
font-size: 21px;
margin-top: 0px;
margin-bottom: 50px;
padding-left: 15px;
padding-right: 15px;
}
.no-padding {
padding: 0;
}
.no-gutter > [class*=col-] {
padding-right: 0;
padding-left: 0;
}
.team-box {
display: block;
position: relative;
margin: 0 auto;
max-width: 650px;
overflow: hidden;
}
.team-box img{
-moz-transition: all 1s;
-webkit-transition: all 1s;
transition: all 1s;
}
.team-box:hover img {
-moz-transform: scale(1.1);
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
.team-box .team-box-caption {
display: block;
position: absolute;
bottom: 0;
width: 100%;
height: 100%;
text-align: center;
color: #fff;
opacity: 1;
background: transparent;
/* background: rgba(67,208,243,0.9);
-webkit-transition: all .35s;
-moz-transition: all .35s;
transition: all .35s; */
}
.team-box .team-box-caption .team-box-caption-content {
position: absolute;
bottom: 12px;
width: 100%;
text-align: left;
}
.team-box .team-box-caption .team-box-caption-content .name,
.team-box .team-box-caption .team-box-caption-content .position {
padding: 0 15px;
text-shadow: 0px 0px 5px #000;
}
.team-box .team-box-caption .team-box-caption-content .name {
text-transform: uppercase;
font-size: 12px;
font-weight: 700;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 12px;
text-transform: uppercase;
}
.team-box:hover .team-box-caption {
opacity: 1;
}
#media(min-width:768px) {
.team-box .team-box-caption .team-box-caption-content .name {
font-size: 15px;
}
.team-box .team-box-caption .team-box-caption-content .position {
font-size: 15px;
text-transform: uppercase;
}
}
.sameHeight{
overflow:hidden;
}
.team-box-last{
text-align: left;
overflow:auto;
padding:30px 30px;
}
.team-box:last-child{
background-color: #f3f3f3;
}
#team .team-box-last h3{
color: #345;
padding-left: 15px;
}
#team .team-box-last p{
font-size: 18px;
line-height: 23px;
padding-top: 15px;
margin-bottom: 30px;
}
#team .team-box-last ul{
padding-left: 15px;
}
#team .team-box-last ul li{
font-size: 18px;
font-weight: 500;
}
#team .team-box-last ul li{
list-style: none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- T E A M S E C T I O N -->
<section id="team" class="no-padding">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
<h1><span class="orange">[ </span>Meet Our Team<span class="orange"> ]</span></h1>
<p>A perfect blend of creativity and technical wizardry.</br>The best people formula for great websites!</p>
</div>
</div>
<div class="row no-gutter">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4" id="getheight" >
<a class="team-box" rel="" href="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/2.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/3.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/4.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/5.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/6.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/7.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
<a class="team-box" rel="" href="img/team/8.jpg" title="">
<img src="https://free4kwallpapers.com/uploads/originals/2015/07/13/natur-hintergrundbilder-09-2012-269-2.jpg" class="img-responsive" alt="">
<div class="team-box-caption">
<div class="team-box-caption-content">
<div class="name">
Full Name
</div>
<div class="position">
Position
</div>
</div>
</div>
</a>
</div>
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 sameHeight">
<div class="team-box">
<div class="team-box-last">
<div class="t">
<h3>Want to join our team?</h3>
<p>We’re always looking for talented designers, developers, project managers and anyone who’s driven and has a passion for the digital industries.
</p>
<ul>
<li>Check our jobs page</li>
<li>Send us your CV</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<br/>
<br/>
<br/>
<br/><br/>
<br/>
<br/>
<br/>
<br/>
I also included resize option to tell how you can handle automatic height size.
Please feel free to change my code and make that nice and compatible with your requirement.