我一直在這一整個週末工作,出於某種原因,我只是無法正確排列這個div。我試圖讓圖像進入我擁有的文本的右側,它不會去,有人能幫我看看我做錯了什麼嗎?試圖讓圖片浮動文本的權利
編輯:澄清圖像下的一小部分文本應該是在圖像下,我希望圖像和一小部分圖像漂浮在巨大的文本塊的右側。
HTML5
<section id="content-wrapper"> <!-- Main content of the site -->
<div id="content">
<article>
<header>
<h1>Lorem ipsum dolor sit amet, consectetur adipisicing elit!!</h1>
</header><br>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p><br>
<p>Lorem ipsum dolor sit amet,</p>
<p>Lorem ipsum dolor sit amet,</p>
<p>Lorem ipsum dolor sit amet,</p><br>
<p>Lorem ipsum dolor sit amet,</p><br>
<header>
<h2><p>Lorem ipsum dolor sit amet,</p></h2>
</header><br>
<ul>
<li>Lorem </li>
<li>Lorem </li>
<li>Lorem </li>
<li>Lorem </li>
<li>Lorem </li>
<li>Lorem </li>
<li>Lorem </li>
<li>Lorem </li>
</ul><br>
<header>
<h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit!</h2>
</header><br>
<header>
<h2>Lorem ipsum dolor sit amet, consectetur adipisicing elit</h2>
</header><br>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<footer>
<p>Lorem * Lorem * Lorem </p>
</footer>
<div id="sales-wrapper">
<div id="sale-item1">
<img src="http://placehold.it/350x450">
<p>
Lorem ipsum dolor sit amet<br>
Price: $888
</p>
<div id="sale-item2">
<img src="http://placehold.it/350x450">
<p>
ipsum dolor sit amet<br>
Price: $888
</p>
</div>
<div id="sale-item3">
<img src="http://placehold.it/350x450">
<p>
ipsum dolor sit amet<br>
Price: $888
</p>
</div>
</div>
</div>
</article>
</div>
</section>
CSS3
#content-wrapper {
width: 70%;
margin: 1% auto;
line-height: 20px;
background-color: #F0F8FF;
overflow: hidden;
}
#content {
width: 100%;
float: left;
margin: 2%;
background-color: antiquewhite;
}
#content article {
padding: 3% 5%;
background-color: gray;
float: left;
}
#content article p {
font-size: 16px;
margin-left: 2%;
}
#content article ul {
list-style: none;
margin-left: 5%;
}
#content article ul li {
font-size: 16px;
}
#content article header h2 {
color: #354175;
}
#content article footer {
width: 100%;
float: left;
text-align: center;
}
#content article footer p {
font-weight: bold;
font-size: 23px;
color: #354175;
}
#sales-wrapper {
width: 30%;
float: left;
background-color:black;
}
Jsfiddled here:http://jsfiddle.net/kLgyL/,你的html格式不正確。 –
是的,我對Web開發的一些新的說法是誠實的。我試圖學習如何編寫更清晰的代碼,但似乎並沒有足夠奇怪的HTML信息。 – SecretWalrus