Bootstrap 3将文字环绕图像

Pocockn

我有3列保存我的文本,然后有9列保存我的项目的图像,如果文本长于图像高度,我希望将文本包裹在图像下,则尝试嵌套列但是没有成功,我只是在图像的第12列中将文本与文本对齐,但是在移动设备上,我希望文本以默认的列行为显示在图像顶部。

这是我的代码:

<div class="container">
    <div class="row">
        <div class="col-md-3">
            <h2 class="blue-header"><?php the_title(); ?></h2>
            <p class="first-para"><?php the_content(); ?></p>
        </div>
        <div class="col-md-9">
            <?php $image = get_field('single_project_image', $id ); ?>
            <img src="<?php echo $image[url]; ?>" class="img-responsive margin-image">
        </div>
    </div>
</div>

这是我创建的Bootsnipp的链接:

http://bootsnipp.com/snippets/6n3q5

格莱布·凯玛斯基(Gleb Kemarsky)

我建议复制图像。我们将第一个实例放置在文本之前。这将float: right;在宽屏上显示。第二个实例将放置在文本之后。在狭窄的屏幕上将可见。

.img-clone-1 {
  max-width: 60%;
  margin: 18px 0 18px 18px;
}
.img-clone-2 {
  width: 100%;
  margin: 12px 0;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">

<div class="container">
  <div class="row">
    <div class="col-xs-12 col-magic">
      <img src="https://placeholdit.imgix.net/~text?txtsize=56&txt=600%C3%97300&w=600&h=300" class="img-clone-1 hidden-xs pull-right">
      <h2 class="blue-header">Test Project</h2>
      <p class="first-para">Marshmallow donut wafer oat cake chocolate bar jelly beans dragée. Donut macaroon lollipop. Chocolate cake dragée pastry donut cupcake dragée danish jelly-o.
      Jelly-o marzipan pastry cotton candy pudding halvah pastry pastry. Tart lemon drops bear claw sugar plum wafer. Icing icing gummies donut pie topping toffee muffin.
      Danish macaroon cookie toffee bear claw. Icing cheesecake pie cake pie fruitcake brownie. Gummi bears chocolate bar marshmallow chupa chups.
      Tart pudding tiramisu tootsie roll cake icing chocolate pie. Marshmallow donut cheesecake. Brownie halvah toffee ice cream powder lollipop wafer liquorice.
      Pudding dessert carrot cake pastry oat cake dessert toffee topping cheesecake. Lemon drops jelly-o chupa chups dragée. Pie muffin liquorice tiramisu icing oat cake brownie bear claw. Cake halvah soufflé caramels tiramisu.</p>
      <img src="https://placeholdit.imgix.net/~text?txtsize=56&txt=600%C3%97300&w=600&h=300" class="img-clone-2 visible-xs img-responsive">
    </div>
  </div>
</div>

http://bootsnipp.com/snippets/qgqdg

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何使用Bootstrap将文字环绕图像?

来自分类Dev

尝试在Bootstrap 4中将文字环绕图像

来自分类Dev

将文字环绕在引导图像上

来自分类Dev

将文字环绕在引导图像上

来自分类Dev

Bootstrap-如何在小型设备上使文本环绕图像?

来自分类Dev

Bootstrap 3中的奇怪按钮环绕-快速响应设计

来自分类Dev

阻止文字环绕图像

来自分类Dev

文字不会环绕图像

来自分类Dev

HTML文字环绕图像

来自分类Dev

文字的图像视图环绕

来自分类Dev

Bootstrap 3将隐藏的div仍然加载图像

来自分类Dev

CSS将文字环绕在几何图像上

来自分类Dev

使用React-Native将文字环绕图像

来自分类Dev

使用React-Native将文字环绕图像

来自分类Dev

Bootstrap List组项环绕img

来自分类Dev

文字不环绕浮动图像。但图像环绕浮动文本

来自分类Dev

Bootstrap 4 与 Bootstrap 3 对齐

来自分类Dev

Bootstrap 3:将图片居中

来自分类Dev

使图像浮动并带有环绕图像的文字?

来自分类Dev

使用Bootstrap将响应图像彼此叠加

来自分类Dev

如何使用Bootstrap将多个图像居中?

来自分类Dev

Bootstrap 3 Nav标头在768到992像素之间环绕

来自分类Dev

Bootstrap 3 CSS图像标题叠加

来自分类Dev

全宽响应图像重叠Bootstrap 3

来自分类Dev

Bootstrap 3响应图像并排相同的高度

来自分类Dev

Bootstrap 3使图像居中,内容垂直居中

来自分类Dev

Bootstrap 3响应图像并排相同的高度

来自分类Dev

Bootstrap 3使图像居中,内容垂直居中

来自分类Dev

Twitter Bootstrap 3-图像的“内部”列