Masonry in order [duplicate] - html

This question already has answers here:
How to Create Grid/Tile View? [duplicate]
(8 answers)
Closed 5 years ago.
I'm doing a list of posts for a blog and I want to do in Masonry. The problems I have found are:
The order when I load the posts is in columns so the order is like next:
1 3 5
2 4 6
And I want:
1 2 3
4 5 6
If I solve the second problem, it makes white space between rows.
Next I show an image about my problem:
So I want a solution like the after Masonry image. I have added the code in this fiddler
The HTML is:
<ul id="posts">
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title 1</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title 2</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title <br> Lorem <br> Ipsum</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title ramdom <br> lore</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title for test</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title <br> test</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title <br> a <br> five</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
<li class="wow fadeInUp" data-wow-duration="700ms" data-wow-delay="300ms">
<div class="bloglist text-center">
<div class="overflow"></div>
<div class="post-content">
<div class="listHeader">
<h1>Title</h1>
</div>
<div class="sbMeta">
<div class="loader"></div>
<div class="sbCats">Category</div>
<div class="sbAuth">
Author
</div>
</div>
<div class="sbFooter">
<i class="esen-Calendar"></i>Date
<i class="esen-Clock"></i>Min read
</div>
</div>
</div>
</li>
</ul>
and the CSS:
#posts li {
display: inline-block;
margin: 0;
padding: 0;
width: 33%;
background: #efefef;
}
#posts li .bloglist {
width: 100%;
position: relative;
border: 1px solid #f1f1f1;
padding-bottom: 22px;
overflow: hidden;
}
.text-center {
text-align: center;
}
#posts li .bloglist .overflow {
z-index: 2;
}
.overflow {
background-color: #3994ce;
mix-blend-mode: multiply;
opacity: .8;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
bottom: 0;
}
#posts li .bloglist .post-content {
position: relative;
z-index: 3;
}
#posts li .bloglist .post-content .listHeader {
position: relative;
margin-bottom: 20px;
}
#posts li .bloglist .post-content .sbMeta {
position: relative;
width: 100%;
}
#posts li .bloglist .post-content .sbMeta .loader {
height: 1px;
width: 100px;
margin: 0 auto;
margin-bottom: 20px;
position: relative;
background: #fff;
-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-o-transition: all .5s ease;
-ms-transition: all .5s ease;
transition: all .5s ease;
}
#posts li .bloglist .post-content .sbAuth {
width: 100%;
text-align: center;
margin-bottom: 40px;
}
#posts li .bloglist .post-content .sbAuth a {
color: #fff;
}
div {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#posts li .bloglist .post-content .sbFooter {
width: 90%;
position: absolute;
left: 50%;
transform: translate(-50%,0);
}

You can try creating masonry using column counts (CSS property).
Below is an example that can help you out.
HTML:
<ul id="posts">
<li>col 1</li>
<li>col 2</li>
<li>col 3</li>
<li>col 4</li>
<li>col 5</li>
<li>col 6</li>
</ul>
CSS:
#posts { /* Masonry container */
column-count: 3;
column-gap: 1em;
-moz-column-count: 3;
-moz-column-gap: 1em;
-webkit-column-count: 3;
-webkit-column-gap: 1em;
-ms-column-gap: 1em;
}
#posts li { /* Masonry bricks or child elements */
background-color: #eee;
display: inline-block;
margin: 0 0 1em;
width: 100%;
}
Here is the fiddle for it:-
https://jsfiddle.net/ug5oy087/

Related

Bootstrap 3 grid make panel stay on bottom right corner and scrollable div

