How do I evenly align my content across 3 columns in bootstrap? - html

As you can see in this image below, my content is not evenly aligned. Is there a way to evenly align my content in Bootstrap? For example, I wish for my images to all be aligned across each column. I dont mind if there is some white space between the paragraph and image.

use a separate .row div for the images below the current .row , and put the same kind of columns/divs with the same classes in there as you currently have for text and images.

Okay, this is a problem I came across early on when working with float-based grid systems.
Here's a sketch of how you might solve the problem with your current grid system in Bootstrap: http://jsbin.com/yolewusuza/
#media screen and (min-width: 992px) {
.content {
position: absolute;
top: 0;
left: 15px;
right: 15px;
bottom: 0;
}
.col-sm-4:after {
padding-bottom: 170%;
content: '';
display: block;
}
.content .image {
position: absolute;
bottom: 0;
left: 0;
right: 0;
}
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<div class="container">
<div class="row">
<div class="col-sm-4">
<div class="content">
<h3>Heading</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Videsne quam sit magna dissensio? Quacumque enim ingredimur, in aliqua historia vestigium ponimus. Quamvis enim depravatae non sint, pravae tamen esse possunt. Negat enim summo bono afferre
incrementum diem. Laboro autem non sine causa; Minime vero istorum quidem, inquit. Duo Reges: constructio interrete.</p>
<div class="image">
<img style="width:100%;" src="https://placeholdit.imgix.net/~text?w=350&h=150">
<p>Image description text</p>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="content">
<h3>Heading</h3>
<p>Animi enim quoque dolores percipiet omnibus partibus maiores quam corporis. Non quaeritur autem quid naturae tuae consentaneum sit, sed quid disciplinae. Ut in geometria, prima si dederis, danda sunt omnia. Potius inflammat, ut coercendi magis
quam dedocendi esse videantur. Ut proverbia non nulla veriora sint quam vestra dogmata. Omnes enim iucundum motum, quo sensus hilaretur. At quicum ioca seria, ut dicitur, quicum arcana, quicum occulta omnia?</p>
<div class="image">
<img style="width:100%;" src="https://placeholdit.imgix.net/~text?w=350&h=150">
<p>Image description text</p>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="content">
<h3>Heading</h3>
<p>Quae est igitur causa istarum angustiarum? Vestri haec verecundius, illi fortasse constantius. Ego vero volo in virtute vim esse quam maximam; Quem Tiberina descensio festo illo die tanto gaudio affecit, quanto L. An dubium est, quin virtus ita
maximam partem optineat in rebus humanis, ut reliquas obruat? Negat esse eam, inquit, propter se expetendam. O magnam vim ingenii causamque iustam, cur nova existeret disciplina! Perge porro.</p>
<p>In qua quid est boni praeter summam voluptatem, et eam sempiternam? Si qua in iis corrigere voluit, deteriora fecit. Perge porro; Quippe: habes enim a rhetoribus; Quis est, qui non oderit libidinosam, protervam adolescentiam? Expectoque quid ad
id, quod quaerebam, respondeas.
</p>
<div class="image">
<img style="width:100%;" src="https://placeholdit.imgix.net/~text?w=350&h=150">
<p>Image description text</p>
</div>
</div>
</div>
</div>
</div>
Adjusting the padding-bottom on the column's newly created pseudo-element to suit your needs. You'll ideally need to limit the excerpt length.

