我有一個問題,以創建一個<div>
元素的列表。問題是定位元素。創建div元素的列表:位置不正常工作
實際結果:
預期結果:
下面是代碼:
.im_view_me {
background-color: white;
margin-top: -10px;
}
.hour_me {
float: left;
color: black;
font-size: 9px;
margin-left: 3px;
margin-top: 20px;
}
.text_from_im {
color: #964FDB;
font-weight: 600;
margin-left: 50px;
font-size: 11px;
padding-top: 5px;
}
.text_im {
color: black;
font-size: 11px;
margin-left: 50px;
width: 200px;
}
.img_me_im {
width: 35px;
height: 35px;
float: left;
position: relative;
margin: 5px;
}
<div class="im_view_me">
<img src="../Common Files/img/img_example.jpg" class="img_me_im" />
<p class="hour_me">15:21</p>
<p class="text_from_im">Me</p>
<p class="text_im">idizduih zhdedh zihed uizh ifhierh fieirfhi</p>
</div>
<div class="im_view_me">
<img src="../Common Files/img/img_example.jpg" class="img_me_im" />
<p class="hour_me">15:21</p>
<p class="text_from_im">Me</p>
<p class="text_im">idizduih zhdedh zihed uizh ifhierh fieirfhi</p>
</div>
<div class="im_view_me">
<img src="../Common Files/img/img_example.jpg" class="img_me_im" />
<p class="hour_me">15:21</p>
<p class="text_from_im">Me</p>
<p class="text_im">idizduih zhdedh zihed uizh ifhierh fieirfhi</p>
</div>
您沒有重置對於初學者段落的默認行爲(利潤率等)。建議你先從* reset * css開始:) – 2015-03-02 09:47:32