<?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[CSS nth-child（n）用法]]></title> 
<author>apao &lt;apao@www.apao.idv.tw&gt;</author>
<category><![CDATA[CSS]]></category>
<pubDate>Thu, 15 Apr 2021 03:58:10 +0000</pubDate> 
<guid>https://blog.apao.idv.tw/post//</guid> 
<description>
<![CDATA[ 
	<a href="http://www.csrdat.org.tw/" target="_blank"><img src="https://blog.apao.idv.tw/attachment.php?fid=4160" class="insertimage" alt="點擊在新視窗中瀏覽此圖片" title="點擊在新視窗中瀏覽此圖片" border="0"/></a><br/><span style="font-size: 130%;">為了客戶要在就程式中加上某些功能，又不能動到inc模組的狀況下，改變CSS版型，就只能動用更新的CSS3設定來輔助顯示。如果沒有事前的定義，除了first-child, last-child 的方法，之外 nth-child（n）也是不錯的用法，但是要多注意上層的 Class 定義，才能完美定義出自己想要的CSS3樣式。</span><br/><br/><span style="font-size: 130%;">以table tr 元素為例：<br/>odd：為奇數<br/>nth-child(odd)</span><br/><div class="code">tr:nth-child(odd)&#123;background:#808080&#125;</div><br/><span style="font-size: 130%;">even：為偶數</span><br/><div class="code">tr:nth-child(odd)&#123;background:#808080&#125;</div><br/><br/><span style="font-size: 130%;">n可放入數字：以 ul li 元素為例：<br/>前方開始的用法：<br/>:nth-child(n)</span><br/><hr><br/><span style="font-size: 130%;">:nth-child(3)</span><br/>說明：設定於列表中的第（3）個標籤（li）<br/><div class="code">li:nth-child(3)&#123;background:#808080&#125;</div><br/><span style="font-size: 130%;">:nth-child(2n)</span><br/>說明：設定於列表中的偶數標籤（li）<br/><div class="code">li:nth-child(2n)&#123;background:#808080&#125;</div><br/><span style="font-size: 130%;">:nth-child(2n-1)</span><br/>說明：設定於列表中的奇數標籤（li）<br/><div class="code">li:nth-child(2n-1)&#123;background:#808080&#125;</div><br/><br/><span style="font-size: 130%;">後方開始的用法：以 ul li 元素為例：<br/>:nth-last-child(n)</span><br/><hr><br/><span style="font-size: 130%;">:nth-last-child(3)</span><br/>說明：後面算來第三個元素<br/><div class="code">li:nth-last-child(3)&#123;background:#808080&#125;</div><br/><br/><span style="font-size: 130%;">:nth-last-child(-n+3)</span><br/>說明：最後算來三個元素<br/><div class="code">li:nth-last-child(-n+3)&#123;background:#808080&#125;</div><br/><br/><span style="font-size: 130%;">:nth-last-child(5n)</span><br/>說明：最後算來五的倍數的元素<br/><div class="code">li:nth-last-child(3)&#123;background:#808080&#125;</div><br/><br/>參考網站：<br/><a href="http://www.csrdat.org.tw/" target="_blank">http://www.csrdat.org.tw/</a><br/>Tags - <a href="https://blog.apao.idv.tw/tags/css/" rel="tag">css</a> , <a href="https://blog.apao.idv.tw/tags/nth-child%25EF%25BC%2588n%25EF%25BC%2589/" rel="tag">nth-child（n）</a>
]]>
</description>
</item><item>
<link>https://blog.apao.idv.tw/post//#blogcomment</link>
<title><![CDATA[[評論] CSS nth-child（n）用法]]></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>