Bootstrap Column layout with content - css

How to create a layout using bootstrap similar on the image below? In web the first column indicate as their label (Developer, Project Overview, etc) and the succeeding columns is their description on different items. On mobile must be vertically align together with their content. Just want a started code using bootstrap 3 on how to make a layout just like on the image and I will make the rest.
This is my sample code but when it view on mobile is different on what I've wanted . I want a design just like on the image above.
<div class="row bg-highlight">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12 first">
<h4>Project</h4>
</div>
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<h4>BRIO TOWER</h4>
<img src="http://placehold.it/900x600" alt="img" title="U-Travel Services Inc" class="img-responsive thumbnail" >
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<h4>BRIO TOWER</h4>
<img src="http://placehold.it/900x600" alt="img" title="U-Travel Services Inc" class="img-responsive thumbnail" >
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<h4>BRIO TOWER</h4>
<img src="http://placehold.it/900x600" alt="img" title="U-Travel Services Inc" class="img-responsive thumbnail" >
</div>
</div>
</div>
</div>
<div class="row bg-light-gray">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12 first">
<h5>Developer</h5>
</div>
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<p>DMCI Homes</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<p>SMDC</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<p>AVIDA LAND</p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12 first">
<h5>Project Overview</h5>
</div>
<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum</p>
</div>
</div>
</div>
</div>

This is a good start for the basic markup you should use. If you are needing those labels on the left to line up with each block of text, it may need to be revised.
HTML
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1>Compare Property</h1>
<hr>
<p>Use this document as a way to quickly start any new project. All you get is this text and a mostly barebones HTML document.</p>
</div>
</div>
<div class="row with-images">
<div class="col-sm-3 hidden-xs">
<p class="descriptions">X</p>
<p class="descriptions">Developer</p>
<p class="descriptions">Overview</p>
<p class="descriptions">Location</p>
</div>
<div class="col-sm-3">
<div class="image-wrap">
<img src="http://placehold.it/900x600">
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam imperdiet lectus a facilisis iaculis. Morbi nec velit pharetra, commodo velit et, varius elit. Mauris at tincidunt nisl, quis sollicitudin tellus. In ac hendrerit leo, in congue dolor. Curabitur nec elit vitae ligula semper eleifend. Suspendisse molestie dignissim feugiat. Pellentesque consectetur nulla urna, sagittis rutrum eros tristique ac. Donec commodo ultrices justo, quis tempor erat aliquet id. </p>
<p>Etiam non est semper, cursus arcu quis, finibus neque. Aliquam blandit ante mollis urna accumsan, ullamcorper malesuada nulla fringilla. Suspendisse potenti. Nullam vehicula mauris id nulla interdum pretium. Morbi sollicitudin cursus quam, tincidunt ultrices massa faucibus et. Sed cursus sollicitudin erat, vitae eleifend lectus cursus sed. Nam tempor libero vitae nibh bibendum laoreet. Maecenas dictum ex nec urna rutrum laoreet. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Pellentesque congue ultricies ex, ac porttitor urna mollis tristique. Donec condimentum accumsan lacus sed dictum. Pellentesque sagittis accumsan congue.</p>
</div>
<div class="col-sm-3">
<div class="image-wrap">
<img src="http://placehold.it/900x600">
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam imperdiet lectus a facilisis iaculis. Morbi nec velit pharetra, commodo velit et, varius elit. Mauris at tincidunt nisl, quis sollicitudin tellus. In ac hendrerit leo, in congue dolor. Curabitur nec elit vitae ligula semper eleifend. Suspendisse molestie dignissim feugiat. Pellentesque consectetur nulla urna, sagittis rutrum eros tristique ac. Donec commodo ultrices justo, quis tempor erat aliquet id. </p>
<p>Etiam non est semper, cursus arcu quis, finibus neque. Aliquam blandit ante mollis urna accumsan, ullamcorper malesuada nulla fringilla. Suspendisse potenti. Nullam vehicula mauris id nulla interdum pretium. Morbi sollicitudin cursus quam, tincidunt ultrices massa faucibus et. Sed cursus sollicitudin erat, vitae eleifend lectus cursus sed. Nam tempor libero vitae nibh bibendum laoreet. Maecenas dictum ex nec urna rutrum laoreet. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Pellentesque congue ultricies ex, ac porttitor urna mollis tristique. Donec condimentum accumsan lacus sed dictum. Pellentesque sagittis accumsan congue.</p>
</div>
<div class="col-sm-3">
<div class="image-wrap">
<img src="http://placehold.it/900x600">
</div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam imperdiet lectus a facilisis iaculis. Morbi nec velit pharetra, commodo velit et, varius elit. Mauris at tincidunt nisl, quis sollicitudin tellus. In ac hendrerit leo, in congue dolor. Curabitur nec elit vitae ligula semper eleifend. Suspendisse molestie dignissim feugiat. Pellentesque consectetur nulla urna, sagittis rutrum eros tristique ac. Donec commodo ultrices justo, quis tempor erat aliquet id. </p>
<p>Etiam non est semper, cursus arcu quis, finibus neque. Aliquam blandit ante mollis urna accumsan, ullamcorper malesuada nulla fringilla. Suspendisse potenti. Nullam vehicula mauris id nulla interdum pretium. Morbi sollicitudin cursus quam, tincidunt ultrices massa faucibus et. Sed cursus sollicitudin erat, vitae eleifend lectus cursus sed. Nam tempor libero vitae nibh bibendum laoreet. Maecenas dictum ex nec urna rutrum laoreet. In hac habitasse platea dictumst. In hac habitasse platea dictumst. Pellentesque congue ultricies ex, ac porttitor urna mollis tristique. Donec condimentum accumsan lacus sed dictum. Pellentesque sagittis accumsan congue.</p>
</div>
</div>
</div><!-- /.container -->
CSS
.with-images img {
max-width:100%;
height:auto;
}
.image-wrap {
margin-bottom:15px;
}
Example on Bootply

