ali*_*rge 5 css twitter-bootstrap twitter-bootstrap-3
我正在使用bootstrap 3,我尝试在桌面上为文章设置特定的网格对齐.
在移动设备上我想订购文章的内容:
在桌面上,我想要左边的图像和右边的标题和内容.
我希望对齐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>
Run Code Online (Sandbox Code Playgroud)
但是使用此代码,内容位于右侧,但位于图像下方.
http://f.cl.ly/items/1T3f093W2I0m3Q1E360g/Napkin%2027.09.13%2010.56.59%20AM.png
有没有一种简单的方法来获得我想要的东西?
基于可能使用Bootstrap实现此移动/桌面布局?(或其他网格)
CSS:
.floatright{float:right;}
@media (max-width: 768px)
{
.floatright{float:none;}
}
Run Code Online (Sandbox Code Playgroud)
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>
Run Code Online (Sandbox Code Playgroud)