如果图像在右边,我怎么能将文字换行?
问题描述:
我试图让一些文字环绕放置在右边的图像(对于放置在左边的图像,它自动环绕)。任何想法如何做到这一点?这是我现在拥有的。如果图像在右边,我怎么能将文字换行?
<div class="row clear">
<div class="col-md-7 text-left">
<div class="heading">Blash blah blsh</div>
<div class="feature-txt-body">This is a long piece of text that is so long that it needs to break into multiple lines. I am now writing some jibberish text and I have no idea what I am writing. I need to <b>only</b> focus on what's relevant to you. Now if you look at this line, it is not wrapping around the image.</div>
</div>
<div class="col-md-3">
<div id="image"></div>
</div>
</div>
答
您可以使用自举的.pull-right
类(这基本上只是一个浮动:权)来实现这一点没有使用列。
你可以看到它在这个bootply工作:http://www.bootply.com/sc6dvO9rj3
HTML(整理了一下):
<div class="row">
<img class="pull-right" width="100" height="100" src="..." />
<h1>Blah blah blah</h1>
<p>
This is a long piece of text that is so long that it needs to break into multiple lines. I am now writing some jibberish text and I have no idea what I am writing. I need to <strong>only</strong> focus on what's relevant to you. Now if you look at this line, it is not wrapping around the image.
</p>
</div>
答
<div class="row clear">
<div class="col-md-7 text-left">
<div class="heading">Blash blah blsh</div>
<div class="feature-txt-body">
<div class="col-md-3">
<div id="image" style="background:#000; width:200px; height:100px; float:right;"></div>
</div>This is a long piece of text that is so long that it needs to break into multiple lines. I am now writing some jibberish text and I have no idea what I am writing. I need to <b>only</b> focus on what's relevant to you. Now if you look at this line, it is not wrapping around the image.This is a long piece of text that is so long that it needs to break into multiple lines. I am now writing some jibberish text and I have no idea what I am writing. I need to <b>only</b> focus on what's relevant to you. Now if you look at this line, it is not wrapping around the image. This is a long piece of text that is so long that it needs to break into multiple lines. I am now writing some jibberish text and I have no idea what I am writing. I need to <b>only</b> focus on what's relevant to you. Now if you look at this line, it is not wrapping around the image</div>
</div>
</div>
文本格内放图像将使其漂浮到文本的右侧包装方式
答
工程与平淡,乏味的html:
<img align="right" src="..." />
我会建议CSS变种float:right
以及虽然
感谢。不幸的是,这是行不通的。当我这样做时,它进一步将图像推向右侧。 – Legend 2014-09-23 05:49:06
是的,我看到在小提琴即时通讯试图做到这一点,如果我得到另一种方式,我会在这里发帖 – himanshu 2014-09-23 05:52:11
我得到了答案,但不是一个传统的方法 – himanshu 2014-09-23 05:57:49