For my portfolio site I am making I have it so when you hover over the portfolio image it overlays the title and category. My problem is the overlay section is picking up the margin and padding for the spacing of the images in the grid. I cant get it to be whatever the portfolio image size is without removing the gutter between the images.
Example below:
Not sure how to fix this and any help would be appreciated.
.thumbnail {
padding: 0px !important;
margin-bottom: 25px;
border: none;
border-radius: 0;
display: block;
}
.thumbnail img {
width: 100%;
height: 100%;
margin-bottom: 0px;
display: block;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
padding: 0px 0px 0px 0px;
transition: .5s ease;
background-color: rgba(136, 24, 38, 0.6);
}
.thumbnail:hover .overlay {
opacity: 1;
height: 100%;
width: 100%;
}
.text {
color: white;
font-size: 20px;
position: absolute;
width: 70%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
<section id="work" class="bg-grey">
<div class="container-fluid text-center">
<h2>MY WORK</h2>
<!--<h4>What we have created</h4>-->
<div class="row text-center">
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="http://www.google.com/">
<div class="thumbnail">
<img src="images/portfolio-img1.jpg" alt="PORTFOLIO NAME">
<div class="overlay">
<div class="text">
<h4>PORTFOLIO NAME</h4>
<p>category</p>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="http://www.google.com/">
<div class="thumbnail">
<img src="images/portfolio-img1.jpg" alt="PORTFOLIO NAME">
<div class="overlay">
<div class="text">
<h4>PORTFOLIO NAME</h4>
<p>category</p>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="http://www.google.com/">
<div class="thumbnail">
<img src="images/portfolio-img1.jpg" alt="PORTFOLIO NAME">
<div class="overlay">
<div class="text">
<h4>PORTFOLIO NAME</h4>
<p>category</p>
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</section>
When you use a absolute positioned element, always set the respective relative, position element. Let me know if you have any issues with the output.
The only CSS change is to the below class. Where I have added the property position: relative.
.thumbnail {
padding: 0px !important;
position: relative;
margin-bottom: 25px;
border: none;
border-radius: 0;
display: block;
}
So your absolute positioned div with class overlay will be positioned with respect to the div with class thumbnail
.thumbnail {
padding: 0px !important;
position: relative;
margin-bottom: 25px;
border: none;
border-radius: 0;
display: block;
}
.thumbnail img {
width: 100%;
height: 100%;
margin-bottom: 0px;
display: block;
}
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
padding: 0px 0px 0px 0px;
transition: .5s ease;
background-color: rgba(136, 24, 38, 0.6);
}
.thumbnail:hover .overlay {
opacity: 1;
height: 100%;
width: 100%;
}
.text {
color: white;
font-size: 20px;
position: absolute;
width: 70%;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
<link href="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"/>
<section id="work" class="bg-grey">
<div class="container-fluid text-center">
<h2>MY WORK</h2>
<!--<h4>What we have created</h4>-->
<div class="row text-center">
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="http://www.google.com/">
<div class="thumbnail">
<img src="http://lorempixel.com/100/100/" alt="PORTFOLIO NAME">
<div class="overlay">
<div class="text">
<h4>PORTFOLIO NAME</h4>
<p>category</p>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="http://www.google.com/">
<div class="thumbnail">
<img src="http://lorempixel.com/100/100/" alt="PORTFOLIO NAME">
<div class="overlay">
<div class="text">
<h4>PORTFOLIO NAME</h4>
<p>category</p>
</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<a href="http://www.google.com/">
<div class="thumbnail">
<img src="http://lorempixel.com/100/100/" alt="PORTFOLIO NAME">
<div class="overlay">
<div class="text">
<h4>PORTFOLIO NAME</h4>
<p>category</p>
</div>
</div>
</div>
</a>
</div>
</div>
</div>
</section>
Related
I have a simple HTML site with CSS going, but i noticed a very very small line next to all my uploaded images that i use for links. I'm guessing that this is like a direction to img position, but it is so small that i can't actually see what it is. Anyone know what it is and how i get rid of it???
Picture or it didn't happen
the 4 images, with 1 working and 3 displaying the thingy
body {
background-image: url("Baggrund.png");
}
.title {
font-family: sans-serif;
color: #2E2E2E;
font-size: 50px;
margin-top: 100px;
font-weight: 1000;
}
.container {
position: relative;
width: 200px;
height: 200px;
display: inline-block;
margin-left: 50px;
margin-top: 50px;
}
.image {
display: block;
width: 200px;
height: 200px;
}
.text {
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: sans-serif;
}
.overlayFade {
height: 100%;
width: 100%;
top: 0;
left: 0;
}
.overlay {
position: absolute;
opacity: 0;
transition: all .3s ease;
background-color: #008cba;
}
.container:hover .overlay,
.container:hover .overlayFade {
opacity: 1;
}
<div align="center">
<div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="Tips" class="image">
<div class="overlay overlayFade">
<div class="text">QGIS Tips & Tricks</div>
</div>
</div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="KortInfo" class="image">
<div class="overlay overlayFade">
<div class="text">KortInfo</div>
</div>
</div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="Metadata" class="image">
<div class="overlay overlayFade">
<div class="text">Metadatabasen</div>
</div>
</div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="A-Z" class="image">
<div class="overlay overlayFade">
<div class="text">A-Z</div>
</div>
</div>
</div>
That is the underline that is present default in the anchor tag i just used text-decoration: none on the anchor tag and it is gone
I hope this is what you are looking for
body {
background-image: url("Baggrund.png");
}
.title {
font-family: sans-serif;
color: #2E2E2E;
font-size: 50px;
margin-top: 100px;
font-weight: 1000;
}
a
{
text-decoration:none;
}
.container {
position: relative;
width: 200px;
height: 200px;
display: inline-block;
margin-left: 50px;
margin-top: 50px;
}
.image {
display: block;
width: 200px;
height: 200px;
}
.text {
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-family: sans-serif;
}
.overlayFade {
height: 100%;
width: 100%;
top: 0;
left: 0;
}
.overlay {
position: absolute;
opacity: 0;
transition: all .3s ease;
background-color: #008cba;
}
.container:hover .overlay,
.container:hover .overlayFade {
opacity: 1;
}
<div align="center">
<div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="Tips" class="image">
<div class="overlay overlayFade">
<div class="text">QGIS Tips & Tricks</div>
</div>
</div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="KortInfo" class="image">
<div class="overlay overlayFade">
<div class="text">KortInfo</div>
</div>
</div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="Metadata" class="image">
<div class="overlay overlayFade">
<div class="text">Metadatabasen</div>
</div>
</div>
<div class="container">
<a href="randomsite.com" </a>
<img src="https://dummyimage.com/300x300/3939de/fff" alt="A-Z" class="image">
<div class="overlay overlayFade">
<div class="text">A-Z</div>
</div>
</div>
</div>
I have an all css and bootstrap hover effect, the overlay tags are all encased in a div class but all of them hover at the same time. all three have separate bootstrap grids and the effect even extends to the empty space in between the photos. any help would be appreciated thank you.
HTML:
<div class="container">
<div class="row">
<div class="col-md-12 text-align-center">
<h2 class="bold_font">BROWSE OUR CARDS</h2><br>
</div>
<div class="col-md-4 col-xs-12">
<a href="cards/list.php?tn=beauty">
<img class="img-responsive" src="img/_stock_mwc_beauty.jpg">
<div class="overlay">
<div class="overlay-content">
<img src="img/icon-beauty-white.png" class="img-responsive center-block">
<div class="spacer overlay-text">BEAUTY</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-xs-12">
<a href="cards/list.php?tn=health">
<img class="img-responsive" src="img/_stock_mwc_health.jpg">
<div class="overlay">
<div class="overlay-content">
<img src="img/icon-health-white.png" class="img-responsive center-block">
<div class="spacer overlay-text">HEALTH</div>
</div>
</div>
</a>
</div>
<div class="col-md-4 col-xs-12">
<a href="cards/list.php?tn=wellness">
<img class="img-responsive" src="img/_stock_mwc_wellness.jpg">
<div class="overlay">
<div class="overlay-content">
<img src="img/icon-wellness-white.png" class="img-responsive center-block">
<div class="spacer overlay-text">WELLNESS</div>
</div>
</div>
</a>
</div>
</div>
</div>
CSS:
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
height: 100%;
width: 100%;
opacity: 0;
transition: .5s ease;
background-color: #f08300;
}
.container:hover .overlay {
opacity: 1;
}
.overlay-content {
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
}
.spacer {
margin: 20px 0px 20px 0px;
}
here is my js fiddle for more info, i just added random placeholder images: http://jsfiddle.net/cnkgqhdw/1/
Don't do the hover on the container, do it on the columns! Just change .container:hover to .col-md-4:hover.
To keep the space correct, you can use bootstrap own spacing system. In your case, you can put a default margin around by adding the class mx-3 to the overlay element.
.overlay {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: 0;
transition: .5s ease;
background-color: #f3a64c;
}
.col-md-4:hover .overlay {
opacity: 1;
}
.overlay-content {
color: white;
font-size: 30px;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
}
.exact-center {
text-align: center;
vertical-align: middle;
}
.spacer {
margin: 20px 0px 20px 0px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-md-12 text-align-center">
<h2 class="bold_font">BROWSE OUR CARDS</h2><br>
</div>
<div class="col-md-4 col-xs-12">
<img class="img-responsive" src="img/_stock_mwc_beauty.jpg">
<div class="overlay mx-3">
<div class="overlay-content">
<img src="img/icon-beauty-white.png" class="img-responsive center-block">
<div class="spacer overlay-text">BEAUTY</div>
</div>
</div>
</div>
<div class="col-md-4 col-xs-12">
<img class="img-responsive" src="img/_stock_mwc_health.jpg">
<div class="overlay mx-3">
<div class="overlay-content">
<img src="img/icon-health-white.png" class="img-responsive center-block">
<div class="spacer overlay-text">HEALTH</div>
</div>
</div>
</div>
<div class="col-md-4 col-xs-12">
<img class="img-responsive" src="img/_stock_mwc_wellness.jpg">
<div class="overlay mx-3">
<div class="overlay-content px-3">
<img src="img/icon-wellness-white.png" class="img-responsive center-block">
<div class="spacer overlay-text">WELLNESS</div>
</div>
</div>
</div>
</div>
</div>
You have it setup to :hover on the .container element, which is the entire row. Need to add a class to your card and do .card:hover
You are hovering on the whole container. So that's why everything gets the hover state.
You should add a class to the
<a class="item" href="">
and hover that:
.item:hover {
//styling here
}
I am working on a personal design project where I have 5 tiles with images in them and when you mouse over any of them they display alternate text. I have included my source code but my problem seems to be when I test this by hovering over the tile I added the W3 snippet to nothing happens. If I inspect the code however and add the hover attribute in the Chrome inspect tool it seems to work just fine. What am I missing here?
Here is my code My Code
.bottom p {
text-align: center;
}
.bottom {
margin-top: 200px;
width: 50%;
}
.top {
width: 33.33333333333%;
display: inline-block;
}
.tile {
height: 200px;
justify-content: center;
align-items: center;
overflow: hidden;
padding-left: 0px;
padding-right: 0px;
border-style: solid;
border-width: 5px;
border-color: /*Navy Blue*/ #333333/* FetchMe Orange #FBAA1E*/;
text-align: center;
box-shadow: 5px 5px 10px #000000;
}
.tile p {
z-index: 4;
font-size: 24px;
position: absolute;
bottom: 0;
margin-bottom: 10px;
font-weight: bold;
text-align: center;
margin-left: 35%;
margin-right: 35%;
}
.img1 {
flex-shrink: 0;
min-width: 100%;
min-height: 100%
}
.top p {
text-align: center;
}
.fetch-form {
padding-top: 50px;
padding-bottom: 50px;
margin: 0 auto;
position: absolute;
z-index: 3;
margin-left: 110px;
margin-right: 110px;
left: 0;
right: 0;
}
.tiles {
margin-left: 0px;
margin-right: 0px;
z-index: 2;
position: absolute;
top: 150px;
left: 0px;
color: white;
display: inline-block;
padding-top: 10px;
}
.inner {
display: block;
margin-left: auto;
margin-right: auto;
}
.slider {
z-index: -1;
position: absolute;
padding-right: 0;
padding-left: 0;
margin-right: 0;
margin-left: 0;
left: 0;
right: 0;
top: 0;
height: 600px;
min-width: 100%;
}
.item {
height: 600px;
}
.container {
position: relative;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #008CBA;
overflow: hidden;
width: 0%;
height: 100%;
transition: .5s ease;
z-index: 5;
}
.container:hover .overlay {
width: 100%;
}
.text {
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
overflow: hidden;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.image {
display: block;
width: 100%;
height: auto;
}
<div class="row">
<div class="col-xs-10 fetch-form">
<form action="order" method="POST" role="form" id="address_form">
<div class="col-xs-12 fetch-form">
<div class="row">
<div class="col-xs-8 input">
<div class="input">
<i class="icon-prepend fa fa-home"></i>
<input type="text" placeholder="Street Address (optional)" id="address" name="address" class="form-control input-lg" autocomplete="off">
</div>
</div>
<div class="col-xs-2">
<input type="hidden" name="zip_code"><input type="hidden" value="true" name="set_temp_address">
<button class="btn btn-primary btn-lg btn-block btn" type="submit">
<i class="fa fa-search"></i> Fetch Me Food!
</button>
</div>
</div>
</div>
<div class="row well well-sm" style="display: none;">
<div class="col-xs-4 text-center">
<div class="radio" >
<label><center><i class="fa fa-taxi fa-lg hidden-xs"> </i></center>
<input type="radio" id="type_delivery" name="order_type" value="DELIVERY" checked="checked">
<span class="radiosearch"> </span><span class="ordertype">Delivery</span>
</label>
</div>
</div>
<div class="col-xs-4 text-center border-left">
<div class="radio">
<label>
<center><i class="fa fa-cutlery fa-lg hidden-xs"> </i></center>
<input type="radio" id="type_takeout" name="order_type" value="TAKEOUT">
<span class="radiosearch"> </span>
<span class="ordertype"><nobr>Pick-up</nobr></span>
<nobr></nobr>
</label>
</div>
</div>
<div class="col-xs-4 text-center border-left" >
<div class="radio"><a href="/account/groups" style="color: #333333;">
<label>
<center><i class="fa fa-group fa-lg" style="margin-bottom: 6px;"> </i></center>
<span class="ordertype"><span style="margin-top:9px;" class="visible-xs">Group »</span></span> <span
class="ordertype"><span class="hidden-xs">Group Order »</span></span> </label></a></div>
</div>
</div>
</form>
</div>
<div class="col-xs-12 tiles">
<div class="inner">
<div class="col-xs-3 top tile container">
<p>Restarunts and Catering</p>
<img src="https://s3.amazonaws.com/fetchme-prototype/images/fruits-grocery-bananas-market.jpg" class="img1 image" alt="">
<div class="overlay">
<div class="text">Hello World</div>
</div>
</div>
</div>
<div class="col-xs-3 top tile">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/fruits-grocery-bananas-market.jpg" class="img1" alt="">
<p>Our Deals</p>
</div>
<div class="col-xs-3 top tile">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/fruits-grocery-bananas-market.jpg" class="img1" alt="">
<p>Grocery Shopping</p>
</div>
</div>
</div>
<br>
<div class="col-xs-12 tiles">
<div class="inner">
<div class="col-xs-6 bottom tile">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/fruits-grocery-bananas-market.jpg" alt="" class="img1" >
<p>Tailgates</p>
</div>
<div class="col-xs-6 bottom tile">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/fruits-grocery-bananas-market.jpg" alt="" class="img1">
<p>Order Anything</p>
</div>
</div>
</div>
<div class="slider col-xs-12">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<!-- Slide one -->
<div class="item active">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/download.jpg" alt="">
</div>
<!-- Slide two -->
<div class="item">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/download.jpg" alt="">
</div>
<!--Slide three -->
<div class="item">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/download+(2).jpg" alt="">
</div>
<!--Slide four -->
<div class="item">
<img src="https://s3.amazonaws.com/fetchme-prototype/images/download+(2).jpg" alt="">
</div>
</div>
</div>
</div>
</div>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
This is an issue with other tiles overlapping the containers (z-index issue). You can try something like this:
.tiles {
pointer-events: none;
}
.container {
pointer-events: auto;
}
It is because you have used .tiles class for both .col-xs-12 items which are supposed to be 2 rows of pictures.
.tiles class has top, left properties defined and are position property as absolute. Since both rows of pictures have same top and left positions from .tiles, the second one overlaps the first.
This is why hover will never happen for .container normally. hover is always happening for the second row which is on top even though 1st row is visible below.
I tried to fix this problem multiple times but it still occurs, I just can't find the right fix.
I cannot create gutter around columns in Bootstrap 3. Here's my Fiddle: jsfiddle.net/creuxttL
My exact problem: When I create these three columns, I expect some gutter to be between them, so they don't look like one big brick. I don't get any gutter by default, so I tried to do it manually - with css class .col . I still don't get any margin/padding around the boxes. What should I do?
You're fiddle does not have bootstrap 3 included. http://jsfiddle.net/va94exo2/ is a slight modification.
Have wrapped all of your col-md-4 content with an inner div and changed the ID="row" to class and removed your extra .col class, have also then styled the inner div.
.inner-content{
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: white;
text-align: center;
background-color: #00b9ff;
border: 1px solid black;
}
.overlay-pic {
max-height: 200px;
display: block;
margin: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #44cbff;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
.overlay p {
font-family: 'Raleway';
font-style: italic;
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.col {
/*gutter*/
padding-right: 7px;
padding-left: 7px;
}
.col:not(:first-child, :last-child) {
padding-right: 7px;
padding-left: 7px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row" style="margin-top: 10px;">
<div class="col-md-4">
<div class="inner-content">
<h1>Festival 2001</h1>
<img src="event.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Our event.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="inner-content">
<h1>Who are we?</h1>
<img src="question.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Read more about us</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="inner-content">
<h1>where, when?</h1>
<img src="calendar.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Look at our calendar.</p>
</div>
</div>
</div>
</div>
</div>
Not positive this is exactly what you're looking for but if you just want space between the rows you can add a "margin-top" attribute to your css in the ".col-md-4" class.
Hope this helps.
.col-md-4 {
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: white;
text-align: center;
background-color: #00b9ff;
border: 1px solid black;
margin-top:10px;
}
.overlay-pic {
max-height: 200px;
display: block;
margin: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #44cbff;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
.overlay p {
font-family: 'Raleway';
font-style: italic;
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.col {
/*gutter*/
padding-right: 7px;
padding-left: 7px;
}
.col:not(:first-child, :last-child) {
padding-right: 7px;
padding-left: 7px;
}
<div class="container">
<div id="row" style="margin-top: 10px;">
<div class="col-md-4 col">
<h1>Festival 2001</h1>
<img src="event.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Our event.</p>
</div>
</div>
<div class="col-md-4 col">
<h1>Who are we?</h1>
<img src="question.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Read more about us</p>
</div>
</div>
<div class="col-md-4 col">
<h1>where, when?</h1>
<img src="calendar.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Look at our calendar.</p>
</div>
</div>
</div>
</div>
Bootstrap is not added. I modified your code. And I hope you are expecting this.
.col {
font-family: 'Roboto', sans-serif;
font-weight: 100;
color: white;
text-align: center;
background-color: white;
}
.overlay-pic {
max-height: 200px;
display: block;
margin: auto;
}
.overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: #44cbff;
overflow: hidden;
width: 100%;
height: 0;
transition: .5s ease;
}
.overlay p {
font-family: 'Raleway';
font-style: italic;
white-space: nowrap;
color: white;
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
}
.col h1{
margin-top:0px;
}
<div class="container">
<div id="row">
<div class="col-md-4 col">
<div style="margin:5px; background:#00b9ff;border: 1px solid black;">
<h1>Festival 2001</h1>
<img src="event.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Our event.</p>
</div>
</div>
</div>
<div class="col-md-4 col">
<div style="margin:5px; background:#00b9ff;border: 1px solid black;">
<h1>Who are we?</h1>
<img src="question.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Read more about us</p>
</div></div>
</div>
<div class="col-md-4 col">
<div style="margin:5px; background:#00b9ff;border: 1px solid black;">
<h1>where, when?</h1>
<img src="calendar.jpg" class="overlay-pic hidden-tablet img-responsive">
<div class="overlay">
<p>Look at our calendar.</p>
</div>
</div></div>
</div>
</div>
I need some help with bootstrap gutter width, I've tried almost everything and still can't make bigger space/padding between triangles with i want to make much bigger. Tried adding classes etc..
here's clean code
Media
#media only screen and (max-width : 1200px) {
/* Team */
.team-item .team-triangle {
width: 90px;
height: 90px;
}
.team-triangle .content {
width: 160px;
height: 160px;
}
.team-hover i {
margin-top: 50px;
}
.team-hover p {
font-size: 14px;
}
/* Medium Devices, Desktops */
#media only screen and (max-width : 992px) {
/* Team */
.team-item .team-triangle {
width: 120px;
height: 120px;
}
.team-triangle .content {
width: 190px;
height: 190px;
}
.team-hover i {
margin-top: 57px;
}
#team-section .col-md-2:nth-child(7n+5),
#team-section .col-md-2:nth-child(7n+1){
margin-left: 0 !important;
clear: none !important;
}
#team-section .col-md-2 {
float: left;
margin-bottom: 80px;
width: 33.3333%;
}
HTML
div class="container">
<div class="row">
<div class="team-items">
<div class="col-md-2 col-sm-6">
<div class="team-container wow bounceIn" data-wow-delay="0.2s">
<div class="team-item">
<div class="team-triangle">
<div class="content">
<img src="img/team/1.jpg" alt="title" />
<div class="team-hover text-center">
<a class="overlay" href="#"></a>
<i class="fa fa-male"></i>
<p>Plalalal</a></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2 col-sm-6">
<div class="team-container wow bounceIn" data-wow-delay="0.3s">
<div class="team-item">
<div class="team-triangle">
<div class="content">
<img src="img/team/1.jpg" alt="title"/>
<div class="team-hover text-center">
<i class="fa fa-female"></i>
<p>Jane Doe</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2 col-sm-6">
<div class="team-container wow bounceIn" data-wow-delay="0.4s">
<div class="team-item">
<div class="team-triangle">
<div class="content">
<img src="img/team/1.jpg" alt="title"/>
<div class="team-hover text-center">
<i class="fa fa-male"></i>
<p>John Doe</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2 col-sm-6">
<div class="team-container wow bounceIn" data-wow-delay="0.5s">
<div class="team-item">
<div class="team-triangle">
<div class="content">
<img src="img/team/1.jpg" alt="title"/>
<div class="team-hover text-center">
<i class="fa fa-male"></i>
<p>John Doe</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-2 col-sm-6">
<a class="overlay" href="#"></a>
<div class="team-container wow bounceIn" data-wow-delay="0.6s">
<div class="team-item">
<div class="team-triangle">
<div class="content">
<img src="img/team/1.jpg" alt="title"/>
<div class="team-hover text-center">
<i class="fa fa-male"></i>
<p>John Doe</p>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
/* ===== Begin team ===== */
.team-item {
height: 130px;
}
.team-item .team-triangle {
width: 130px;
height: 130px;
background: transparent;
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
margin: 0 auto;
position: relative;
top: 25px;
box-shadow: 0 0 0 6px #FFFFFF, 0 0 0 7px #dadbdb;
overflow: hidden;
}
.team-item img {
max-width: 100%;
}
.team-items {
margin-bottom: 50px;
padding-top: 0px;
margin-top: 0;
}
.team-triangle .content {
-ms-transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
top: -35px;
position: absolute;
left: -37px;
width: 190px;
height: 190px;
}
.team-hover {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba( 103, 109, 117, 0.9);
opacity: 0;
-webkit-transition: opacity 0.4s ease-in; /* For Safari 3.1 to 6.0 */
transition: opacity 0.4s ease-in;
}
.team-item .team-triangle:hover .team-hover {
opacity: 1;
}
.team-hover i {
color: rgba(255, 255, 255,.75);
font-size: 28px;
margin-top: 57px;
position: relative;
}
.team-hover p {
color: #ffffff;
font-size: 16px;
font-weight: 400;
margin-top: 0;
}
.team-items .col-md-2:nth-child(7n+5) {
clear: left;
margin-left: 24.9999999%;
}
.team-items .col-md-2:nth-child(7n+1) {
clear: left;
margin-left: 16.6666666%;
}
/* ===== End team ===== */
Maybe you want something like this.
.large-gutter > [class*='col-'] {
padding-right:50px;
padding-left:50px;
}
HTML
<div class="row large-gutter">
<div class="col-md-4">
...
</div>
<div class="col-md-4">
...
</div>
<div class="col-md-4">
...
</div>
</div>