<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[A.PAO designSTUDIO BLOG]]></title> 
<link>https://blog.apao.idv.tw/index.php</link> 
<description><![CDATA[A.PAO designSTUDIO 阿保工作室]]></description> 
<language>zh-tw</language> 
<copyright><![CDATA[A.PAO designSTUDIO BLOG]]></copyright>
<item>
<link>https://blog.apao.idv.tw/post//</link>
<title><![CDATA[ul::after 防止 ul li 錯亂寫法]]></title> 
<author>apao &lt;apao@www.apao.idv.tw&gt;</author>
<category><![CDATA[CSS]]></category>
<pubDate>Mon, 08 Jan 2018 04:21:17 +0000</pubDate> 
<guid>https://blog.apao.idv.tw/post//</guid> 
<description>
<![CDATA[ 
	<span style="font-size: 130%;">正常來說 HTML裡面，如果使用 li 做 float 功能時，就會讓 li 失去高度，為了不讓 li 失去高度，以及在之後的元素不會錯亂，需要有對應的程式寫法，如下： </span><br/><span style="font-size: 130%;">HTML 一般寫法</span><br/><div class="code">&lt;ul&gt;<br/>&nbsp;&nbsp;&lt;li&gt;★&lt;/li&gt;<br/>&nbsp;&nbsp;&lt;li&gt;this is list comm.&lt;/li&gt;<br/>&lt;/ul&gt;<br/>&lt;ul&gt;<br/>&nbsp;&nbsp;&lt;li&gt;★&lt;/li&gt;<br/>&nbsp;&nbsp;&lt;li&gt;this is list comm.&lt;/li&gt;<br/>&lt;/ul&gt;</div><br/><span style="font-size: 130%;">就會變成這樣：（灰框：div, 藍框：ul, 紅框：li）</span><a href="https://blog.apao.idv.tw/attachment.php?fid=2909" target="_blank"><img src="https://blog.apao.idv.tw/attachment.php?fid=2909" class="insertimage" alt="點擊在新視窗中瀏覽此圖片" title="點擊在新視窗中瀏覽此圖片" border="0"/></a><br/><span style="font-size: 130%;">要正常，就要多寫一行div style -> clear: both 在每個 ul 後面，但是對輸出程式而言有點不乾淨。<br/><div class="code">&lt;ul&gt;...&lt;/ul&gt;<br/>&lt;div style=&quot;clear: both;&quot;&gt;</div><br/>所以在CSS裡用 ul::after 來防制 float: 所產生的錯亂對輸出會乾淨一些。<br/>CSS style</span><div class="code">ul::after&#123;<br/>content: &quot;.&quot;; /*輸出文字*/<br/>color: rgba(255,255,255,0.00); /*文字是透明的*/<br/>clear: both; /*清除以上float規則*/<br/>display: block; /*產生float功能所喪失的物件高度*/<br/>height: 0px;/*再將content: 高度設定為0*/<br/>&#125;</div><br/><span style="font-size: 130%;">正常畫面如下</span><a href="https://blog.apao.idv.tw/attachment.php?fid=2910" target="_blank"><img src="https://blog.apao.idv.tw/attachment.php?fid=2910" class="insertimage" alt="點擊在新視窗中瀏覽此圖片" title="點擊在新視窗中瀏覽此圖片" border="0"/></a><br/>CSS style 參考<div class="code">body&#123; background: #FFFFFF; color: rgba(0,0,0,1.00); font-size: 13px;&#125;<br/> div&#123; width: auto; height: auto; margin:0; padding:10px 0 10px 10px; border: rgba(0,0,0,1.00) dotted 1px;&#125;<br/> ul&#123; display: block; list-style: none; margin: 0 0 10px 0; padding: 6px; border: rgba(0,0,255,1.00) dotted 1px;&#125;<br/> ul::after&#123; content: &quot;.&quot;; color: rgba(255,255,255,0.00); clear: both; display: block; height: 0px;&#125;<br/> li&#123; float: left; display: block; width: auto; margin: 6px; padding: 0; min-height: 20px; border: rgba(255,0,0,1.00) dotted 1px;&#125;<br/> li:first-child&#123; width: 12px;&#125;<br/> li:last-child&#123; width: 92%;&#125;<br/> a&#123;display:inline-block;&#125;</div><br/>HTML 參考<div class="code">&lt;div&gt;<br/>&lt;ul&gt;<br/>&nbsp;&nbsp;&lt;li&gt;★&lt;/li&gt;<br/>&nbsp;&nbsp;&lt;li&gt;this is list comm.&lt;/li&gt;<br/>&lt;/ul&gt;<br/>&lt;ul&gt;<br/>&nbsp;&nbsp;&lt;li&gt;★&lt;/li&gt;<br/>&nbsp;&nbsp;&lt;li&gt;this is list comm.&lt;/li&gt;<br/>&lt;/ul&gt;<br/>&lt;/div&gt;</div><br/>Tags - <a href="https://blog.apao.idv.tw/tags/ul/" rel="tag">ul</a> , <a href="https://blog.apao.idv.tw/tags/after/" rel="tag">after</a> , <a href="https://blog.apao.idv.tw/tags/%25E9%2598%25B2%25E6%25AD%25A2/" rel="tag">防止</a> , <a href="https://blog.apao.idv.tw/tags/li/" rel="tag">li</a> , <a href="https://blog.apao.idv.tw/tags/%25E9%258C%25AF%25E4%25BA%2582/" rel="tag">錯亂</a>
]]>
</description>
</item><item>
<link>https://blog.apao.idv.tw/post//#blogcomment</link>
<title><![CDATA[[評論] ul::after 防止 ul li 錯亂寫法]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[評論]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://blog.apao.idv.tw/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>