Using the framework's .thumbnail component (with .caption) you can accomplish #Johannes suggestion like below, including adding your own height to the .caption like below. Make sure you adjust your height as required.
.caption{
min-height: 300px;
height: 300px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<div class="row">
<div class="col-xs-4">
<div class="thumbnail">
<div class="caption">
<h3>Thumbnail label</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed commodo sapien vitae turpis pellentesque tempus. Nunc vehicula cursus ultricies. Sed aliquam hendrerit sapien quis blandit. Nam tempus condimentum nunc ac.</p>
</div>
<img src="http://lorempixel.com/300/300" alt="placeholder image">
</div>
</div>
<!-- 2 -->
<div class="col-xs-4">
<div class="thumbnail">
<div class="caption">
<h3>Thumbnail label</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut eget tincidunt justo. Morbi ligula felis, accumsan eu auctor a, vulputate vel justo. Integer sapien nulla, rutrum at metus quis, rutrum porta risus. Vestibulum pulvinar metus nec luctus
euismod. Vivamus faucibus libero non magna vulputate laoreet.</p>
</div>
<img src="http://lorempixel.com/300/300" alt="placeholder image">
</div>
</div>
<!-- 3 -->
<div class="col-xs-4">
<div class="thumbnail">
<div class="caption">
<h3>Thumbnail label</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc nec dui tellus. In imperdiet erat eros, sit amet scelerisque ante efficitur bibendum. Quisque tempor diam.</p>
</div>
<img src="http://lorempixel.com/300/300" alt="placeholder image">
</div>
</div>
</div>

Related

How to put scroller in textarea

Need to get scroller in textarea. Current code not working.
<!doctype html>
<html class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>jQuery asScrollable</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/asScrollable.css">
<style type="text/css">
body {
background-color: #f7f7f7;
}
.section {
padding: 20px;
}
.inner {
margin: 0 auto;
max-width: 960px;
}
.example {
overflow: hidden;
border: 1px solid #e0e0e0;
-webkit-box-shadow: 1px 1px 2px 0px rgba(200, 200, 200, 0.3);
-moz-box-shadow: 1px 1px 2px 0px rgba(200, 200, 200, 0.3);
box-shadow: 1px 1px 2px 0px rgba(200, 200, 200, 0.3);
background-color: #fefefe;
}
.box,
.simple, .special {
height: 200px;
}
</style>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please upgrade your browser to improve your experience.</p>
<![endif]-->
<div>
<div>
<section>
<h3>Vertical Scrollable</h3>
<div>
<div>
<div>
<textarea class="special" style="overflow-y: scroll !important;
border-radius: 25px;
position: relative;
height: 279px;"data-options='{"direction": "vertical", "contentSelector": ">", "containerSelector": ">"}' rows="10" cols="10">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?
</textarea>
</div>
</div>
</div>
</section>
<section>
<h3>Horizontal Scrollable</h3>
<div class="example box" data-options='{"direction": "horizontal", "contentSelector": ">", "containerSelector": ">"}'>
<div>
<div>
<img data-src="holder.js/1500x200/sky" width="2000" />
</div>
</div>
</div>
</section>
<section>
<h3>Both Scrollable</h3>
<div class="example box" data-options='{"direction": "both", "contentSelector": ">", "containerSelector": ">"}'>
<div>
<div>
<img data-src="holder.js/1500x400/sky" width="1500" height="400" />
</div>
</div>
</div>
</section>
<section>
<h3>Both Scrollable With No scroll</h3>
<div class="example box" data-options='{"direction": "both", "contentSelector": ">", "containerSelector": ">"}'>
<div>
<div>
<img data-src="holder.js/100%x200/lava" width="100%" height="200" />
</div>
</div>
</div>
</section>
<section>
<h3>Auto x</h3>
<div class="example box" style="overflow-x: auto; overflow-y: hidden" data-options='{"direction": "auto", "contentSelector": ">", "containerSelector": ">"}'>
<div>
<div>
<img data-src="holder.js/1200x200/vine" width="1200" height="200" />
</div>
</div>
</div>
</section>
<section>
<h3>Auto y</h3>
<div class="example box" style="overflow-y: auto; overflow-x: hidden" data-options='{"direction": "auto", "contentSelector": ">", "containerSelector": ">"}'>
<div>
<div>
<img data-src="holder.js/958x300/vine" width="958" height="300" />
</div>
</div>
</div>
</section>
<section>
<h3>Auto both</h3>
<div class="example box" style="overflow: auto" data-options='{"direction": "auto", "contentSelector": ">", "containerSelector": ">"}'>
<div>
<div>
<img data-src="holder.js/1200x300/vine" width="1200" height="300" />
</div>
</div>
</div>
</section>
<section>
<h3>Auto none</h3>
<div class="example box" data-options='{"direction": "auto", "contentSelector": ">", "containerSelector": ">"}'>
<div>
<div>
<img data-src="holder.js/958x200/lava" width="958" height="200" />
</div>
</div>
</div>
</section>
<section>
<h3>Simple Structure</h3>
<div class="simple example">
<div>
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam malesuada at metus eget sodales. Aenean tincidunt mi sed orci sollicitudin placerat. Nullam tempus nisl augue, sed pulvinar eros lacinia vitae. Mauris vehicula velit a nibh dapibus vehicula. Fusce dui tellus, tincidunt sit amet porttitor efficitur, aliquam ac arcu. Cras non tempor dui. Nunc a dolor sit amet dolor bibendum auctor a eu ipsum.</p>
<p>Pellentesque lobortis facilisis risus, sit amet maximus turpis venenatis vitae. Donec nec eros iaculis, congue risus at, tempus augue. Donec quis felis vel purus pretium tincidunt. Integer sodales ultricies tristique. Phasellus et risus sagittis, dictum tortor a, semper lorem. Vivamus quis ipsum velit. Nam molestie ut ipsum ultricies volutpat. Integer molestie sagittis tempor. Integer vitae mauris est. Ut laoreet dignissim tellus, non accumsan erat gravida vel. Curabitur non erat id velit aliquam malesuada. Proin aliquet cursus orci quis pulvinar.</p>
<p>Duis elit massa, scelerisque sed nisl sed, tempus iaculis felis. Duis accumsan eget justo id auctor. Aliquam consequat odio non dolor efficitur, hendrerit porttitor neque porttitor. Integer varius maximus nunc, at malesuada leo tristique id. Sed aliquet pharetra ipsum, non interdum lacus dictum sit amet. Curabitur semper imperdiet sem eget interdum. Nunc at egestas tellus, vel tincidunt lacus. Fusce eget neque vel leo volutpat tincidunt ac non enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vivamus cursus leo in felis viverra interdum.</p>
<p>Mauris id ultricies magna. Quisque rutrum lobortis elit blandit rutrum. Curabitur mattis enim lorem, eget tempor nunc pretium dignissim. Cras tincidunt ac nisl eget finibus. Fusce lobortis turpis sed dui mollis, eget fringilla risus porttitor. In id neque vitae lorem pharetra sodales. Morbi neque ex, mattis at dolor quis, consequat tincidunt leo. Vivamus sagittis placerat sem at porta.</p>
<p>Proin varius arcu ac ligula suscipit, sit amet pretium lectus tincidunt. Aliquam eu mi imperdiet, efficitur tellus ac, mollis eros. Cras malesuada feugiat pharetra. Curabitur lectus lacus, bibendum sed odio at, egestas tempor nisl. Vivamus sagittis est porta velit pretium, in elementum arcu tempus. Ut id cursus libero, non ullamcorper velit. Cras pretium arcu lacus, nec dignissim elit accumsan vitae. Aliquam tristique lorem et tempus congue. Donec vel metus enim. Praesent sed turpis et magna suscipit tincidunt. Proin efficitur neque non sapien cursus vehicula. Suspendisse iaculis, neque vel convallis lobortis, mauris dui posuere mi, at maximus lorem tortor a metus. Ut in quam efficitur, finibus nulla et, feugiat orci.</p>
<p>Sed mattis volutpat enim eget porttitor. Sed lectus ligula, condimentum nec elit eget, vehicula porttitor nunc. Curabitur pulvinar leo velit, a convallis tellus suscipit ac. Donec tempor est ut sagittis varius. Mauris maximus nunc metus, non venenatis justo ornare vel. Phasellus iaculis erat sit amet enim fermentum mattis. Cras sollicitudin tortor dolor, ac aliquam dolor iaculis non. Donec sed sodales enim. Suspendisse potenti. Integer quis turpis cursus enim consectetur fringilla eu eu ante.</p>
</div>
</div>
</div>
</section>
<section>
<div>
<button class="api-scroll-to" data-to="0">Scroll to 0</button>
<button class="api-scroll-to" data-to="50">Scroll to 50</button>
<button class="api-scroll-to" data-to="0%">Scroll to 0%</button>
<button class="api-scroll-to" data-to="100%">Scroll to 100%</button>
<button class="api-scroll-to" data-to="50%">Scroll to 50%</button>
</div>
<div>
<button class="api-scroll-by" data-by="10">Scroll by 10</button>
<button class="api-scroll-by" data-by="+10">Scroll by +10</button>
<button class="api-scroll-by" data-by="-10">Scroll by -10</button>
<button class="api-scroll-by" data-by="10%">Scroll by 10%</button>
<button class="api-scroll-by" data-by="+10%">Scroll by +10%</button>
<button class="api-scroll-by" data-by="-10%">Scroll by -10%</button>
</div>
<div>
<button class="api-init">Init</button>
<button class="api-enable">enable</button>
<button class="api-disable">disable</button>
<button class="api-destroy">Destroy</button>
</div>
</section>
</div>
</div>
<script src="js/jquery.js"></script>
<script src="js/holder.js"></script>
<script src="js/jquery-asScrollbar.js"></script>
<script src="js/jquery-asScrollable.js"></script>
<script type="text/javascript">
jQuery(function($) {
Holder.run();
$('.box').asScrollable();
jQuery(function($) {
$('.special').asScrollable();
});
$('.simple').asScrollable({
contentSelector: ">",
containerSelector: ">"
});
$('.box').on('asScrollable::scrolltop', function(e, api, direction) {
console.info('top:' + direction);
});
$('.box').on('asScrollable::scrollend', function(e, api, direction) {
console.info('end:' + direction);
});
$('.api-scroll-to').on('click', function() {
var to = $(this).data('to');
$('.simple').asScrollable('scrollTo', 'vertical', to);
$('.simple').asScrollable('scrollTo', 'horizontal', to);
});
$('.api-scroll-by').on('click', function() {
var to = $(this).data('by');
$('.simple').asScrollable('scrollBy', 'horizontal', to);
$('.simple').asScrollable('scrollBy', 'vertical', to);
});
$('.api-init').on('click', function() {
$('.simple').asScrollable({
contentSelector: ">",
containerSelector: ">"
});
});
$('.api-enable').on('click', function() {
$('.simple').asScrollable('enable');
});
$('.api-disable').on('click', function() {
$('.simple').asScrollable('disable');
});
$('.api-destroy').on('click', function() {
$('.simple').asScrollable('destroy');
});
});
</script>
</body>
</html>
Here is the example.
Please help.
Thanks
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.
#Nate. Please add below style.
.asScrollable-content {
box-sizing: border-box;
padding-right: 30px;
}
It's due to box-sizing property.
Hope this helps. Happy coding~ :)
I tried this on your vertical scrollable section and i think it did what you wanted.
Set a padding of your liking to the div after h3 vertical scrollable
and for the asScrollable-container div take off the width: 975px;
and the text should be able to scale with the padding you want and the scrollbar will not overlap with the text

