logo
技术折腾
CSS3选择器nth-child(n)实现隔几行选择元素
nth-child(n),n 可以是数字、关键词或公式。选择器匹配属于其父元素的第N个子元素,不论元素的类型。
<h3>序号写法:</h3>


li:nth-child(3){background:orange;}/把第3个LI的背景设为橙色/
<h3>倍数写法:</h3>

li:nth-child(3n){background:orange;}/把第3、第6、第9、…、所有3的倍数的LI的背景设为橙色/
<h3>倍数分组匹配:</h3>
li:nth-child(3n+1){background:orange;}/匹配第1、第4、第7、…、每3个为一组的第1个LI/
li:nth-child(3n+5){background:orange;}/匹配第5、第8、第11、…、从第5个开始每3个为一组的第1个LI/
li:nth-child(5n-1){background:orange;}/匹配第5-1=4、第10-1=9、…、第5的倍数减1个LI/
<h3>隔三行设置颜色</h3>
$("tr:nth-child(3n)").css("background","#eee");
<h3>隔两行换一个颜色</h3>
$("tr:nth-child(2n)").css("background","#eee");
<h3>每隔三行的第二行<span style="color: #ff0000;">和</span>第三行设置颜色</h3>
技术折腾
css sprites定位技术--原创

什么叫做css sprites呢?

技术折腾
运用@media实现网页自适应

以前一直不知道如何自适应,于是用了百分数,但是最终结果还是不如意。

技术折腾
discuz返回顶部 按钮不见了!

昨天写模板,发现这个footer的返回顶部跑哪去了?

技术折腾
把dz的主题分类伪装成子版块
<!--{if ($_G['forum']['threadtypes'] &amp;&amp; $_G'forum'['listable']) || count($_G'forum'['types'])> 0}-->
<p style="text-align: left;">
  <ul id="thread_types" class="ttp bm cl">
    <!--{hook/forumdisplay_threadtype_inner}-->
    <li id="ttp_all" {if !$_GET[ 'typeid'] &amp;&amp; !$_GET[ 'sortid']}class="xw1 a" {/if}>
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]{if $_G'forum'['defaultshow']}&filter=sortall&sortall=1{/if}{if $_GET['archiveid']}&amp;archiveid={$_GET['archiveid']}{/if}">{lang forum_viewall}</a></li>
    <!--{if $_G'forum'}-->
    <!--{loop $_G['forum']['threadtypes']['types'] $id $name}-->
    <!--{if $_GET['typeid']==$ id}-->
    <li class="xw1 a">
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]{if $_GET['sortid']}&filter=sortid&sortid=$_GET['sortid']{/if}{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;&lt;!--{if $_Gforumicons 'threadtypes'==2 }-->
        <img class="vm" src="$_G[forum][threadtypes][icons][$id]" alt="">
        <!--{/if}-->$name&lt;!--{if $showthreadclasscounttypeid[$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{else}-->
    <li>
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&amp;filter=typeid&amp;typeid=$id$forumdisplayadd[typeid]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;&lt;!--{if $_Gforumicons 'threadtypes'==2 }-->
        <img class="vm" src="$_G[forum][threadtypes][icons][$id]" alt="">
        <!--{/if}-->$name&lt;!--{if $showthreadclasscounttypeid[$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{/if}-->
    <!--{/loop}-->
    <!--{/if}-->
    <!--{if $_G'forum'}-->
    <!--{if $_G'forum'}-->
    <li>
      <span class="pipe">|</span></li>
    <!--{/if}-->
    <!--{loop $_G['forum']['threadsorts']['types'] $id $name}-->
    <!--{if $_GET['sortid']==$ id}-->
    <li class="xw1 a">
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]{if $_GET['typeid']}&filter=typeid&typeid=$_GET['typeid']{/if}{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;$name<!--{if $showthreadclasscount[sortid][$id]}-->
        <span class="xg1 num">$showthreadclasscount[sortid][$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{else}-->
    <li>
      <a href="forum.php?mod=forumdisplay&fid=$_G[fid]&amp;filter=sortid&amp;sortid=$id$forumdisplayadd[sortid]{if $_GET['archiveid']}&archiveid={$_GET['archiveid']}{/if}" &gt;$name<!--{if $showthreadclasscount[sortid][$id]}-->
        <span class="xg1 num">$showthreadclasscount[sortid][$id]</span>
        <!--{/if}--></a>
    </li>
    <!--{/if}-->
    <!--{/loop}-->
    <!--{/if}-->
    <!--{hook/forumdisplay_filter_extra}--></ul>
  <script type="text/javascript">showTypes('thread_types');</script>
  <!--{/if}-->
染念 染念 mmp,这高亮不行。 1月21日
耐火砖价格 耐火砖价格 拜访博主,感谢分享 1月3日
染念 染念 哎哎 1月1日
技术折腾
笔记*dz开发常用的代码

|´・ω・)ノ不想百度了



180 文章数
678 评论量
4 分类数
184 页面数
已在风雨中度过 7年97天0小时33分
© 2024 染念Blog
浙ICP备19020194号-1
暗黑模式
暗黑模式
返回顶部
© 2024 染念Blog
浙ICP备19020194号-1
暗黑模式
暗黑模式
返回顶部