這裏的html:按標籤由標籤裏和周圍組裏替換每個標籤p UL
<section class="category">
<p><a href="product-list.html">Lorem ipsum dolor sed diam</a></p>
<p><a href="product-list.html">Lorem ipsum dolor sed diam</a></p>
<p><a href="product-list.html">Lorem ipsum dolor sed diam</a></p>
<p><a href="product-list.html">Lorem ipsum dolor sed diam</a></p>
<section class="clear"></section>
</section>
如何更換標籤p - >李和UL標籤包裹組裏。我需要的是:
<section class="category">
<ul>
<li><a href="product-list.html">Lorem ipsum dolor sed diam</a></li>
<li><a href="product-list.html">Lorem ipsum dolor sed diam</a></li>
<li><a href="product-list.html">Lorem ipsum dolor sed diam</a></li>
<li><a href="product-list.html" >Lorem ipsum dolor sed diam</a></li>
</ul>
<section class="clear"></section>
</section>
提示的組合:有沒有需要有明確的元素('section.clear'),只是使用其中一種簡單的clearfix解決方案(在父級上是'overflow:hidden;'就足夠了)。另外,如果你堅持使用html元素來清除浮動元素,爲什麼要使用語義'section'元素? 'section'不是在這裏去''div',它在這裏爲我們過去使用div的一些東西提供了意義。然而,在清除元素的情況下,'section'不適合,'div'是。 – powerbuoy 2012-02-23 09:58:07