我想把文字放在图片的右边,图片和文字应该放在页面的右边一点,但这对我来说不起作用。
<div id="container">
<div class="desc">
<div>
<img class="imgD" src="C:\Users\Hadia\Dropbox\college\unit 14 Webdesign\images\red-lipstic.jpg"/>
</div>
<div class=".introHeader">
<h4> Red Lipstic | MAC </h4>
<p class="price">£20.00</p>
</div>
<div>
<p >Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p>
</div>
</div>
</div>
最佳答案
新建一个包含文本(the和两个
),然后调用
width: 33%
float: left;
在图像 div 和
width: 60%
float: right;
在文本 div 上,根据需要调整宽度。此外,对于您在下方添加的任何内容,请务必
clear: both;
关于html - 无法将两个 div 并排放置,尝试了一切,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28140264/