Related

How can I ensure that all boxes retain the same size regardless of how much text is in it?

I have some Bootstrap card boxes that have various sizes of text that will be stored within each. I want to ensure that the box will retain the same height regardless of the amount. In that case, maybe only x amount of lines should be displayed which is fine, just want to make sure that the boxes themselves are a consistent height because this will mess up the whole page if they are not. These are bootstrap 3 boxes.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
<div class="container">
<div class="col-sm-4" v-for="(card, index) in cards">
<div v-if="canDisplay(index)" class="thumbnail">
<div class="caption text-center" onclick="">
<div class="position-relative">
<div v-html="getImage(card)">
</div>
</div>
<h4 id="thumbnail-label" v-html="getTextLinkUrl(card)">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" /> Testing
</h4>
<div class="thumbnail-description smaller" v-html="card.description"></div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
<div class="caption card-footer text-center">
<ul class="list-inline">
<li>
<button #click="edit(index)"><i
class="glyphicon glyphicon-pencil lighter"></i> Edit</button>
</li>
<li>
<button #click="remove(index)"><i
class="glyphicon glyphicon-trash lighter"></i> Remove</button>
</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-4" v-for="(card, index) in cards">
<div v-if="canDisplay(index)" class="thumbnail">
<div class="caption text-center" onclick="">
<div class="position-relative">
<div v-html="getImage(card)">
</div>
</div>
<h4 id="thumbnail-label" v-html="getTextLinkUrl(card)">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" /> Testing
</h4>
<div class="thumbnail-description smaller" v-html="card.description"></div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Dictum non consectetur a erat nam. Massa vitae tortor condimentum lacinia quis vel. Elementum eu facilisis sed odio
morbi. Tellus at urna condimentum mattis pellentesque id nibh. Et malesuada fames ac turpis egestas. Senectus et netus et malesuada. Massa enim nec dui nunc. Scelerisque in dictum non consectetur a. Vel quam elementum pulvinar etiam non quam lacus
suspendisse faucibus. Risus feugiat in ante metus dictum at tempor. Convallis convallis tellus id interdum velit. Id diam maecenas ultricies mi eget. Elementum curabitur vitae nunc sed velit dignissim sodales ut eu. Dignissim diam quis enim lobortis
scelerisque fermentum dui faucibus in. Metus aliquam eleifend mi in nulla. Accumsan lacus vel facilisis volutpat est velit egestas dui id. Nibh sit amet commodo nulla facilisi nullam vehicula. Sed id semper risus in hendrerit gravida rutrum quisque.
Eget felis eget nunc lobortis. Adipiscing enim eu turpis egestas pretium. Volutpat sed cras ornare arcu. Ac tortor dignissim convallis aenean. Risus nec feugiat in fermentum posuere. Turpis tincidunt id aliquet risus feugiat in ante metus. Vitae
nunc sed velit dignissim sodales ut. Tellus elementum sagittis vitae et leo duis ut diam. Nibh praesent tristique magna sit amet purus gravida quis blandit. Ornare suspendisse sed nisi lacus sed. Eu non diam phasellus vestibulum lorem. Amet nisl
suscipit adipiscing bibendum est ultricies integer quis auctor. Porta lorem mollis aliquam ut. Condimentum mattis pellentesque id nibh. Ipsum suspendisse ultrices gravida dictum. Consequat semper viverra nam libero justo laoreet sit. Nunc non
blandit massa enim nec dui nunc mattis enim. Ut porttitor leo a diam sollicitudin tempor id. Eget mauris pharetra et ultrices neque ornare aenean. Eu sem integer vitae justo eget magna. Vitae tempus quam pellentesque nec nam aliquam sem et. Aliquet
enim tortor at auctor. Nisl nisi scelerisque eu ultrices vitae auctor eu. Fames ac turpis egestas integer eget. Id velit ut tortor pretium viverra suspendisse potenti nullam ac. Dictum varius duis at consectetur lorem. Scelerisque felis imperdiet
proin fermentum leo. Id aliquet lectus proin nibh. Diam maecenas ultricies mi eget mauris pharetra. Vulputate enim nulla aliquet porttitor. Dictum sit amet justo donec.
</div>
<div class="caption card-footer text-center">
<ul class="list-inline">
<li>
<button #click="edit(index)"><i
class="glyphicon glyphicon-pencil lighter"></i> Edit</button>
</li>
<li>
<button #click="remove(index)"><i
class="glyphicon glyphicon-trash lighter"></i> Remove</button>
</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-4" v-for="(card, index) in cards">
<div v-if="canDisplay(index)" class="thumbnail">
<div class="caption text-center" onclick="">
<div class="position-relative">
<div v-html="getImage(card)">
</div>
</div>
<h4 id="thumbnail-label" v-html="getTextLinkUrl(card)">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" /> Testing
</h4>
<div class="thumbnail-description smaller" v-html="card.description"></div>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</div>
<div class="caption card-footer text-center">
<ul class="list-inline">
<li>
<button #click="edit(index)"><i
class="glyphicon glyphicon-pencil lighter"></i> Edit</button>
</li>
<li>
<button #click="remove(index)"><i
class="glyphicon glyphicon-trash lighter"></i> Remove</button>
</li>
</ul>
</div>
</div>
</div>
</div>
i remove your closing div and move your content inside the thumbnail-description. added a specific height and hide the overflow. hope this helps you.
.thumbnail {
height: 450px;
overflow: hidden;
}
.thumbnail-description {
max-height:300px;
overflow:hidden;
}
#media only screen and (max-width: 768px){
.thumbnail {
height:auto;
}
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
<div class="container">
<div class="col-sm-4" v-for="(card, index) in cards">
<div v-if="canDisplay(index)" class="thumbnail">
<div class="caption text-center" onclick="">
<div class="position-relative">
<div v-html="getImage(card)">
</div>
</div>
<h4 id="thumbnail-label" v-html="getTextLinkUrl(card)">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" /> Testing
</h4>
<div class="thumbnail-description smaller" v-html="card.description">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
<div class="caption card-footer text-center">
<ul class="list-inline">
<li>
<button #click="edit(index)"><i
class="glyphicon glyphicon-pencil lighter"></i> Edit</button>
</li>
<li>
<button #click="remove(index)"><i
class="glyphicon glyphicon-trash lighter"></i> Remove</button>
</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-4" v-for="(card, index) in cards">
<div v-if="canDisplay(index)" class="thumbnail">
<div class="caption text-center" onclick="">
<div class="position-relative">
<div v-html="getImage(card)">
</div>
</div>
<h4 id="thumbnail-label" v-html="getTextLinkUrl(card)">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" /> Testing
</h4>
<div class="thumbnail-description smaller" v-html="card.description">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Dictum non consectetur a erat nam. Massa vitae tortor condimentum lacinia quis vel. Elementum eu facilisis sed odio morbi. Tellus at urna condimentum mattis pellentesque id nibh. Et malesuada fames ac turpis egestas. Senectus et netus et malesuada. Massa enim nec dui nunc. Scelerisque in dictum non consectetur a. Vel quam elementum pulvinar etiam non quam lacus suspendisse faucibus. Risus feugiat in ante metus dictum at tempor. Convallis convallis tellus id interdum velit. Id diam maecenas ultricies mi eget. Elementum curabitur vitae nunc sed velit dignissim sodales ut eu. Dignissim diam quis enim lobortis scelerisque fermentum dui faucibus in. Metus aliquam eleifend mi in nulla.
Accumsan lacus vel facilisis volutpat est velit egestas dui id. Nibh sit amet commodo nulla facilisi nullam vehicula. Sed id semper risus in hendrerit gravida rutrum quisque. Eget felis eget nunc lobortis. Adipiscing enim eu turpis egestas pretium. Volutpat sed cras ornare arcu. Ac tortor dignissim convallis aenean. Risus nec feugiat in fermentum posuere. Turpis tincidunt id aliquet risus feugiat in ante metus. Vitae nunc sed velit dignissim sodales ut. Tellus elementum sagittis vitae et leo duis ut diam. Nibh praesent tristique magna sit amet purus gravida quis blandit. Ornare suspendisse sed nisi lacus sed. Eu non diam phasellus vestibulum lorem. Amet nisl suscipit adipiscing bibendum est ultricies integer quis auctor. Porta lorem mollis aliquam ut. Condimentum mattis pellentesque id nibh. Ipsum suspendisse ultrices gravida dictum. Consequat semper viverra nam libero justo laoreet sit.
Nunc non blandit massa enim nec dui nunc mattis enim. Ut porttitor leo a diam sollicitudin tempor id. Eget mauris pharetra et ultrices neque ornare aenean. Eu sem integer vitae justo eget magna. Vitae tempus quam pellentesque nec nam aliquam sem et. Aliquet enim tortor at auctor. Nisl nisi scelerisque eu ultrices vitae auctor eu. Fames ac turpis egestas integer eget. Id velit ut tortor pretium viverra suspendisse potenti nullam ac. Dictum varius duis at consectetur lorem. Scelerisque felis imperdiet proin fermentum leo. Id aliquet lectus proin nibh. Diam maecenas ultricies mi eget mauris pharetra. Vulputate enim nulla aliquet porttitor. Dictum sit amet justo donec.
</div></div>
<div class="caption card-footer text-center">
<ul class="list-inline">
<li>
<button #click="edit(index)"><i
class="glyphicon glyphicon-pencil lighter"></i> Edit</button>
</li>
<li>
<button #click="remove(index)"><i
class="glyphicon glyphicon-trash lighter"></i> Remove</button>
</li>
</ul>
</div>
</div>
</div>
<div class="col-sm-4" v-for="(card, index) in cards">
<div v-if="canDisplay(index)" class="thumbnail">
<div class="caption text-center" onclick="">
<div class="position-relative">
<div v-html="getImage(card)">
</div>
</div>
<h4 id="thumbnail-label" v-html="getTextLinkUrl(card)">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" /> Testing
</h4>
<div class="thumbnail-description smaller" v-html="card.description">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</div>
<div class="caption card-footer text-center">
<ul class="list-inline">
<li>
<button #click="edit(index)"><i
class="glyphicon glyphicon-pencil lighter"></i> Edit</button>
</li>
<li>
<button #click="remove(index)"><i
class="glyphicon glyphicon-trash lighter"></i> Remove</button>
</li>
</ul>
</div>
</div>
</div>
</div>

