【发布时间】:2013-09-06 16:09:47
【问题描述】:
我正在做一个个人项目,但无法让图像在某些文本的右侧浮动。
我希望 single 段落向左浮动,而要向右浮动且 不 的图像下方也有任何后续段落位于图像旁边。我只想要图片旁边的那一段。我总是希望在图像和文本之间留一点空间。
网站是here,图片在“过去”页面上。
在“过去”页面上,图像应浮动在第一个段落的右侧。
过去的页面 HTML: 过去的
<div class="bl-content">
<h2>When I was young...</h2>
<p>I wanted to be a <span>crazy cat lady.</span> I then realized that being a crazy cat lady doesn't give me an income but infact, did quite the opposite and took away any money I would have.</p>
<img src="/images/catparty.jpg" style="float:right">
<p>So I chose the next best thing ‒ Web Development and Web Design. I knew it was <i>"my thing"</i> since Grade 6 when I found a drag and drop website maker called Piczo. It was all of the rage when I was 12 years old, I assure you. It wasn't appealing and definitely wasn't user-friendly... but it was mine and I loved it.</p>
<p>I decided to challenge myself more and learn some basic HTML and CSS so that I could get more involved in my new found passion. This lead me to have my own site on Freewebs.</p>
<p>Not too long after having my first Freewebs site I recieved my own subdomain. After that, I recieved my own <i>adoptable</i> domain. I was still young at the time so the best domain name I chose was something along the lines of <span>broken-wings</span> dot something.</p>
<p>On all of the sites that I owned, I would create content for other users with my <strong>amazing</strong> version of Paint Shop Pro (well... it was to me!) which included backgrounds, wallpapers, HTML and CSS tricks, and a lot of other things that I believed were great. I may have not of been the best, but it sure gave me an amazing foundation for school.</p>
</div>
<span class="bl-icon bl-icon-close"></span>
</section>
一些 CSS:
/* Custom content */
.bl-content p {
margin: 0 auto;
padding-bottom: 15px;
font-size: 1.7em;
line-height: 1.8;
}
.bl-content p.norex {
font-size: 35px;
text-align: center;
}
.bl-content p span {
padding: 0 10px;
background: #ffffff;
color: #ed1556;
}
如果我没有提供足够的 HTML 或 CSS,我深表歉意。您可以转到提供的链接,但我觉得这很容易解决。这个布局中有很多 CSS 和 HTML,很难确定到底需要显示什么。
【问题讨论】:
-
你试过在段落中添加图片吗?
-
@Ibu 刚刚做了。不过差别不大。
-
在段落内移动图片时,将其移动到段落的开头而不是结尾。
-
@andi 非常感谢!我知道这是一个简单的修复,没想到这么简单...... duhhhhhhh :)