我正在使用bootstrap 3,我尝试在桌面上为文章设置特定的网格对齐.
Alignment i want http://f.cl.ly/items/300e2K3V3H3c3f3F3p0q/Napkin%2027.09.13%209.47.05%20AM.png
这是我的代码
<article class="row"> <header class="col-md-8 col-md-push-4"> <a href="#"> <h2>Title</h2> </a> </header> <div class="col-md-4 col-md-pull-8"> <figure> <a class="thumbnail" href="#"> <img src="..." alt="4x3 Image" class="img-responsive"> <figcaption>Caption</figcaption> </a> </figure> </div> <div class="col-md-8 col-md-push-4"> <p>Content</p> </div> </article>
http://f.cl.ly/items/1T3f093W2I0m3Q1E360g/Napkin%2027.09.13%2010.56.59%20AM.png
有没有一种简单的方法来获得我想要的东西?
解决方法
基于
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>