This is the following HTML:
<div class="row">
<div class="col-md-8">
<div class="row">
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
</div>
<div class="row">
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
</div>
<div class="row">
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
<div class="col-md-3">
<a href="javascript:void(0)" class="text-muted text-decoration-none">
<div class="panel panel-default">
<div class="panel-body">
<p>Text goes Here</p>
</div>
</div>
</a>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4" style="border-left: 1px solid black; height:90vh;">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<p>Product Name</p><br />
<p>Product Price</p>
</div>
</div>
</div>
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-body">
<p>Product Name</p><br />
<p>Product Price</p>
</div>
</div>
</div>
</div>
<div>
<div class="panel panel-default">
<div class="panel-body">
<p>Checkout</p><br />
<p>Total Price</p>
</div>
</div>
</div>
</div>
</div>
</div>
This is the result:
https://i.stack.imgur.com/Y2Cfb.png
If I added more Product Name the checkout panel will move automatically like this:
https://i.stack.imgur.com/ZjZa3.png
How to make checkout panel stay in bottom right corner only?
And how to make the div in panel product name scrollable ?
Is that what you want?
.wrap {
width: 100%;
height: 150px;
border: 1px solid #cccccc;
display: flex;
}
.column {
width: 50%;
}
ul.column {
border-left: 1px solid #cccccc;
height: 100%;
overflow: auto;
padding: 0;
margin: 0;
list-style: none;
}
ul li {
height: 40px;
background-color: aquamarine;
margin: 10px;
}
ul .last {
background-color: orange;
position: sticky;
bottom: 5px;
box-shadow: 0 0 10px;
margin-bottom: 50px;
}
<div class="wrap">
<div class="column"></div>
<ul class="column">
<li></li>
<li></li>
<li></li>
<li></li>
<li class="last"></li>
</ul>
<div>

How can I get this code to show fontawesome icons?

