无法将两个div放在一起,尝试了一切

时间:2015-01-25 19:04:50

标签: html css

我想将文本放在图像的右侧,图像和文本应该放在页面的右边,但它对我不起作用。

<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">&#163;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>

http://jsfiddle.net/6p1k0cqa/

1 个答案:

答案 0 :(得分:0)

创建一个新文本以包含文本(和两个

),然后调用

width: 33%
float: left;

在图像div和

width: 60%
float: right;

在文本div上,根据需要调整宽度。此外,对于您在下面添加的任何内容,请务必

clear: both;