How does Dede change the background color of the article list on alternate lines?
Changing colors between rows in the article list can make the two displayed contents different. Many websites use the display method of changing colors between rows in the list page. Let’s share with you how Dede implements it.
Recommended study: 梦Weavercms
dede can also implement the method of changing the background color of the list with alternate rows like the forum. Let’s take a look below. Interlaced color change in the article list can make the two displayed contents different. Many websites use the interlaced color display method in the list page. Below I will post the implementation of interlaced color change in cms so that friends who need it can Refer to the following for modifications.
Add a line every 5 lines in the list:
The code is as follows:
{:list pagesize='50'} <LI><a href="[field:arcurl /]" title="[field:title function='htmlspecialchars(@me)'/]" target=_blank>[field:title function="cn_substr(@me,48)"/]</a>[field:pubdate runphp='yes'] $a="<font color=red>".strftime('%m-%d',@me)."</font>"; $b=strftime('%m-%d',@me); $ntime = time(); $day3 = 3600 * 24; if(($ntime - @me) < $day3) @me = $a; else @me =$b; [/field:pubdate] [field:global name=autoindex runphp="yes"] if(@me%5==0)@me="<hr />"; else @me=""; [/field:global] {/dede:list} <DIV></DIV></LI> 仿
The above is the detailed content of How does Dede change the background color of the article list on alternate lines?. For more information, please follow other related articles on the PHP Chinese website!