I am trying to create some service icon boxes next to the services that are provided. I have tried it in this method however it does not work. I think font-awesome icons could work with this code but I don't know much about font-awesome. The HTML and CSS have been included and you will see that the icons are not being shown.
<style>.y-us-section {
padding: 82px 0 82px;
}
.y-us-head {
text-align: center;
margin: 0 0 91px;
}
.y-us-title h2 {
color: #000;
font-size: 30px;
letter-spacing: 0;
line-height: 32px;
text-transform: uppercase;
margin-bottom: 6px;
}
.y-us-title>p {
color: #777777;
line-height: 22px;
}
.y-us-title-border {
background: #006600 none repeat scroll 0 0;
border-radius: 2px;
display: inline-block;
height: 3px;
position: relative;
width: 50px;
}
.service-3 .service-box {
margin-bottom: 18px;
}
.service-3 .service-box .iconset {
float: left;
text-align: center;
width: 25%;
}
.service-3 .service-box .iconset i {
color: #000;
font-size: 44px;
}
.service-3 .service-box .y-us-content {
float: left;
width: 75%;
}
service-3 .service-box .y-us-content h4 {
color: #3a3a3a;
font-size: 18px;
letter-spacing: 0;
line-height: 22px;
margin: 14px 0 12px;
text-transform: uppercase;
}
.service-3 .service-box .y-us-content p {
color: #777777;
font-size: 13px;
font-weight: 300;
line-height: 24px;
}
.icon {
color: #70AD4;
padding: 0px;
font-size: 40px;
border: 1px solid #70AD47;
border-radius: 100px;
color: #000000;
font-size: 28px;
height: 70px;
line-height: 70px;
text-align: center;
width: 70px;
}
<body>
<div class="y-us-section">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2 col-sm-12 col-xs-12">
<div class="y-us-head">
<div class="y-us-title">
</div>
</div>
</div>
</div>
<div style="clear: both">
<h3 style="float: left">Quality Assurance</h3>
<h3 style="float: right">Regulatory Affairs</h3>
</div>
<hr />
<br>
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-content">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Quality Management Representative system</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Iso 13485 Implementation</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Internal Audits</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Suppiler Audits</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>CE Marking Files</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>UKCA Marking</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>PRRC</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Biological Evaluation</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Clinical Evaluation</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>EU Authorised Representative</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="glyphicon glyphicon-cog icon"></span>
</div>
<div class="y-us-content">
<h4>UK Responsible Person</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
You seem to have exactly the right idea but Glyphicons are nothing to do with Font-Awesome.
Ensure that this line is added to the <head> of your page.
<script src="https://kit.fontawesome.com/d38a9ab6aa.js" crossorigin="anonymous"></script>
Then you can insert any icon from this page....
https://fontawesome.com/v5.15/icons ... In the same way you added the Glyphicons.
To have a small footprint (fast loading time), you may specify only icons you require.
------ Setup ------
-- Create folder 'webfonts' with subfolder 'font-awesome'
-- Copy 4 Font Awesome files (see below) in subforlder 'font-awesome'
-- Create a new file 'fontloader.css' in folder 'webfonts'
[webfonts]
+-- [font-awesome]
| +-- fa-solid-900.svg
| +-- fa-solid-900.ttf
| +-- fa-solid-900.woff
| +-- fa-solid-900.woff2
+-- fontloader.css
-- Insert the following css into file 'fontloader.css'
/* Font Awesome 5 Free */
#font-face {
font-family: 'Font Awesome 5 Free';
font-style: normal;
font-weight: 400;
font-display: auto;
src: url("../webfonts/font-awesome/fa-solid-900.woff2") format("woff2"),
url("../webfonts/font-awesome/fa-solid-900.woff") format("woff"),
url("../webfonts/font-awesome/fa-solid-900.ttf") format("truetype"),
url("../webfonts/font-awesome/fa-solid-900.svg#fontawesome") format("svg");
}
.fas, .far, .fab, .fa {
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
display: inline-block;
font-family: 'Font Awesome 5 Free';
font-weight: 400;
font-style: normal;
font-variant: normal;
font-size: 1em;
line-height: 1;
text-rendering: auto;
}
-- Link the css to your html:
<link rel="stylesheet" href="URL/TO/webfonts/fontloader.css">
------ For each icon ------
-- Use https://fontawesome.com/icons/ to search icons.
/* Example: an 'house' icon, search it */
/* then use the hex code in this way */
.fa-house-user:before {
content: "\e065"
}
-- Now you can insert the icon into the html
<i class="fas fa-house-user"></i>
I hope this solution will help you. The format is not nice, but I kept your HTML as you provided and made the icons to show up.
<style>.y-us-section {
padding: 82px 0 82px;
}
.y-us-head {
text-align: center;
margin: 0 0 91px;
}
.y-us-title h2 {
color: #000;
font-size: 30px;
letter-spacing: 0;
line-height: 32px;
text-transform: uppercase;
margin-bottom: 6px;
}
.y-us-title>p {
color: #777777;
line-height: 22px;
}
.y-us-title-border {
background: #006600 none repeat scroll 0 0;
border-radius: 2px;
display: inline-block;
height: 3px;
position: relative;
width: 50px;
}
.service-3 .service-box {
margin-bottom: 18px;
}
.service-3 .service-box .iconset {
float: left;
text-align: center;
width: 25%;
}
.service-3 .service-box .iconset i {
color: #000;
font-size: 44px;
}
.service-3 .service-box .y-us-content {
float: left;
width: 75%;
}
service-3 .service-box .y-us-content h4 {
color: #3a3a3a;
font-size: 18px;
letter-spacing: 0;
line-height: 22px;
margin: 14px 0 12px;
text-transform: uppercase;
}
.service-3 .service-box .y-us-content p {
color: #777777;
font-size: 13px;
font-weight: 300;
line-height: 24px;
}
.icon {
color: #70AD4;
padding: 0px;
font-size: 20px;
border-radius: 100px;
color: #000000;
font-size: 28px;
height: 20px;
line-height: 20px;
text-align: center;
width: 20px;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<body>
<div class="y-us-section">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2 col-sm-12 col-xs-12">
<div class="y-us-head">
<div class="y-us-title">
</div>
</div>
</div>
</div>
<div style="clear: both">
<h3 style="float: left">Quality Assurance</h3>
<h3 style="float: right">Regulatory Affairs</h3>
</div>
<hr />
<br>
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-content">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Quality Management Representative system</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Iso 13485 Implementation</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Internal Audits</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Suppiler Audits</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>CE Marking Files</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>UKCA Marking</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>PRRC</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="why-choose-banner">
<img src="http://themeinnovation.com/demo2/html/build-up/img/home1/why-choose.jpg" alt="">
</div>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="y-us-contentbox">
<div class="service-3">
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Biological Evaluation</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>Clinical Evaluation</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>EU Authorised Representative</h4>
<p></p>
</div>
</div>
</div>
<div class="service-box">
<div class="clearfix">
<div class="iconset">
<span class="fa fa-cog icon"></span>
</div>
<div class="y-us-content">
<h4>UK Responsible Person</h4>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

Unable to make Bootstrap columns of equal height

I using Bootstrap4 for my personal website and I am not able to make the columns of equal height.
I have looked for solutions here but the solutions don't seem to work on my code. I would appreciate any input.
<!-- Start projects section--->
<div id="projects" class="offset">
<!--- start jumbotron -->
<div class="jumbotron">
<div class="col-12 text-center">
<h3 class="heading">Projects</h3>
<div class="heading-underline"></div>
</div>
<div class="row">
<div class="col-md-6 projects">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-8 text-left">
<h5 class="heading project-title">The Twitter Bakery (2018) </h5>
</div>
</div>
<div class="row">
<div class="col-md-4">
<!--- image of client -->
<img src="img/mountains_trip.jpg" alt="image not displayed">
</div>
<div class="col-md-8">
<!--- text of client -->
<div>
Some words<br><br>Some more words
</div>
<hr class="projects-hr">
<i class="fab fa-github fa-2x"></i>
</div>
</div>
</div>
<div class="col-md-6 projects">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-8 text-left">
<h5 class="heading project-title">Jersey Allocation (2018)</h5>
</div>
</div>
<div class="row">
<div class="col-md-4">
<!--- image of client -->
<img src="img/mountains_trip.jpg" alt="image not displayed">
</div>
<div class="col-md-8">
<!--- text of client -->
<div>
Some words.
</div>
<hr class="projects-hr">
<i class="fab fa-github fa-2x"></i>
</div>
</div>
</div>
</div>
</div>
<!--- end jumbotron -->
</div>
<!-- end projects section--->
Here is my css for the section. The (.row and [class*="col-"]) rules are copied from the answers presented in the above link.
.row{
overflow: hidden;
}
[class*="col-"]{
margin-bottom: -99999px;
padding-bottom: 99999px;
}
.projects img{
width:100%;
border-radius:10%;
}
.projects hr{
border-top:0.05rem solid #ad7232!important;
padding-bottom: 0.1rem;/* makes them visible in some cases*/
}
.project-link .svg-inline--fa{
align-self: center;
color: #505962 ;
}
.project-title{
text-transform: uppercase;
color: #ed9a00;
}
This is how the current section looks

Bootstrap columns contents

Hello I've created a simple columns using bootstrap but there are problem that if the content of the first column is big the third column will be floated in the right:
#contact-me {
width: 100%;
padding: 40px 0;
/*font-family:Raleway, Arial, 'Open Sans';*/
}
#contact-me .contact-info-nested {
width: 100%;
margin-bottom: 20px;
text-align: center;
}
#contact-me .contact-info-nested i {
display: inline-block;
margin-bottom: 16px;
font-size: 50px;
}
#contact-me .contact-info h4 {
padding: 5px;
font-size: 16px;
line-height: 25px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<section id="contact-me">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6">
<div class="contact-info-nested">
<i class="fa fa-map-marker"></i>
<h4>Bak-One Company 12345 Hollywood Bvld Street Los Angeles, California</h4>
</div>
</div>
<div class="col-md-4 col-sm-6">
<div class="contact-info-nested">
<i class="fa fa-phone"></i>
<h4>+93 345 678 91 23</h4>
</div>
</div>
<div class="clearfix"> </div>
<div class="col-md-4 col-sm-6">
<div class="contact-info-nested">
<i class="fa fa-envelope-o"></i>
<h4>penciltheme#gmail.com</h4>
</div>
</div>
</div>
</div>
</section>
Note: please run code snippet in fullscreen
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<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/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<style>
#contact-me {
width: 100%;
padding: 40px 0;
/*font-family:Raleway, Arial, 'Open Sans';*/
}
#contact-me .contact-info-nested {
width: 100%;
margin-bottom: 20px;
text-align: center;
}
#contact-me .contact-info-nested i {
display: inline-block;
margin-bottom: 16px;
font-size: 50px;
}
#contact-me .contact-info h4 {
padding: 5px;
font-size: 16px;
line-height: 25px;
}
</style>
</head>
<body>
<section id="contact-me">
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="contact-info-nested">
<i class="fa fa-map-marker"></i>
<h4>Bak-One Company 12345 Hollywood Bvld Street Los Angeles, California</h4>
</div>
</div>
<div class="col-sm-4">
<div class="contact-info-nested">
<i class="fa fa-phone"></i>
<h4>+93 345 678 91 23</h4>
</div>
</div>
<div class="col-sm-4">
<div class="contact-info-nested">
<i class="fa fa-envelope-o"></i>
<h4>penciltheme#gmail.com</h4>
</div>
</div>
</div>
</div>
</section>
</body>
</html>
Use col-lg-4 . Because col-lg-6 use in thee time and bootstrap column 12 then your last div below line . So i suggest to you can use col-lg-4 three in row then manage all column.
Bootstrap Grid
#contact-me {
width:100%;
padding:40px 0;
/*font-family:Raleway, Arial, 'Open Sans';*/
}
#contact-me .contact-info-nested{
width:100%;
margin-bottom:20px;
text-align:center;
}
#contact-me .contact-info-nested i{
display:inline-block;
margin-bottom:16px;
font-size:50px;
}
#contact-me .contact-info h4{
padding:5px;
font-size:16px;
line-height:25px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<section id="contact-me">
<div class="container">
<div class="row">
<div class="col-lg-4">
<div class="contact-info-nested">
<i class="fa fa-map-marker"></i>
<h4>Bak-One Company 12345 Hollywood Bvld Street Los Angeles, California</h4>
</div>
</div>
<div class="col-lg-4">
<div class="contact-info-nested">
<i class="fa fa-phone"></i>
<h4>+93 345 678 91 23</h4>
</div>
</div>
<div class="clear"></div>
<div class="col-lg-4">
<div class="contact-info-nested">
<i class="fa fa-envelope-o"></i>
<h4>penciltheme#gmail.com</h4>
</div>
</div>
</div>
</div>
</section>
User row when you want to add content in new float you need to use class=row. it will helpfull for this type of issue.
#contact-me {
width:100%;
padding:40px 0;
/*font-family:Raleway, Arial, 'Open Sans';*/
}
#contact-me .contact-info-nested{
width:100%;
margin-bottom:20px;
text-align:center;
}
#contact-me .contact-info-nested i{
display:inline-block;
margin-bottom:16px;
font-size:50px;
}
#contact-me .contact-info h4{
padding:5px;
font-size:16px;
line-height:25px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<section id="contact-me">
<div class="container">
<div class="row">
<div class="col-lg-6">
<div class="contact-info-nested">
<i class="fa fa-map-marker"></i>
<h4>Bak-One Company 12345 Hollywood Bvld Street Los Angeles, California</h4>
</div>
</div>
<div class="col-lg-6">
<div class="contact-info-nested">
<i class="fa fa-phone"></i>
<h4>+93 345 678 91 23</h4>
</div>
</div>
</div>
<div class="row">
<div class="clear"></div>
<div class="col-lg-6">
<div class="contact-info-nested">
<i class="fa fa-envelope-o"></i>
<h4>penciltheme#gmail.com</h4>
</div>
</div>
</div>
</div>
</section>
you can use this code <div class="clearfix visible-sm"></div> that this code will clear the float in the small screen:
#contact-me {
width:100%;
padding:40px 0;
/*font-family:Raleway, Arial, 'Open Sans';*/
}
#contact-me .contact-info-nested{
width:100%;
margin-bottom:20px;
text-align:center;
}
#contact-me .contact-info-nested i{
display:inline-block;
margin-bottom:16px;
font-size:50px;
}
#contact-me .contact-info h4{
padding:5px;
font-size:16px;
line-height:25px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<section id="contact-me">
<div class="container">
<div class="row">
<div class="col-md-4 col-sm-6">
<div class="contact-info-nested">
<i class="fa fa-map-marker"></i>
<h4>Bak-One Company 12345 Hollywood Bvld Street Los Angeles, California</h4>
</div>
</div>
<div class="col-md-4 col-sm-6">
<div class="contact-info-nested">
<i class="fa fa-phone"></i>
<h4>+93 345 678 91 23</h4>
</div>
</div>
<div class="clearfix visible-sm"></div>
<div class="col-md-4 col-sm-6">
<div class="contact-info-nested">
<i class="fa fa-envelope-o"></i>
<h4>penciltheme#gmail.com</h4>
</div>
</div>
</div>
</div>
</section>
The bootstrap's grid system is divided in 12, here'w an example:
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-lg-12">
<center>
<h1>Column 1</h1>
</center>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<center>
<h1>Column 1</h1>
</center>
</div>
<div class="col-lg-6">
<center>
<h1>Column 2</h1>
</center>
</div>
</div>
<div class="row">
<div class="col-lg-4">
<center>
<h1>Column 1</h1>
</center>
</div>
<div class="col-lg-4">
<center>
<h1>Column 2</h1>
</center>
</div>
<div class="col-lg-4">
<center>
<h1>Column 3</h1>
</center>
</div>
</div>
<div class="row">
<div class="col-lg-3">
<center>
<h1>Column 1</h1>
</center>
</div>
<div class="col-lg-3">
<center>
<h1>Column 2</h1>
</center>
</div>
<div class="col-lg-3">
<center>
<h1>Column 3</h1>
</center>
</div>
<div class="col-lg-3">
<center>
<h1>Column 4</h1>
</center>
</div>
</div>
<div class="row">
<div class="col-lg-2">
<center>
<h1>Column 1</h1>
</center>
</div>
<div class="col-lg-2">
<center>
<h1>Column 2</h1>
</center>
</div>
<div class="col-lg-2">
<center>
<h1>Column 3</h1>
</center>
</div>
<div class="col-lg-2">
<center>
<h1>Column 4</h1>
</center>
</div>
<div class="col-lg-2">
<center>
<h1>Column 5</h1>
</center>
</div>
<div class="col-lg-2">
<center>
<h1>Column 6</h1>
</center>
</div>
</div>
<div class="row">
<div class="col-lg-1">
<center>
<h4>Column 1</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 2</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 3</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 4</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 5</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 6</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 7</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 8</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 9</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 10</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 11</h4>
</center>
</div>
<div class="col-lg-1">
<center>
<h4>Column 12</h4>
</center>
</div>
</div>
If you want to make 3 columns, you should use col-lg-4 in the divs' class instead of 6.