Cards grid with a specific layout

I faced with a problem with the vertical cards position in accordance with the design (image attached). Firstly I tried position it with the flexbox property but seems it's not the right way because it is just move element to the next line in a "natural flow" but I don't need such behaviour. The most closest solution was to set column-count: 2 property to the news__items class in parent container but I can't control the order in this case. I feel like display: grid can help here but can't figure out how to implement it yet. Note: images have the same height and width.
Here is the html and css markup:
.news__items {
column-count: 2;
}
<div class="news__items">
<div class="news__item">
<img src="../img/dummy-news-image.png" alt="news">
<div class="news__item-content">
<h2 class="news__primary-title">Lorem Ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed purus dolor. Phasellus velit libero, dapibus sed felis non, laoreet ornare risus. Morbi imperdiet maximus justo, nec porttitor ligula bibendum non. Aliquam erat volutpat. Sed feugiat
nulla quis mollis egestas. Duis blandit volutpat justo id imperdiet. Maecenas dapibus in quam vitae egestas.</p>
</div>
</div>
<div class="news__item">
<img src="../img/dummy-news-image.png" alt="news">
<div class="news__item-content">
<h3>Lorem ipsum</h3>
<h2 class="news__secondary-title">Lorem ipsum dolor
</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed purus dolor. Phasellus velit libero, dapibus sed felis non, laoreet ornare risus. Morbi imperdiet maximus justo, nec porttitor ligula bibendum non. Aliquam erat volutpat. Sed feugiat
nulla quis mollis egestas. Duis blandit volutpat justo id imperdiet. Maecenas dapibus in quam vitae egestas.</p>
</div>
</div>
<div class="news__item">
<img src="../img/dummy-news-image.png" alt="news">
<div class="news__item-content">
<h3>Lorem ipsum</h3>
<h2 class="news__secondary-title">Lorem ipsum dolor</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed purus dolor. Phasellus velit libero, dapibus sed felis non, laoreet ornare risus. Morbi imperdiet maximus justo, nec porttitor ligula bibendum non. Aliquam erat volutpat. Sed feugiat
nulla quis mollis egestas. Duis blandit volutpat justo id imperdiet. Maecenas dapibus in quam vitae egestas.</p>
</div>
</div>
<div class="news__item">
<img src="../img/dummy-news-image.png" alt="news">
<div class="news__item-content">
<h3>Lorem ipsum</h3>
<h2 class="news__secondary-title">MFF in the News</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed purus dolor. Phasellus velit libero, dapibus sed felis non, laoreet ornare risus. Morbi imperdiet maximus justo, nec porttitor ligula bibendum non. Aliquam erat volutpat. Sed feugiat
nulla quis mollis egestas. Duis blandit volutpat justo id imperdiet. Maecenas dapibus in quam vitae egestas.</p>
</div>
</div>
<div class="news__item">
<img src="../img/dummy-news-image.png" alt="news">
<div class="news__item-content">
<h3>Lorem ipsum</h3>
<h2 class="news__secondary-title">Lorem Ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed purus dolor. Phasellus velit libero, dapibus sed felis non, laoreet ornare risus. Morbi imperdiet maximus justo, nec porttitor ligula bibendum non. Aliquam erat volutpat. Sed feugiat
nulla quis mollis egestas. Duis blandit volutpat justo id imperdiet. Maecenas dapibus in quam vitae egestas.</p>
</div>
</div>
</div>
What is the best approach to implement such grids?
Try this solution.
.news__items {
display: table;
}
.news__item {
width: 50%;
float: left;
}