Bootstrap classes for positioning

What class i need to use to place second button on the same line with first button. I am using bootstrap 4.
<div class="container">
<div class="row justify-content-sm-center">
<div class="col-sm-5 kappa">
<h3>Don't have an account?</h3>
<hr>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Rem quasi facere officiis numquam alias, delectus beatae autem facilis aliquid voluptates aspernatur, eaque suscipit possimus eveniet praesentium explicabo itaque nulla distinctio.
</p>
<button type="button">sign up</button>
</div>
<div class="col-sm-5 kappa">
<h3>Have an account?</h3>
<hr>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit!
</p>
<button type="button" class="">login</button>
</div>
</div>
</div>
Since there is no code provided, assuming you are using Bootstrap 4 and apply flexbox css, in Bootstrap 4 the class is call .d-flex. After you apply .d-flex to parent all the direct descendant can be align easily using margin. In Bootstrap 4 it is call mt-auto and mb-0.
.bigcontainer{
height:300px;
background:grey;
width:40%;
float:left;
margin:10px;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<div class="bigcontainer d-flex flex-column">
<div>Title</div>
<div>Sed orci purus, porta ac feugiat ut, tincidunt vel libero. Aenean ultricies porta magna in ultricies. Fusce vitae felis augue.Quisque semper eleifend odio eget feugiat. Curabitur id mi tristique, ultrices lectus quis, gravida tortor..</div>
<div class="mt-auto mb-0"><button>button</button></div>
</div>
<div class="bigcontainer d-flex flex-column">
<div>Title</div>
<div>Sed orci purus, porta ac feugiat ut, tincidunt vel libero. Aenean ultricies porta magna in ultricies. Fusce vitae felis augue. </div>
<div class="mt-auto mb-0"><button>button</button></div>
</div>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
<style>
.cs-button {
position: absolute;
bottom: 0;
margin-bottom: 20px;
}
</style>
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" style="height: 200px;">
<div>Title</div>
<div>Sed orci purus, porta ac feugiat ut, tincidunt vel libero. Aenean ultricies porta magna in ultricies. Fusce vitae felis augue.Quisque semper eleifend odio eget feugiat. Curabitur id mi tristique, ultrices lectus quis, gravida tortor..</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 cs-button" style="padding:0" >
<div class="mt-auto mb-0"><button>button</button></div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12" style="height: 200px;">
<div>Title</div>
<div>Sed orci purus, porta ac feugiat ut, tincidunt vel libero. Aenean ultricies porta magna in ultricies. Fusce vitae felis augue. </div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 cs-button" style="padding:0">
<div class="mt-auto mb-0"><button>button</button></div>
</div>
</div>
</div>
</div>

Align the text on the right side of an image having float left in a container

I want to create a "card" for an element, it will have an image, a title, a sub-title and a description, what I want is that the card should be aligned to the left (attached to the left border) but when I float the text to the right I get this behavior.. And the position of the card depends on the max width I set the text. How can I fix this?
This is the JSFiddle to show the whole code:
This is the code I used to create the cards
<div class="first__section">
<div class="inner">
<div class="schede__container">
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
</div>
</div>
</div>
Try this
Html:
<div class="first__section">
<div class="inner">
<div class="schede__container">
<div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
</div>
</div>
</div>
CSS:
.schede__container {
border-left:1px solid #343333;
}
.scheda__realizzazione {
text-align: left;
display:inline-block;
margin:40px 0 40px 20px;
padding:40px 0 40px 20px;
border-bottom:1px solid #343333;
}
.div-img {
float: left;
}
.scheda__content {
display: inline-block;
margin-left: 20px;
max-width: 313px;
vertical-align: top;
}
.scheda__content h1 {
color:#5C5A5B;
text-transform:uppercase;
font-size:20px;
}
.scheda__content h2 {
color:#5C5A5B;
font-size:20px;
margin-top: -6px;
}
.scheda__content p {
color:#5C5A5B;
text-transform: lowercase;
}
.first__section {
width:100%;
text-align:center;
background-color:white;
}
.inner {
max-width: 1024px;
margin: 0 auto;
position: relative;
}
demo http://jsfiddle.net/JentiDabhi/256oxh52/
You need to change some properties in the following CSS classes to achieve your target.
First of all put the image in separate div and content in separate div.
<div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
Add width to your .div_img class that your images needs.
.div-img {
float: left;
width: 150px;
}
Secondly you only need to set the margin-left in the .scheda__content class and remove all other styles in it. margin-left : 150px; will do the trick for you but I set it to margin-left: 160px; for some clarity.
.scheda__content {
margin-left: 160px;
}
Working JSFiddle Demo Here.
.schede__container {
border-left: 1px solid #343333;
}
.scheda__realizzazione {
text-align: left;
display: inline-block;
margin: 40px 0 40px 20px;
padding: 40px 0 40px 20px;
border-bottom: 1px solid #343333;
}
.div-img {
float: left;
width: 150px;
}
.scheda__content {
margin-left: 160px;
}
.scheda__content h1 {
color: #5C5A5B;
text-transform: uppercase;
font-size: 20px;
}
.scheda__content h2 {
color: #5C5A5B;
font-size: 20px;
margin-top: -6px;
}
.scheda__content p {
color: #5C5A5B;
text-transform: lowercase;
}
.first__section {
width: 100%;
text-align: center;
background-color: white;
}
.inner {
max-width: 1024px;
margin: 0 auto;
position: relative;
}
<div class="first__section">
<div class="inner">
<div class="schede__container">
<div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
<div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div><div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div><div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div><div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div><div class="scheda__realizzazione">
<div class="div-img">
<img class="scheda__img" src="http://placehold.it/150x150" alt="">
</div>
<div class="scheda__content">
<h1>test</h1>
<h2>test</h2>
<p>LOREM IPSUM DOLOR SIT AMET, CONSECTETUR ADIPISCING ELIT. MAECENAS SUSCIPIT LIBERO ARCU, EU LAOREET ORCI TINCIDUNT NEC. MORBI NEC JUSTO VEL NULLA SOLLICITUDIN ACCUMSAN VITAE QUIS ENIM.</p>
</div>
</div>
</div>
</div>
</div>

Bootstrap columns re-sizing to single row when it shouldn't

I am teaching myself how to use Bootstrap columns, ran into a small problem.
When I resize my browser to the smallest size possible (or even halfway through, really) to make the css kick in the columns, instead of resizing to fit in 4 images for row it just becomes a single string of images like so:
Here is my html, I am using bootstrap 3. Any help would be appreciated.
<section class="container" style="padding-bottom: 60px;">
<div class="row">
<div class="col-md-6">
<h2>Passion, precision and simplicity</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla,
commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Ut enim massa, sodales tempor
convallis et, iaculis ac massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Ut enim massa,
sodales tempor convallis et, iaculis ac massa.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla,
<strong>commodo a sodales sed</strong>, dignissim pretium nunc. Nam et lacus neque.
Ut enim massa, sodales tempor convallis et, <strong>iaculis ac massa</strong>.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed,
dignissim pretium nunc. Nam et lacus neque. Ut enim massa, sodales tempor convallis
et, iaculis ac massa.
</p>
<!-- divider -->
<div class="divider styleColor">
<i class="fa fa-leaf"></i>
</div>
<!-- brands -->
<div class="row">
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/1.jpg" alt="">
</div>
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/2.jpg" alt="">
</div>
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/3.jpg" alt="">
</div>
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/4.jpg" alt="">
</div>
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/5.jpg" alt="">
</div>
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/6.jpg" alt="">
</div>
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/7.jpg" alt="">
</div>
<div class="col-md-3">
<img class="img-responsive" src="../assets/images/demo/brands/8.jpg" alt="">
</div>
</div>
</div>
<div class="col-md-6">
<div>
<img alt="" class="img-responsive" src="../assets/images/demo/people/woman.jpg">
</div>
</div>
</div>
</section>
Use the smaller breakpoints like col-sm-* to make the vertical stacking happen at a narrower width. Or, you can use col-xs-* to make the columns never stack.
http://bootply.com/4JKga3vGjl
Note: Contrary to popular opinion, there's no problem having columns that total more than 12 units in a single row. It simply causes the row to wrap. From the docs (http://getbootstrap.com/css/#grid)..
"If more than 12 columns are placed within a single row, each group of
extra columns will, as one unit, wrap onto a new line"
I suggest you to take a look at the doc.
Rows must be placed within a .container (fixed-width) or .container-fluid (full-width) for proper alignment and padding.
And in a row, you should have only, on total, the number 12.
Like 4 times col-md-3, or 2x4+2x2, etc
In your case, that could be something like this.
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<section class="container" style="padding-bottom: 60px;">
<div class="row">
<div class="col-md-6">
<h2>Passion, precision and simplicity</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla,
commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Ut enim massa, sodales tempor
convallis et, iaculis ac massa. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Ut enim massa,
sodales tempor convallis et, iaculis ac massa.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla,
<strong>commodo a sodales sed</strong>, dignissim pretium nunc. Nam et lacus neque.
Ut enim massa, sodales tempor convallis et, <strong>iaculis ac massa</strong>.
</p>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed,
dignissim pretium nunc. Nam et lacus neque. Ut enim massa, sodales tempor convallis
et, iaculis ac massa.
</p>
<!-- divider -->
<div class="divider styleColor">
<i class="fa fa-leaf"></i>
</div>
<!-- brands -->
<div class="row">
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/1.jpg" alt="">
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/2.jpg" alt="">
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/3.jpg" alt="">
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/4.jpg" alt="">
</div>
</div>
<div class="row">
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/5.jpg" alt="">
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/6.jpg" alt="">
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/7.jpg" alt="">
</div>
<div class="col-md-3 col-sm-3 col-xs-3">
<img class="img-responsive" src="../assets/images/demo/brands/8.jpg" alt="">
</div>
</div>
</div>
<div class="col-md-6">
<div>
<img alt="" class="img-responsive" src="../assets/images/demo/people/woman.jpg">
</div>
</div>
</div>
</section>
It seems that you need to add col-sm-3 and col-xs-3 in addition to col-md-3, to handle your columns in lower sizes.
Check this bootply.
you are using the classes "col-md-..." this targets medium devices.
To set up your layout for smaller devices use "col-xs"
Note, that you can use both "col-xs-12 col-md-6" will display the element in 100% width on small devices and 50% width on medium devices and up.
In the bootstrap grid system, there are only 12 colums per row.
you are trying to use only 12 per row.
check out http://getbootstrap.com/css/#grid-example-basic

Why my columns doesn't enlarge to the container height?

I want the left and right columns enlarge to the center column height, but they doesn't expand and the layout is terrible.
I need a simple three columns layout but I don't want a fixed dimensions in pixels nor ems.
HTML code:
<div id="contenedor">
<div class="bloque" id="head">
Cabecera
</div>
<div class="bloque" id="left">
Bloque-2
</div>
<div id="contenido">
<div class="bloque" id="center">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ut justo sed nisl commodo imperdiet vitae molestie orci. Cras urna sem, malesuada et feugiat sed, accumsan nec dolor. Vivamus hendrerit ante non urna bibendum, et tristique libero ultrices. Phasellus auctor tempor leo, quis pretium nisl posuere sit amet. Vestibulum eget erat dolor. Integer venenatis eu libero ac pharetra. Nullam nec ligula et quam bibendum semper. Phasellus ...
</div>
<div class="bloque" id="right">
Bloque-3
</div>
</div>
<div class="bloque" id="foot">
Pie
</div>
</div>
CSS code:
#contenedor {
background-color: #EEE;
width: 100%;
height: 100%;
}
.bloque {
background-color: #CCC;
}
#head {
width: 100%
height: 10%;
text-align: center;
}
#left {
width: 25%;
float: left;
min-height: 85%;
}
#right {
width: 20%;
float: left;
min-height: 85%;
}
#center {
width: 55%;
float: left;
background-color: #FFF;
}
#foot {
clear: both;
text-align: center;
min-height: 5%;
}
CSSDeck.com
I have updated your code and used a trick to get the result.
UPATED CODE
I hope that my answer will help you
HTML
<div id="container">
<div id="header">header</div>
<div id="nav">
<p>link 1</p>
<p>link 2</p>
<p>link 3</p>
</div>
<div id="aside">
<h3>text</h3>
<p>text2</p>
<p>text3</p>
<p>text4</p>
</div>
<div id="content">
<h2>head text</h2>
<ul>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe qui possimus maxime iste voluptates. Alias assumenda maiores voluptates unde minus rerum possimus velit itaque nesciunt explicabo perferendis at fugit facilis!</li>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe qui possimus maxime iste voluptates. Alias assumenda maiores voluptates unde minus rerum possimus velit itaque nesciunt explicabo perferendis at fugit facilis!</li>
<li>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe qui possimus maxime iste voluptates. Alias assumenda maiores voluptates unde minus rerum possimus velit itaque nesciunt explicabo perferendis at fugit facilis!</li>
</ul>
</div>
<div id="footer">© user</div>
</div>
DEMO
Just add in your css
html, body
{
height:100%;
}
and you you could set height of your div left and right in pourcentage at your own desire...
and
<div id="contenedor">
<div class="bloque" id="head">
Cabecera
</div>
<div class="bloque" id="left">
Bloque-2
</div>
<div id="contenido">
<div class="bloque" id="center">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque ut justo sed nisl commodo imperdiet vitae molestie orci. Cras urna sem, malesuada et feugiat sed, accumsan nec dolor. Vivamus hendrerit ante non urna bibendum, et tristique libero ultrices. Phasellus auctor tempor leo, quis pretium nisl posuere sit amet. Vestibulum eget erat dolor. Integer venenatis eu libero ac pharetra. Nullam nec ligula et quam bibendum semper. Phasellus ...
</div>
</div>
<div class="bloque" id="right">
Bloque-3
</div>
<div class="bloque" id="foot">
Pie
</div>
</div>