Horizontal tabs in boostrtap

I've using some code for custom vertical tabs in bootstrap and I trying to make them horizontal and text below every tab but I can't understand exactly how.
<section id="about">
<div class="container">
<div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="feature_header text-center">
<h3 class="feature_title"><b>Tabs</b></h3>
</div>
</div>
</div>
<div class="row">
<div class="feature-tab">
<div class="col-md-2 col-sm-3 col-xs-12">
<ul class="nav nav-tabs main-tab-list text-center" role="tablist">
<li role="presentation" class="active">
<a href="#home" role="tab" data-toggle="tab" >
<div class="single-tab">
<div class="f-icon">
<i class="fa fa-laptop"></i>
</div>
</div>
<h4>Tab 1</h4>
</a>
</li>
<li role="presentation" >
<a href="#profile" role="tab" data-toggle="tab">
<div class="single-tab">
<div class="f-icon">
<i class="fa fa-send"></i>
</div>
</div>
<h4>Tab 2</h4>
</a>
</li>
<li role="presentation" >
<a href="#messages" role="tab" data-toggle="tab">
<div class="single-tab">
<div class="f-icon">
<i class="fa fa-heart"></i>
</div>
</div>
<h4>Tab 3</h4>
</a>
</li>
</ul>
</div> <!-- col-md-12 end -->
<div class="col-md-10 col-sm-9 col-xs-12">
<div class="tab-content main-tab-content">
<div role="tabpanel" class="tab-pane active " id="home">
<div class="col-md-12 col-sm-9">
<div class="c-tab">
<h4>Tab 1</h4>
<p>Lorem ipsum.... </p>
More
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane active " id="home">
<div class="col-md-12 col-sm-9">
<div class="c-tab">
<h4>Tab 2</h4>
<p>Lorem ipsum.... </p>
More
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane active " id="home">
<div class="col-md-12 col-sm-9">
<div class="c-tab">
<h4>Tab 3</h4>
<p>Lorem ipsum.... </p>
More
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
I wont post CSS because will be very long instead I'll post the JsFiddle.
For more clear I have made this Jsfiddle. Can some one tell how will this go horizontal. I mean Tab 1, Tab 2 and Tab 3..
You can try as below, i just edited your below class and it works!
you should always give style float: left; and display: inherit; together to do the magic :)
.main-tab-list li{
padding: 10px 0px 10px;
border: 1px solid#eee;
width: 150px;
/* background: #FBFBFB; */
float: left;
margin-bottom: 5px;
border-radius: 5px;
display: inherit;
margin-right: 5px;
}
remove .col-md class from .nav-tabs parent and replace it by .row class, and your `` should be:
.main-tab-list li{
position: relative;
display: inline-block;
float: left; /* or none */
padding: 10px 0px 10px;
border: 1px solid#eee;
width: 150px;
/*background: #FBFBFB;*/
margin-bottom: 5px;
border-radius: 5px;
}
http://jsfiddle.net/yt21wup5/