How to align my multiple collapsible Bootstrap panels nicely?

I want to display a list via "collapsible bootstrap panels" but I notice when I open certain panels they do not align properly.
E.g. when I open the first panel in the code all other panels move under each other under the second panel.
I want panel 3 and 4 to stay on their place in their grid when I open panel 1.
What am I doing wrong?
<div class="container">
<div class="row">
<div class="col-xs-6">
<div>
<a
href="#panel1"
class="btn btn-info"
data-toggle="collapse">Panel 1</a>
</div>
<div
id="panel1"
class="collapse">
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Praesent scelerisque, neque sit amet aliquam pulvinar, metus
arcu commodo sem, id volutpat erat nulla imperdiet enim. Proin
imperdiet dolor vitae lorem efficitur, non tincidunt nisi
accumsan. Nam condimentum mi ac auctor tincidunt. Fusce eget
tempus velit, in porta velit. Mauris vel ultrices ipsum. Nunc
rutrum vitae quam ut porta. Suspendisse diam sem, molestie sed
nisl id, imperdiet ornare libero. Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Nam sagittis augue vitae iaculis
lacinia. Ut id eros egestas turpis vehicula feugiat ut eu
lectus. Ut eu consequat arcu, a porttitor magna.
</p>
</div>
</div>
</div>
<div class="col-xs-6">
<div>
<a
href="#panel2"
class="btn btn-info"
data-toggle="collapse">Panel 2</a>
</div>
<div
id="panel2"
class="collapse">
<div>
<p>Nunc vel lectus sit amet ante imperdiet aliquet non sit amet
felis. Vestibulum rhoncus rutrum ante nec sodales. Aliquam
vitae suscipit orci. Nam dignissim a purus vitae efficitur.
Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas. Nam libero augue,
scelerisque ut rhoncus eu, scelerisque a enim. Vestibulum ante
ipsum primis in faucibus orci luctus et ultrices posuere
cubilia Curae; Ut luctus molestie lectus, ac dictum sem tempor
id.
</p>
</div>
</div>
</div>
<div class="col-xs-6">
<div>
<a
href="#panel3"
class="btn btn-info"
data-toggle="collapse">Panel 3</a>
</div>
<div
id="panel3"
class="collapse">
<div>
<p>Aliquam sit amet convallis nulla, quis dapibus elit. Aliquam
nisl justo, mollis et pulvinar ut, laoreet eu enim. Quisque
maximus scelerisque dui, aliquam posuere dolor consequat ut.
Nullam semper dictum urna et auctor. Donec lacus risus,
sagittis at vestibulum ac, dictum vitae mauris. Duis non velit
congue diam vulputate auctor a et libero. Duis a tortor
lobortis, suscipit orci eu, facilisis eros. Proin et faucibus
tortor, in finibus elit. Morbi suscipit porttitor justo
interdum euismod. In posuere leo velit, non egestas tortor
malesuada sit amet. Phasellus malesuada ultricies massa eget
volutpat.
</p>
</div>
</div>
</div>
<div class="col-xs-6">
<div>
<a
href="#panel4"
class="btn btn-info"
data-toggle="collapse">Panel 4</a>
</div>
<div
id="panel4"
class="collapse">
<div>
<p>Cras interdum dui sit amet nisi porttitor, iaculis cursus
tellus tincidunt. Praesent iaculis eget ipsum sed condimentum.
Fusce aliquam ipsum mauris. Donec laoreet dapibus efficitur.
Quisque in rhoncus dolor. Aliquam erat volutpat. Quisque eget
quam sed velit ultrices pellentesque. Vivamus neque arcu,
vestibulum in neque a, tincidunt sagittis lectus. Nullam nisi
nulla, semper non maximus sed, rutrum vel velit.
</p>
</div>
</div>
</div>
</div>
</div>
**Tyr With this**
<div class="container">
<div class="row">
<div class="col-xs-6">
panel1 Code
</div>
<div class="col-xs-6">
panel2 Code
</div>
</div>
<div class="row">
<div class="col-xs-6">
panel3 Code
</div>
<div class="col-xs-6">
panel4 Code
</div>
</div>
</div>

