I got a problem, When I try create a div with a scrool in my page.
What it is happen: if I resize the browser upwards. my scroll dissapear and hides in the footer.
I would like to the height be responsible and not hide under the footer if the user resize it upwards.
right now if the user resize it upwards we can't see the end of scroll and the arrow to navigate. I would like it follow the browser if the user resize it.
if you see in my code that page will not have scrool in the right but I commentend it because the sample
was not working at jsfiddle.
I hope I was clear.
html:
<!--[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]-->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Project name</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<form class="navbar-form navbar-right" role="form">
<div class="form-group">
<input type="text" placeholder="Email" class="form-control">
</div>
<div class="form-group">
<input type="password" placeholder="Password" class="form-control">
</div>
<button type="submit" class="btn btn-success">Sign in</button>
</form>
</div><!--/.navbar-collapse -->
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>Hello, world!</h1>
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p>
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a></p>
</div>
</div>
<div class="scroll">
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
</div>
<hr>
<footer style="background-color:black;" class="footer navbar-fixed-bottom navbar-relative-bottom-sm">
<p>© Company 2015</p>
</footer>
css:
.scroll {
overflow-y: scroll;
border: 1px solid red;
padding-bottom: 200px;
height: 60%;
margin-bottom:30px;
}
/* body {
overflow-y:hidden;
} */
jsfiddle: https://jsfiddle.net/qLgnsoqv/1/
Related
I have a psd template that i would like to convert to a responsive site using bootstrap.
The template width is 1920px and the bootstrap grid is a 1170px bootstrap grid with 12columns with 15px margins left and right.
But in the design some things like the logo in this example and a part of the menu stands out of the grid, how do i interpret this design then? Or is this wrong design? Am I correct if i think the design should be between the columns?
template
Generally, the menu and logo are included in the <nav> which comes before <div class="container">
<nav class="navbar navbar-toggleable-md navbar-inverse fixed-top bg-inverse">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#">Navbar</a>
</div>
</nav>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-4">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
</div>
<hr>
<footer>
<p>© Company 2017</p>
</footer>
So the grid width is only referring to the width of the content in the container.
I have a vertical navbar which serves as a menu in my asp.net MVC5 project. In a css stylesheet I defined it's position:fixed; to be able to see it all the time. On the other part of my web page I have a partial view that changes according to menu selection. My problem is that when the partial view is too large, when I horizontally scroll to see what's missing, the text overlaps with the navbar.
Here is a sample from my navbar in a file called _Menu.cshtml:
<div class="sidebar-nav">
<div class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="visible-xs navbar-brand">Sidebar menu</span>
</div>
<div class="navbar-collapse collapse sidebar-navbar-collapse">
<ul class="nav navbar-nav" id="sidenav01">
<li class="active">
<a href="#" data-toggle="collapse" data-target="#toggleDoc" data-parent="#sidenav01" class="collapsed">
<span class="glyphicon glyphicon-folder-close"></span> Documentation <span class="caret pull-right"></span>
</a>
<div class="collapse" id="toggleDoc" style="height: 0px;">
<ul class="nav nav-list">
<li>Documentation 1.1</li>
<li>Documentation 1.2</li>
<li>Documentation 1.3</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
In the _Layout.cshtml, I have the following inside of <body> tag :
<div class="container-fluid">
<div class="row affix-row">
<div class="col-sm-4 col-md-4 col-lg-4 col-xl-4 affix-sidebar">
#Html.Partial("~/Views/PartialViews/_Menu.cshtml")
</div>
<div class="col-sm-8 col-md-8 col-lg-8 col-xl-8">
#RenderBody()
</div>
</div>
</div>
Finally the css:
.sidebar-nav{
position: fixed; //Center works but then my navbar is not fixed anymore!
}
I use bootstrap to separate both parts of my page, hence having the menu on the left, and the body (or partial views of menu links) on the right. I know that making the navbar position different will solve the problem. But I'd like to have a fixed navbar, that would not be fixed horizontally OR have the text on the right part of my page go behind the navbar. Any ideas on how to do this?
Here's what it looks like (note the IpAdress doesn't show, so page isn't filled really, and please admire my drawing skills :p)
You might want to try using a z-index, or use a filler div, that will act as a spacer at the top between your content and your menu. Example below.
.sidebar-nav{
position: fixed; //Center works but then my navbar is not fixed anymore!
width: 100%;
z-index: 1;
}
#filler {
display: block;
height: 50px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="sidebar-nav">
<div class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="visible-xs navbar-brand">Sidebar menu</span>
</div>
<div class="navbar-collapse collapse sidebar-navbar-collapse">
<ul class="nav navbar-nav" id="sidenav01">
<li class="active">
<a href="#" data-toggle="collapse" data-target="#toggleDoc" data-parent="#sidenav01" class="collapsed">
<span class="glyphicon glyphicon-folder-close"></span> Documentation <span class="caret pull-right"></span>
</a>
<div class="collapse" id="toggleDoc" style="height: 0px;">
<ul class="nav nav-list">
<li>Documentation 1.1</li>
<li>Documentation 1.2</li>
<li>Documentation 1.3</li>
</ul>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row affix-row">
<div id="filler"></div>
<div iclass="col-sm-4 col-md-4 col-lg-4 col-xl-4 affix-sidebar">
<!-- #Html.Partial("~/Views/PartialViews/_Menu.cshtml") -->
<p>Bunchotext</p>
</div>
<div class="col-sm-8 col-md-8 col-lg-8 col-xl-8">
<!-- #RenderBody() -->
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam vitae semper tortor, non efficitur nulla. Pellentesque elementum augue arcu, quis fermentum elit vestibulum eu. Curabitur ornare volutpat turpis, vitae pellentesque ex commodo lacinia. Sed venenatis dui nisi, sed feugiat dui hendrerit a. Nullam rutrum libero at mauris pellentesque bibendum. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vestibulum volutpat efficitur arcu, nec eleifend ante consectetur vitae.
In hac habitasse platea dictumst. Ut ornare, nisl non pharetra ultricies, arcu sapien porttitor ligula, vitae pellentesque diam tellus vitae urna. Sed eget tempus orci, sit amet egestas nisl. Nam sed aliquet ex, vel consequat magna. Aliquam enim diam, sollicitudin ut metus ut, accumsan dictum nunc. Phasellus dictum ultrices leo, tempus elementum nisl commodo eu. Ut efficitur turpis id dui accumsan lobortis. Fusce semper venenatis orci in dapibus. Ut id dolor et diam sagittis mollis. Nam vulputate tincidunt enim, vel facilisis leo ultricies eget. Mauris accumsan at diam id imperdiet. Integer gravida, nisi eget accumsan consectetur, purus quam suscipit est, maximus ullamcorper lectus lorem non velit. In interdum nec lectus et luctus. Donec congue malesuada tellus, vel auctor magna egestas non.
Nulla hendrerit, velit a euismod blandit, enim ex ultricies elit, ac aliquam massa tortor vitae erat. Mauris rutrum hendrerit nisl vel finibus. Sed aliquam eget arcu eget egestas. Nullam a auctor ante. Donec a nibh fringilla, ornare nibh ac, posuere felis. Pellentesque condimentum suscipit vestibulum. Fusce quis sapien non ex mattis ultricies et sit amet metus. Phasellus at nunc sollicitudin, tristique nunc eget, sodales augue. Praesent sagittis justo eget placerat feugiat.
Fusce aliquet enim eget venenatis fringilla. Suspendisse imperdiet, tellus eu pretium fringilla, ligula ante fermentum dui, in venenatis erat risus nec erat. Curabitur libero dolor, semper eu eros sit amet, eleifend accumsan diam. Fusce dui ante, pellentesque vitae nisl at, dapibus consectetur arcu. Mauris rhoncus nisl nec leo sollicitudin, eu fermentum nisi sodales. Quisque magna dolor, consequat sed ultricies dignissim, ullamcorper eu dui. Fusce vitae est sed augue ornare finibus. Aenean a eleifend ipsum. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nunc dapibus malesuada nulla ac dignissim. Nulla scelerisque diam vel neque consequat, tempus facilisis eros tempor. Ut pellentesque urna vitae tellus imperdiet, a sagittis ipsum condimentum. Nullam in purus ut nisl porttitor porttitor nec eget metus. Sed maximus nisl arcu. Suspendisse ut egestas ipsum, ut varius nisi.
Nulla lacus neque, suscipit quis odio ac, accumsan molestie nisi. Vestibulum quam quam, bibendum non velit eu, faucibus laoreet sem. Aliquam auctor rhoncus ultrices. Nullam a sem sagittis, accumsan risus eu, auctor nisl. Nam vestibulum lobortis sagittis. Nunc vel ultricies sem, et convallis nulla. Mauris elementum imperdiet lorem, non maximus enim. Suspendisse dictum turpis massa, at bibendum neque ultrices ac. Sed sodales tempor augue et molestie. </p>
</div>
</div>
</div>
I want to get the column on the right marked in red (see attached image) to be cable of expanding further down the page without affecting the layout of the row at the bottom other stories. I'm using bootstrap and every time I put more text into this the entire grid moves down. Should I be using span instead of columns?
Heres the code I got so far.
<div class="container">
<div class="row">
<div class="span1">
<h6 class="text-center" style='font-family: "DroidSerif",serif;'>Here's Why 9/11 Conspiracy</h6>
</div>
<div class="text-center">
<h9 class="span10">Newspaper</h9>
</div>
<div class="span1">
<h6 class="text-center">Here's Why 9/11 Conspiracy</h6>
</div>
</div>
<hr style="height:0.3em;" color= '#000000' />
<hr>
<div class="row">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<div class="span4">
<h4 class="text-center">Here's Why 9/11 Conspiracy Theories Still Thrive In America</h4>
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Mr.Man</i></h5>
<hr>
<p style='font-family: "DroidSerif",serif;'><span class="firstcharacter">D</span>ublin, It was a sunny and clear Tuesday morning in Knoxville, Tennessee. Sitting in the kitchen of my girlfriend's apartment, I was eating a bowl of cereal -- Honey Nut Cheerios, I still remember -- and browsing the web before making the 15-minute drive to campus for class.
</p>
</div>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<div class="span6">
<h1 style='font-family: "DroidSerif",serif;'>Terrorists are plotting to blow up five planes</h1>
<p><b>The threat has been taken so seriously it came close to leading to an outright ban on all hand luggage, a senior insider has revealed.
</b></p>
</div>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<div class="span2">
<h4 style='font-family: "DroidSerif",serif;'>Trending Stories</h4>
<hr>
<h5 style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<story>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit <b> amet risus.</b></story>
<h5 style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<story>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. <b> amet risus.</b></story>
<h5 style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<story>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.<b> amet risus.</b></story>
</div>
</div>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!-- Fav and touch icons -->
<div class="row">
<hr class="span10" style="height:0.3em;" color= '#3090C7' />
</div>
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<div class="row" class="span10">
<div class="span2">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non </p>
</div>
<div class="span2">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non </p>
</div>
<div class="span2">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non </p>
</div>
<div class="span2">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non </p>
</div>
<div class="span2">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non </p>
</div>
</div>
</div>
Bootstrap's pretty simple to use, don't worry you'll get it.
All you need to do is to create a row with 2 columns (.col-sm-10), one as to fill in the left content of the image and the second is for the red box of yours (.col-sm-2). The main motive here is to create a 12 column grid system.
Then in the first columns make another row and add 2 Columns again, one for the 9/11 Conspiracy news and the other for the terrorists are plotting news
And now comes your blue <hr> seperator and after that create another row and add 4 columns for other stories section
I've used the most popular bootstrap version 3.3.1 to demonstrate your solution.
Fiddle Demo : http://jsfiddle.net/auy5y8e1/
Resize the fiddle window to see if its working fine...
HTML:
<div class="container">
<div class="row">
<div class="col-sm-10">
<div class="row">
<div class="span1">
<h6 class="text-center" style='font-family: "DroidSerif",serif;'>Here's Why 9/11 Conspiracy</h6>
</div>
<div class="text-center">
<h9 class="span10">Newspaper</h9>
</div>
<div class="span1">
<h6 class="text-center">Here's Why 9/11 Conspiracy</h6>
</div>
</div>
<hr style="height:0.3em;" color='#000000' />
<div class="row">
<div class="col-sm-6">
<h4 class="text-center">Here's Why 9/11 Conspiracy Theories Still Thrive In America</h4>
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Mr.Man</i></h5>
<hr>
<p style='font-family: "DroidSerif",serif;'><span class="firstcharacter">D</span>ublin, It was a sunny and clear Tuesday morning in Knoxville, Tennessee. Sitting in the kitchen of my girlfriend's apartment, I was eating a bowl of cereal -- Honey Nut Cheerios, I still remember -- and browsing the web before making the 15-minute drive to campus for class.</p>
</div>
<div class="col-sm-6">
<h1 style='font-family: "DroidSerif",serif;'>Terrorists are plotting to blow up five planes</h1>
<p><b>The threat has been taken so seriously it came close to leading to an outright ban on all hand luggage, a senior insider has revealed.</b></p>
</div>
</div>
<div class="row">
<hr class="span10" style="height:0.3em;" color='#3090C7' />
</div>
<div class="row">
<div class="col-sm-3">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non</p>
</div>
<div class="col-sm-3">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non</p>
</div>
<div class="col-sm-3">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non</p>
</div>
<div class="col-sm-3">
<h5 class="text-center" style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Donec id elit non</p>
</div>
</div>
</div>
<div class="col-sm-2">
<div>
<h4 style='font-family: "DroidSerif",serif;'>Trending Stories</h4>
<hr>
</div>
<h5 style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<story>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit <b> amet risus.</b></story> <h5 style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<story>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. <b> amet risus.</b></story>
<h5 style='font-family: "DroidSerif",serif;'><i>Other Story</i></h5>
<story>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper.<b> amet risus.</b></story>
</div>
</div>
</div>
This is my code: http://www.bootply.com/ZZw7dYczJD
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-3">
<img src="..." class="img-responsive" alt="Responsive image">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-3">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-3">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
<div class="col-md-3">
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a></p>
</div>
</div>
</div>
At the moment my image appears on the top of my row content but I want it to appear to the left. Can anyone tell me how I might implement it please, do I need another column for the image?
Wrap the image in its own col-md-2 or if it's smaller then its own col-md-1. For centering purposes you may want to add a col-md-offset-1 to the image.
You will have to adjust the width of the other columns so that you do not exceed 12 units across among all of the columns.
Bootply Example
May be I'm missing something.. I'm following the Off Canvas Template of bootstrap and I wonder I can get the Items/cards stacked in a correct manner.. by that I mean without spaces up or down it when their content is uneven.
Check this image to see what I mean.. I thought col-x would solve this issue.. but it doesn't
If I'm unclear on my question please let me know.
This is the sample code:
<div class="row">
<div class="col-6 col-sm-6 col-lg-4">
......
</div><!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
.....
</div><!--/span-->
Adding an example of what I'm saying: http://www.bootply.com/121097
thanks!
Are you trying to accomplish a 'pinterest' or 'masonary' style layout?
If so, here are three of many ways to do this...
1.
Use masonary.js
http://masonry.desandro.com/
2.
Or you could code your own js function. A really good resource can be found here (an answer by the fellow who started this madness, a front-end dev for pinterest):
http://www.quora.com/Pinterest/What-technology-is-used-to-generate-pinterest-coms-absolute-div-stacking-layout
3.
Or you can do this with css, using css3 column. Take a look at the example here (although this does not solve for your layout exactly):
http://jsfiddle.net/jalbertbowdenii/7Chkz/
-moz-column-count:3;
-moz-column-gap: 3%;
-moz-column-width: 30%;
-webkit-column-count:3;
-webkit-column-gap: 3%;
-webkit-column-width: 30%;
column-count: 3;
column-gap: 3%;
column-width: 30%;
After watching your code, probably how i would have done it is like having 3 column vertical layout which will be in a row. Now in these columns you can place your div with heading and details and the will be automatically arranged in proper way without any space at the bottom.
You need to wrap each two of your columns inside a div class="row" like this:
<div class="container">
<div class="col-xs-12 col-sm-9">
<div class="row">
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. magna mollis euismod. Donec sed odio dui. magna mollis euismod. Donec sed odio dui.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
</div>
<div class="row">
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
</div>
<div class="row">
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravi tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
</div>
<div class="row">
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
<!--/span-->
<div class="col-6 col-sm-6 col-lg-4">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
<p><a class="btn btn-default" href="#" role="button">View details »</a>
</p>
</div>
</div>
<!--/span-->
</div>
</div>
<!--/row-->
<!--/.container-->
Bootply Demo