I\'m using bootstrap 3 and I try to have a specific grid alignment for article on desktop.
On mobile I want to order content of the article like that :
it's your columns class:
md:
4 (image) - 8 (title) => 1st row (max 12 columns)
8 (content) => new row
that's will make a new row, the 2nd row placed below image/title column
so you must use this columns setting (using hidden class) like this:
md:
2 (image) - 5 (title) - 5 (hidden-xs hidden-sm)
5 (content)
just try this code:
CSS:
<style>
.col-md-2{
height: 300px;
background-color: blue;
color: white;
border: 2px solid red;
}
.col-md-4{
height: 100px;
}
.col-md-5{
height: 100px;
background-color: red;
color: white;
border: 2px solid black;
}
</style>
HTML:
<article class="row">
<header class="col-md-5 col-md-push-2">
<a href="#">
<h2>Title</h2>
</a>
</header>
<div class="col-md-2 col-md-pull-5">
<figure>
<a class="thumbnail" href="#">
<img src="" alt="4x3 Image" class="img-responsive">
<figcaption>Caption</figcaption>
</a>
</figure>
</div>
<div class="hidden-xs hidden-sm">
<div class="col-md-4"></div>
</div>
<div class="col-md-5 col-md-pull-5">
<p>Content</p>
</div>
</article>
maybe it's not solve the problem. but you can use this trick.
sorry for my bad english
Based on Possible to achieve this Mobile/Desktop layout using Bootstrap? (or other grid)
css:
.floatright{float:right;}
@media (max-width: 768px)
{
.floatright{float:none;}
}
html:
<div class="container" style="background-color:green">
<article class="row">
<header class="col-md-8 floatright">
<a href="#">
<h2>Title</h2>
</a>
</header>
<div class="col-md-4">
<figure>
<a class="thumbnail" href="#">
<img src="..." alt="4x3 Image" class="img-responsive">
<figcaption>Caption</figcaption>
</a>
</figure>
</div>
<div class="col-md-8 floatright">
<p>Content</p>
</div>
</article>
</div>
Here's how fix the problem
<article class="row">
<header class="col-md-8 pull-right">
<a href="#">
<h2>Title</h2>
</a>
</header>
<div class="col-md-4 pull-left">
<figure>
<a class="thumbnail" href="#">
<img src="..." alt="4x3 Image" class="img-responsive">
<figcaption>...</figcaption>
</a>
</figure> </div>
<div class="col-md-8 pull-right">
<p>content</p>
</div>
</article>
Use a bigger div with col-md-8 class and place title and text inside it and use bootstrap's col-md-12 class on both of them to stack over one another