Text Wrap Around Responsive Image

Is there a way to have text wrap around a responsive image using the bootstrap grid layout? I am trying to avoid the use of media queries. This is essentially what I am going for :
I've tried a lot of different variations of rows and columns to get this to work. Perhaps I am being too stubborn and should just use media queries, but I thought maybe someone out there found a solution via bootstrap grid. Here is what I am currently working with.
<div class="container">
<div class="row">
<div class="col">
<h3>Lorem Ipsum</h3>
</div>
</div>
<div class="row">
<div class="col-md-5 col-lg-4">
<img class="img-fluid" src=https://www.clipartqueen.com/image-files/small-face-silhouette.png alt="Photo of me">
</div>
<div class="col-md-6 col-lg-7">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit ligula nec est aliquet ullamcorper. Suspendisse et semper lectus, vitae pellentesque tortor. Etiam bibendum leo ligula, id aliquam urna interdum ac. In egestas ornare mauris eget rutrum.
Pellentesque viverra suscipit nibh, vitae laoreet diam semper non. <br /><br /> Ut consequat scelerisque molestie. Vivamus vel lacus in ligula varius luctus non at diam. Suspendisse vitae tortor felis. Phasellus rutrum sapien ut lectus
pretium, ut ullamcorper enim dictum. Nam sagittis tempus dignissim.
</p>
</div>
</div>
</div>
You can simply wrap the content with simple float:left
Try this.
.row .col-md-5{float:left;}
.row{max-width:550px;}/*optional*/
<div class="container">
<div class="row">
<div class="col">
<h3>Lorem Ipsum</h3>
</div>
</div>
<div class="row">
<div class="col-md-5 col-lg-4">
<img class="img-fluid" src=https://www.clipartqueen.com/image-files/small-face-silhouette.png alt="Photo of me">
</div>
<div class="col-md-6 col-lg-7">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit ligula nec est aliquet ullamcorper. Suspendisse et semper lectus, vitae pellentesque tortor. Etiam bibendum leo ligula, id aliquam urna interdum ac. In egestas ornare mauris eget rutrum.
Pellentesque viverra suscipit nibh, vitae laoreet diam semper non. <br /><br /> Ut consequat scelerisque molestie. Vivamus vel lacus in ligula varius luctus non at diam. Suspendisse vitae tortor felis. Phasellus rutrum sapien ut lectus
pretium, ut ullamcorper enim dictum. Nam sagittis tempus dignissim.
</p>
</div>
</div>
</div>
PS: I set max-width just to make sure the content is wrapping.
You can make it single column instead of using two column. Bootstrap 4 default float-sm-left, pr-3, pb-3 class to align padding and floating the element. You can adjust the responsive by changing float-sm-left to float-md-left, float-lg-left, float-xl-left based on your requirement.
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<div class="container">
<div class="row">
<div class="col">
<h3>Lorem Ipsum</h3>
</div>
</div>
<div class="row">
<div class="col-md-12">
<img class="img-fluid float-sm-left pr-3 pb-3" src=https://www.clipartqueen.com/image-files/small-face-silhouette.png alt="Photo of me">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit ligula nec est aliquet ullamcorper. Suspendisse et semper lectus, vitae pellentesque tortor. Etiam bibendum leo ligula, id aliquam urna interdum ac. In egestas ornare mauris eget rutrum.
Pellentesque viverra suscipit nibh, vitae laoreet diam semper non. Ut consequat scelerisque molestie. Vivamus vel lacus in ligula varius luctus non at diam. Suspendisse vitae tortor felis. Phasellus rutrum sapien ut lectus pretium, ut ullamcorper enim dictum. Nam sagittis tempus dignissim.<br>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit ligula nec est aliquet ullamcorper. Suspendisse et semper lectus, vitae pellentesque tortor. Etiam bibendum leo ligula, id aliquam urna interdum ac. In egestas ornare mauris eget rutrum.
</p>
</div>
</div>
</div>
<style type="text/css">
#media only screen and (max-width:480px) {
img {
display:block;
float:none;
margin:0 auto 20px !important;
}
}
</style>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body style="margin:0; background:#000;">
<div style="max-width:600px; margin:0 auto; background:#fff; overflow:hidden;">
<div style="Margin:20px;">
<img src="https://www.clipartqueen.com/image-files/small-face-silhouette.png" align="right" width="140" height="140" border="0" style="Margin:0 0 20px 20px; background:#E79851;"/>
<p style="Margin:0; font:16px/1.25 sans-serif; color:#4CB3E8; text-align:justify;">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, aut eligendi dignissimos, illum eaque ut architecto quisquam! Odio, aliquam eligendi iste tempore beatae, deserunt! Officia temporibus at, debitis excepturi porro mollitia aspernatur labore unde dolores quae blanditiis dignissimos error aut iure magnam sed placeat impedit incidunt praesentium natus dolorum. Hic illum vitae iusto aspernatur tempora voluptatem id dolor reiciendis amet ea iste similique fuga, accusamus quibusdam, atque itaque quae sit dolorem asperiores facilis, fugit odio eveniet. Autem iusto nisi, minus sunt fuga quas sed expedita incidunt veniam nobis id ab. Blanditiis ullam laboriosam, quibusdam fugiat repellat labore nulla natus minima at, a veritatis nostrum dignissimos ipsa libero, voluptatem itaque!
</p>
</div>
</div>
</body>
</html>
You can use .float-left to make text wrap around the image:
.mw-25 {
max-width: 25%;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col">
<h3>Lorem Ipsum</h3>
</div>
</div>
<div class="row">
<div class="col">
<div>
<img class="img float-left mw-25 border" src=https://www.clipartqueen.com/image-files/small-face-silhouette.png alt="Photo of me">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit ligula nec est aliquet ullamcorper.</p>
<p>Suspendisse et semper lectus, vitae pellentesque tortor. Etiam bibendum leo ligula, id aliquam urna interdum ac. In egestas ornare mauris eget rutrum.Pellentesque viverra suscipit nibh, vitae laoreet diam semper non.</p>
<p>Ut consequat scelerisque molestie. Vivamus vel lacus in ligula varius luctus non at diam. Suspendisse vitae tortor felis. Phasellus rutrum sapien ut lectus pretium, ut ullamcorper enim dictum. Nam sagittis tempus dignissim.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras blandit ligula nec est aliquet ullamcorper.</p>
<p>Suspendisse et semper lectus, vitae pellentesque tortor. Etiam bibendum leo ligula, id aliquam urna interdum ac.</p>
</div>
</div>
</div>
</div>

How does one do a simple inner container in Twitter Bootstrap?

Here's an image of what I'm trying to accomplish: http://i.imgur.com/XKPuV.png
I want an outside container with a border and an inner container with a gray background. Within the inner container are two blocks: text on the left, image on the right (the elements on either side are of no importance - they can be whatever). Pretty basic stuff.
With the code below, I have my two div's that span 6 columns breaking apart (Here's what it looks like: http://i.imgur.com/BEIVl.png). What's the best way to fix this issue?
<div class="container" style="border: 1px solid gray;height:490px;margin-top:20px;">
<div id="inner-container" style="background:gray;margin:5px;">
<div class="row">
<div class="span6">
<p style="margin:5px;">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
</p>
</div>
<div class="span6">
<p style="margin:5px;">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
</p>
</div>
</div>
</div>
The problem is that you can't specify inline margins and paddings with spanX classes, as these in override boostrap's own padding/margin settings (this is why the 2nd div goes on the next line.
I suggest that you create what you need without using spanX definitions for inner divs. See fiddle: http://jsfiddle.net/periklis/KGMEF/1/

Resources