Good day! I'm having a struggle to aligned the jumbtron to my calendar icon. And the elements of the jumbtron is not inside of it. Can someone help me how to solve this? Ideas? i just started studying bootstrap and css.
Here's the picture.
here is my html code.
<div class="events">
<div class="container">
<div class="row">
<div class= "col-sm-4 col-xs-25">
<h4 id="event"><i class="fa fa-calendar" aria-hidden="true"></i> Upcoming Events</h4>
<hr class="carved">
<div class="date">
<span class="month">August</span>
<h1 class="day">28</h1>
</div>
<div class="container">
<div class="jumbotron">
<h4>Sample Title</h4>
<p>IT Thesis defense</p>
<h6>7:00 AM - 8:00 PM</h6>
</div>
</div>
<hr class="divider">
<div class="date">
<span class="month">August</span>
<h1 class="day">28</h1>
</div>
<hr class="divider">
<div class="date">
<span class="month">August</span>
<h1 class="day">28</h1>
</div>
</div>
<div class= "col-sm-8 col-xs-25">
<h4 id="event"><i class="fa fa-newspaper-o" aria-hidden="true"></i> Latest News</h4>
<hr class="carved">
</div>
</div>
</div>
</div>
here is my css
#event {
color: #a92419;
}
hr.carved {
clear: both;
float: none;
width: 100%;
height: 2px;
border: none;
background: #ddd;
background-image: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0.5, rgb(126,27,18)),
color-stop(0.5, rgb(211,45,31))
);
background-image: -moz-linear-gradient(
center top,
rgb(126,27,18) 50%,
rgb(211,45,31) 50%
);
}
.date {
display: block;
width: 60px;
height: 60px;
margin-bottom: 20px;
background: #fff;
text-align: center;
font-family: 'Helvetica', sans-serif;
position: relative;
}
.date .month {
background: #a92419;
display: block;
padding-bottom: 5px;
padding-top: 5px;
color: #fff;
font-size: 10px;
font-weight: bold;
border-bottom: 2px solid #a92419;
box-shadow: inset 0 -1px 0 0 #a92419;
}
.date .day {
display: block;
margin: 0;
padding-bottom: 10px;
padding-top: 5px;
text-align: center;
font-size: 20px;
color:#a92419;
box-shadow: 0 0 3px #ccc;
position: relative;
}
.date .day::after {
content: '';
display: block;
height: 95%;
width: 96%;
position: absolute;
top: 3px;
left: 2%;
z-index: -1;
box-shadow: 0 0 3px #ccc;
}
.date .day::before {
content: '';
display: block;
height: 90%;
width: 90%;
position: absolute;
top: 6px;
left: 5%;
z-index: -1;
}
.jumbotron {
width: 300px;
height: 100px;
margin:none;
}
.jumbotron p {
font-size:12px;
}
The .container class carries its own width(s) and is intended to be used as a outer wrapper for your layout. Because of this, they do not tend to nest well. The one you have as a sibling of your .date classed elements is breaking the layout.
As for the spacing of the .jumbotron contents, Bootstrap assigns some pretty dramatic padding to that class by default. Consider overwriting that with your own values in your .jumbotron rule. The other issue — the .jumbotron contents bleeding out of their container — that is a result of the height: 100px you are setting. You can stop the contents from taking up space beyond the boundaries of the .jumbotron by adding/modifying its overflow property. This may be a matter of opinion but I think it is usually better to avoid setting height in the CSS and let the contents define the size of the container — especially in cases where the content is CMS/client driven.
If you remove the .container, you’ll still have the problem of the .date and .jumbotron stacking vertically. To address that, you might consider treating Date element as .row with a column for your .date element, and a column for that Date’s event(s).
<hr class="carved">
<div class=“row”><!-- the Date wrapper -->
<div class="col-sm-4">
<div class="date">
<span class="month">August</span>
<h1 class="day">28</h1>
</div>
</div>
<div class="col-sm-8"><!-- this column holds all the Events for this Date -->
<div class="jumbotron">
<h4>Sample Title</h4>
<p>IT Thesis defense</p>
<h6>7:00 AM - 8:00 PM</h6>
</div>
</div>
</div>
Note: The new structure will require a bit of adjustment to some of your CSS width properties, and the col- device/sizes I put on the Date and Event columns are just examples — size as needed.
<div class="container">
<div class="row">
<div class="col-md-2">
<h4 id="event"><i class="fa fa-calendar" aria-hidden="true"></i> Upcoming Events</h4>
<hr class="carved">
<div class="date">
<span class="month">August</span>
<h1 class="day">28</h1>
</div><!-- date -->
</div><!-- md2 -->
<div class="col-md-10">
<h4 id="event"><i class="fa fa-newspaper-o" aria-hidden="true"></i> Latest News</h4>
<hr class="carved">
<div class="jumbotron">
<h4>Sample Title</h4>
<p>IT Thesis defense</p>
<h6>7:00 AM - 8:00 PM</h6>
</div><!-- jumbo -->
</div><!-- md10 -->
</div><!-row>
</div><!-- container -->
+
#event {
color: #a92419;
}
hr.carved {
clear: both;
float: none;
width: 100%;
height: 2px;
border: none;
background: #ddd;
background-image: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0.5, rgb(126,27,18)),
color-stop(0.5, rgb(211,45,31))
);
background-image: -moz-linear-gradient(
center top,
rgb(126,27,18) 50%,
rgb(211,45,31) 50%
);
}
.date {
display: block;
width: 60px;
height: 60px;
margin-bottom: 20px;
background: #fff;
text-align: center;
font-family: 'Helvetica', sans-serif;
position: relative;
}
.date .month {
background: #a92419;
display: block;
padding-bottom: 5px;
padding-top: 5px;
color: #fff;
font-size: 10px;
font-weight: bold;
border-bottom: 2px solid #a92419;
box-shadow: inset 0 -1px 0 0 #a92419;
}
.date .day {
display: block;
margin: 0;
padding-bottom: 10px;
padding-top: 5px;
text-align: center;
font-size: 20px;
color:#a92419;
box-shadow: 0 0 3px #ccc;
position: relative;
}
.date .day::after {
content: '';
display: block;
height: 95%;
width: 96%;
position: absolute;
top: 3px;
left: 2%;
z-index: -1;
box-shadow: 0 0 3px #ccc;
}
.date .day::before {
content: '';
display: block;
height: 90%;
width: 90%;
position: absolute;
top: 6px;
left: 5%;
z-index: -1;
}
Result
Related
I cannot get my .container{} to encompass all the content on my web page. My lower navigation buttons are sitting outside the container (marked by a 1px black border) and I can't figure out why. I'm not sure where I've went wrong in my CSS or HTML code! Thanks in advance for your help. Here is a link to my CodePen: https://codepen.io/IDCoder/pen/rGWeEE?editors=0100
Here are my code snippets:
<html>
<head>
<title>Ms.Jane Equities Management Corp</title>
</head>
<body>
<div class="container-fluid">
<!-- Top Box -->
<div class="wrap">
<div class="Logos">
<img src="https://s26.postimg.org/iqkxecqnd/Coldwell_Banker-_Logo_RS1.jpg" width="150" height="82"/>
<img src="https://s26.postimg.org/iqkxecqnd/Coldwell_Banker-_Logo_RS1.jpg" width="150" height="82"/> </div>
<div class ="nav wrap">
<!--navigation buttons-->
<ul class="navigation">
<li id="NAV-ONE">LOG IN</li>
<li id="NAV-TWO">BUY A HOME</li>
<li id="NAV-THREE">SELL A HOME</li>
<li id="NAV-FOUR">CONTACT US</li>
</ul>
</div>
</div>
<!-- Middle Box -->
<div class="row two">
<div>
<div class="floater box">
<!--<div class="search box wrap">
<div class="search">
<input type="text" class="searchTerm" placeholder="What are you looking for?">
<button type="submit" class="searchButton">
<i class="fa fa-search"></i>
</button>
</div>
</div>-->
</div>
</div>
</div>
<!-- Bottom Box -->
<div class="row three">
<div class ="nav wrap 2">
<!--navigation buttons-->
<ul class="navigation">
<li id="NAV-A">MY LISTINGS</li>
<li id="NAV-B">COMMUNITIES SERVED</li>
<li id="NAV-C">PROPERTIES</li>
</ul>
</div>
</div>
</div>
</body>
<html>
CSS:
.container-fluid{
border: 1px solid #000000;
max-width: 1600px;
/*overflow: hidden;*/
}
.wrap{
background-color: yellow;
display: inline: flex;
/*overflow: hidden;*/
}
.Logos{
width: 55%;
display: inline-block;
background-color: blue;
}
.nav.wrap{
display: inline-block;
background-color: green;
float: right;
margin-top: 25px;
}
ul.navigation{
font: bold 11px "Helvetica Neue", Helvetica, Arial, sans-serif;
/*text-align center;*/
/*border: 1px solid green;*/
/*overflow: hidden;*/
}
.navigation li {
display: inline-block;
}
.navigation a {
background: #395870;
background: linear-gradient(#49708f, #293f50);
border-right: 1px solid rgba(0, 0, 0, .3);
color: #fff;
padding: 12px 20px;
text-decoration: none;
}
.navigation a:hover {
background: #314b0;
box-shadow: inset 0 0 10px 1px rgba(0, 0, 0, .3);
}
.navigation li:first-child a {
border-radius: 4px 0 0 4px;
}
.navigation li:last-child a {
border-right: 0;
border-radius: 0 4px 4px 0;
}
.row.two{
background-image: url(https://s1.postimg.org/5gvbly4hin/East_Hyde_Park_Chicago_aerial_0470.jpg);
background-position: absolute;
background-size:cover;
background-repeat: no-repeat;
max-width: 1600px;
height: 550px;
margin: auto;
}
.floater.box{
background-color: white;
border-radius: 10px;
opacity: .45;
max-width: 75%;
height: 200px;
position: absolute;
top:50%;
left: 0;
right: 0;
margin: auto;
}
/*.search {
width: 50%;
position: relative
}
.searchTerm {
float: left;
width: 100%;
border: 3px solid #00B4CC;
padding: 5px;
height: 20px;
border-radius: 5px;
outline: none;
color: #9DBFAF;
}
.searchTerm:focus{
color: #00B4CC;
}
.searchButton {
position: absolute;
right: -50px;
width: 40px;
height: 36px;
border: 1px solid #00B4CC;
background: #00B4CC;
text-align: center;
color: #fff;
border-radius: 5px;
cursor: pointer;
font-size: 20px;
}
.search.box.wrap{
width: 30%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
*/
I think your div.nav.wrap is getting pushed down because it's floated and there's no room for it in the container and because it's floated the container doesn't adjust for it. If you remove the float, you'll see the container start to contain it. That's normal float behaviour - elements with float are out of the 'flow' of the document so other elements aren't affected by them.
I'd just add a negative top margin to push it back up. I'd usually do this in rem or depending on how you size the nav height. So your existing .nav.wrap rule would become:
.nav.wrap{
display: inline-block;
background-color: green;
float: right;
margin-top: -35px;
}
This is NetBeans. I have tried to include an external CSS file but when used externally the images all get really enlarged. Whereas my I use the same styling within the html file using internal styling the images are of correct ratio.
body {
width: 100%;
height: 100%;
margin: 0;
}
.header {
background-color: #000;
color: #fff;
border-color: #080808;
min-height: 50px;
border: 1px solid transparent;
}
.inner header {
width: 80%;
margin: auto;
}
.logo {
float: left;
height: 50px;
padding: 15px;
font-size: 20px;
font-weight: bold;
padding-left: 90px;
}
a {
text-decoration: none;
background-color: transparent;
color: #ededed;
}
.header link {
float: right;
font-size: 14px;
height: 50px;
padding: 15px 15px;
font-size: 16px;
font-weight: bold;
}
#su {
float: right;
height: 50px;
padding: 15px 90px;
}
#l {
float: right;
height: 50px;
padding: 15px 0px;
}
.content {
min-height: 600px;
}
.banner-image {
padding-bottom: 50px;
margin-bottom: 20px;
text-align: center;
color: #f8f8f8;
background: url(image/intro-bg_1.jpg) no-repeat center;
background-size: cover;
}
.inner-banner-image {
padding-top: 12%;
width: 80%;
margin: auto;
}
.banner-content {
position: relative;
padding-top: 6%;
padding-bottom: 6%;
overflow: hidden;
margin-bottom: 12%;
background-color: rgba(0, 0, 0, 0.7);
max-width: 660px;
margin-left: 200px;
}
.button {
color: #fff;
background-color: #c9302c;
border-color: #ac2925;
box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
padding: 10px 16px;
font-size: 18px;
border-radius: 6px;
}
.container {
width: 90%;
margin: auto;
overflow: hidden;
}
.items {
width: 30%;
display: block;
padding: 4px;
margin-bottom: 20px;
line-height: 1.42857143;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 4px;
float: left;
margin-left: 1%;
}
.thumbnail {
display: block;
max-width: 100%;
height: auto;
}
.caption {
color: #000;
padding: 0px 10px 10px;
font-weight: bold;
text-align: center;
}
footer {
background-color: #000;
color: #fff;
font-size: 14px;
text-align: center;
}
<html>
<head>
<title>Lifestyle Store</title>
</head>
<body>
<div class="header">
<div class="inner header">
<div class="logo">
Lifestyle Store
</div>
<div class="header link">
<div id="su">
Sign Up
</div>
<div id="l">
Login
</div>
</div>
</div>
</div>
<div class="content">
<div class="banner-image">
<div class="inner-banner-image ">
<div class="banner-content">
<h1>We sell lifestyle</h1>
<p>Flat 40% OFF on premium brands</p>
<form>
Shop Now
</form>
</div>
</div>
</div>
</div>
<div class="container">
<div class="items">
<a href="#">
<img src="image/camera.jpg" class="thumbnail">
<div class="caption">
<h2>Cameras</h2>
<p>Choose among the best from the world</p>
</div>
</a>
</div>
<div class="items">
<a href="#">
<img src="image/watch.jpg" class="thumbnail">
<div class="caption">
<h2>Watches</h2>
<p>Original watches from the best brands</p>
</div>
</a>
</div>
<div class="items">
<a href="#">
<img src="image/shirt.jpg" class="thumbnail">
<div class="caption">
<h2>Shirts</h2>
<p>Our exquisite collection of shirts</p>
</div>
</a>
</div>
</div>
<footer>
<div class="container">
<p>Copyright © Lifestyle Store. All Rights Reserved | Contact Us: +91 90000 00000</p>
</div>
</footer>
</body>
</html>
Have you linked the CSS file correctly in this line? Try dragging and dropping the file directly into the HTML to ensure the location and name is correct.
href="assignment1/public_html/style.css"
Edit:
The current link you have is saying that you have the index.html file outside of the 'assignment1' folder. If you have your HTML file inside 'public_html' then the stylesheet link should be the following.
href="style.css"
I've created a left navigation bar using buttons. I'm trying to reduce the hyperlink area to just the background image. Also, another issue I'm having is the elements overlaying the background image are taking precedence over the hyperlink, so the button is not actually clickable. Page for reference
http://www.auburn.edu/administration/facilities/home-page/index.html
Hyperlink area
Here's the background image area
.img-responsive {
display: block;
padding: 0;
margin: 0;
}
.background:hover .head {
color: #d76e08;
}
.overlay {
position: absolute;
z-index: 1;
top: 0;
left: 0;
color: white;
}
.icon {
padding-top: 15px;
padding-left: 40px;
}
.head {
margin-top: -75px;
padding-left: 120px;
}
.content {
margin-top: -5px;
padding-left: 120px;
padding-right: 35px;
}
<div class="row">
<div class="col-sm-12">
<div class="background">
<a href="../Collin/misc/issues/index.html">
<img alt="background" class="img-responsive" src="buttons/images/button.png" />
</a>
<div class="overlay">
<div class="icon">
<img alt="test" class="img-responsive" src="buttons/images/info-icon.png" />
</div>
<p class="head">Ask Facilities</p>
<p class="content">Here will be text about the button. .</p>
</div>
</div>
</div>
</div>
I'm trying to reduce the hyperlink area to just the background image.
Your markup is incredibly complex for what you are displaying.
You could have something like:
<ul>
<li>
<a>
<h2></h2>
<p></p>
</a>
</li>
<li>
<a>
<h2></h2>
<p></p>
</a>
</li>
</ul>
and add the image and the gradient using CSS.
I would use a single link tag for your button and leverage CSS gradients for the background:
* {
box-sizing: border-box;
}
body {
font-family: sans-serif;
}
.button {
background-image: linear-gradient(to bottom, #3D85C6, #07355F 50%, #07355F);
background-size: 100% 200%;
border-radius: 4px;
color: #fff;
display: block;
padding: 10px;
text-decoration: none;
transition: all 150ms ease-in-out;
}
.button:hover,
.button:focus,
.button:active {
background-position: 0 50%;
}
.button-icon {
float: left;
margin-right: 15px;
}
.button-content {
overflow: hidden;
}
.button-title {
font-size: 18px;
font-weight: bold;
}
.button-description {
font-size: 16px;
}
<a class="button" href="../Collin/misc/issues/index.html">
<div class="button-icon">
<img src="http://satyr.io/72/white?brand=github" alt=""/>
</div>
<div class="button-content">
<p class="button-title">Ask Facilities</p>
<p class="button-description">Here will be text about the button…</p>
</div>
</a>
Also here http://jsbin.com/rikisemawe/edit?html,css,output
The elements in OP were stacked in the markup, there were no nested components of the button. That would explain the unusual position coords and large padding.
Instead of <img>, background-image is used. Changed some of the tags to a real <button>, <h4> instead of <p>, etc.
SNIPPET
.button {
position: relative;
min-width: 350px;
max-width: 100%;
min-height: 95px;
height: auto;
padding: 5px 10px;
border: 0 none transparent;
border-radius: 6px;
background: url(http://www.auburn.edu/administration/facilities/home-page/buttons/images/button.png)no-repeat;
background-size: cover;
}
.background:hover .head {
color: #d76e08;
}
.text {
padding: 0 5px;
position: absolute;
left: 85px;
top: 5px;
text-align: left;
color: #def;
text-decoration: none;
}
.button:hover,
.text:hover {
text-decoration: none;
color: #def;
}
.button:hover .head {
color: gold;
}
.icon {
width: 75px;
height: 75px;
position: absolute;
top: calc(50% - 37.5px);
background: url(http://www.auburn.edu/administration/facilities/home-page/buttons/images/service-icon.png)no-repeat;
}
<link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="row">
<div class="col-sm-12">
<button class="button">
<div class="icon"></div>
<a class='text'>
<h4 class="head">Ask Facilities</h4>
<p class="content">Here will be text about the button.</p>
</a>
</button>
</div>
</div>
What is the correct way of resizing divs with text in it? I use the code below, but it leaves me with noticeable font distortion when resizing. Its kinda like the font has changed during animation. Also there is a flicker inside the circles. The effect isn't really visible on OSX, but it is on windows machines. How do I fix it?
.content-no-btn {
transition: all .2s ease-in-out;
}
.content-no-btn:hover {
transform: scale(1.05);
}
.entry-content {
border-style: solid;
border-color: #bbb;
border-width: 0px 3px 3px 3px;
padding-top: 20px;
}
#price {
text-align: center;
}
.plan {
display: inline-block;
margin: 10px 1%;
font-family: 'Lato', Arial, sans-serif;
}
.plan-inner {
background: #fff;
margin: 0 auto;
min-width: 280px;
max-width: 100%;
position: relative;
}
.entry-title {
background: #53CFE9;
height: 140px;
position: relative;
text-align: center;
color: #fff;
margin-bottom: 0px;
}
.entry-title>h3 {
background: #20BADA;
font-size: 20px;
padding: 5px 0;
text-transform: uppercase;
font-weight: 700;
margin: 0;
}
.entry-title .price {
position: absolute;
bottom: -25px;
background: #20BADA;
height: 95px;
width: 95px;
margin: 0 auto;
left: 0;
right: 0;
overflow: hidden;
border-radius: 50px;
border: 4px solid #fff;
line-height: 80px;
font-size: 23px;
font-weight: 700;
}
.price span {
position: absolute;
font-size: 8px;
bottom: -10px;
left: 30px;
font-weight: 400;
}
.entry-content {
color: #323232;
padding-top: 20px;
}
.entry-content ul {
margin: 0;
padding: 0;
list-style: none;
text-align: center;
}
.entry-content li {
border-bottom: 1px solid #E5E5E5;
padding: 10px 0;
}
.entry-content li:last-child {
border: none;
}
.btn {
padding: 5em 0 5em 0;
text-align: center;
}
.btn a {
background: #323232;
padding: 10px 30px;
color: #fff;
text-transform: uppercase;
font-weight: 700;
text-decoration: none
}
.hot {
position: absolute;
top: -7px;
background: #F80;
color: #fff;
text-transform: uppercase;
z-index: 2;
padding: 2px 5px;
font-size: 9px;
border-radius: 2px;
right: 10px;
font-weight: 700;
}
.basic .entry-title {
background: #f37920;
}
.basic .entry-title > h3 {
background: #E7680C;
}
.basic .price {
background: #f37920;
}
.standard .entry-title {
background: #4484c1;
}
.standard .entry-title > h3 {
background: #3772aa;
}
.standard .price {
background: #3772aa;
}
.ultimite .entry-title > h3 {
background: #DD4B5E;
}
.ultimite .entry-title {
background: #F75C70;
}
.ultimite .price {
background: #DD4B5E;
}
.gratitude {
padding: 5em 20px 5em 20px;
height: 300px;
text-align: center;
background-color: #f8f9f9;
}
.orderDetailsContent {
max-width: 800px;
text-align: center;
display: table;
position: relative;
margin: auto;
}
<div id="price">
<!--price tab-->
<div class="plan">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title first-entry-title">
<h3>WHATUP </h3>
<div class="price">$0.99<span></span>
</div>
</div>
<div class="entry-content first-entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan basic">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title">
<h3>YEAH </h3>
<div class="price">$1.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan standard">
<div class="plan-inner">
<div class="content-no-btn">
<div class="hot">hot</div>
<div class="entry-title">
<h3>Superduper</h3>
<div class="price">$2.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
<!--price tab-->
<div class="plan ultimite">
<div class="plan-inner">
<div class="content-no-btn">
<div class="entry-title">
<h3>JustGreat</h3>
<div class="price">$3.99<span></span>
</div>
</div>
<div class="entry-content">
<ul>
<li><strong>SOME text here</strong></li>
<li><strong>and here too</strong> really</li>
<li><strong>and here too</strong> Effective</li>
<li><strong>HEHE</strong> and here too</li>
</ul>
</div>
</div>
<div class="btn">
Order Now
</div>
</div>
</div>
<!-- end of price tab-->
</div>
<div class="gratitude"></div>
Scale transformations of such a small percentage are notorious for this. The only way around it is better browsers.
Instead, consider a translate animation with a whole number of pixels, perhaps upwards. You can also get some scale effect by setting position:relative on .content-no-btn then adding an absolutely positioned ::before with 100% width and height, and scaling only that pseudo-element on hover.
I created a fiddle here : http://jsfiddle.net/celiostat/zgUgn/
this is for a dynamic webpage. depending on the user, their might be 4 (as in the example) or 13 collections (on square = one collection). Height of image and collection title can vary. Consequently boxe height varies, and on the second row, I get a gap between collection above and collection below whereas I would like to keep that space between the boxes even; say 25px.
Thanks for your help !
HTML:
<div class="collection_bookmars_container">
<img class="collection_random_image" src="http://img.foodnetwork.com/FOOD/2012/05/04/FNM-060112_NTD-Hot-Dog-Sandwich_s4x3_lg.jpg">
<div class="collection_bookmark_title_container">
<span class="collection_bookmark_title">Thai favorites</span>
</div>
<div class="modify_collection_container">
<span class="number_of_articles">1</span>
<span class="article_text_only">articles</span>
<img class="icon_modify_collection" src="http://www.mricons.com/store/png/124258_43263_128_monotone_pen_write_icon.png">
</div>
</div>
<div class="collection_bookmars_container">
<img class="collection_random_image" src="http://img.foodnetwork.com/FOOD/2013/07/19/FNM_090113-Name-This-Dish-Stacked-Salad-Recipe_s4x3_lg.jpg">
<div class="collection_bookmark_title_container">
<span class="collection_bookmark_title">Best France food stuff</span>
</div>
<div class="modify_collection_container">
<span class="number_of_articles">1</span>
<span class="article_text_only">articles</span>
<img class="icon_modify_collection" src="http://www.mricons.com/store/png/124258_43263_128_monotone_pen_write_icon.png">
</div>
</div>
<div class="collection_bookmars_container">
<img class="collection_random_image" src="http://img.foodnetwork.com/FOOD/2012/05/04/FNM-060112_NTD-Hot-Dog-Sandwich_s4x3_lg.jpg">
<div class="collection_bookmark_title_container">
<span class="collection_bookmark_title">Snacks</span>
</div>
<div class="modify_collection_container">
<span class="number_of_articles">1</span>
<span class="article_text_only">articles</span>
<img class="icon_modify_collection" src="http://www.mricons.com/store/png/124258_43263_128_monotone_pen_write_icon.png">
</div>
</div>
<div class="collection_bookmars_container">
<img class="collection_random_image" src="http://www.secondhomemalaysia.co.uk/uploads/Food3.jpg">
<div class="collection_bookmark_title_container">
<span class="collection_bookmark_title">Soups and veloutes</span>
</div>
<div class="modify_collection_container">
<span class="number_of_articles">1</span>
<span class="article_text_only">articles</span>
<img class="icon_modify_collection" src="http://www.mricons.com/store/png/124258_43263_128_monotone_pen_write_icon.png">
</div>
</div>
CSS:
body
{
background-color: #ECF0F1;
}
.container
{
max-width: 550px;
width: 100%;
margin: 0px auto;
position: relative;
}
.table_presentation_two_column
{
height: auto;
display: table;
width: 100%;
margin: 0 auto;
}
.collection_bookmars_container
{
height: auto;
background-color: white;
display: inline-block;
vertical-align: top;
width: 46%;
box-sizing: border-box;
margin: 20px 2% 0% 2%;
}
.collection_random_image
{
margin-bottom: 10px;
width: 100%;
}
.collection_bookmark_title_container
{
margin: 30px 4% 0px 4%;
}
.collection_bookmark_title
{
font-family: "Roboto Slab","serif";
font-size: 30px;
}
.modify_collection_container
{
margin-top: 10px;
margin: 20px 4% 0px 4%;
padding-top: 15px;
border-top: 3px solid #EBEBEB;
width: 92%;
}
.number_of_articles
{
font-size: 16px
font-family: "Montserrat";
padding-bottom: 4px;
color: #AFAFAF;
font-weight: bold;
}
.article_text_only
{
font-size: 16px;
font-family: "Montserrat";
padding-bottom: 4px;
color: #AFAFAF;
font-weight: bold;
}
.icon_modify_collection
{
float: right;
position: relative;
overflow: hidden;
width: 12%;
max-width: 250px;
padding-bottom: 10px;
margin-top: -5;
}
You will need something like Masonry (http://masonry.desandro.com/) to do what you want, there is no other way doing it nicely because of the height difference. The wrapper is what is wrecking it for you.
Perhaps another idea is to create the wrappers for each column instead of each row.