How to solve the style of page turning button of Dedecms list pagelist
Dedecms list pagelist page turning button style how to solve?
Dedecms list pagelist The solution to the homepage and last page style of the page turning button
Recommended learning: 梦Weavercms
Dedecms list The page turning button uses {dede:pagelist listitem="index,end,pre,next,pageno" listsize="10"/}After generating the html, the first page of the list page is
<li >首页</li> <li class="thisclass">1</li> <li><a href='news_2.html'>2</a></li> <li><a href='news_3.html'>3</a></li> <li><a href='news_2.html'>下一页</a></li> <li><a href='news_3.html'>末页</a></li>
the last page It is:
<li><a href='news_1.html'>首页</a></li> <li><a href='news_2.html'>上一页</a></li> <li><a href='news_1.html'>1</a></li> <li><a href='news_2.html'>2</a></li> <li class="thisclass">3</li> <li >末页</li>
The CSS style sheet of the default template:
.dede_pages{ } .dede_pages ul{ float:left; padding:12px 0px 12px 16px; } .dede_pages ul li{ float:left; font-family:Tahoma; line-height:17px; margin-right:6px; border:1px solid #E9E9E9; } .dede_pages ul li a{ float:left; padding:2px 4px 2px; color:#555; display:block; } .dede_pages ul li a:hover{ color:#690; text-decoration:none; padding:2px 4px 2px; } .dede_pages ul li.thisclass, .dede_pages ul li.thisclass a,.pagebox ul li.thisclass a:hover{ background-color:#F8F8F8; padding:2px 4px 2px; font-weight:bold; }
You can see that ".dede_pages ul li a" and ".dede_pages ul li.thisclass" both have padding: 2px 4px 2px; Attribute but ".dede_pages ul li" does not. When ".dede_pages ul li" does not have the padding:2px 4px 2px; attribute, the two buttons
The following will provide two solutions to the above problems
The first method is solved through CSS. This solution is not to control the a tag and only add styles to the li. The code is as follows:
.dede_pages ul{ } .dede_pages ul li{ float:left; height:18px; line-height:18px; padding:4px 10px; margin-right:5px; border:1px #b9cdff solid; } .dede_pages .thisclass{ background:#e3ebfe; }
You can see that the code is very concise, but it is not very good for the user experience. It should be because the current button is displayed by li instead of a, so when the user clicks on the button, it will If you don't click on the text, you don't click on it. For a better user experience we need another solution.
The second method is to modify the dede:pagelist related file arc.listview.class.php in the include folder:
Open arc.listview.class.php and find the following code:
//获得上一页和主页的链接 if($this->PageNo != 1) { $prepage.="<li><a href='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a></li>rn"; $indexpage="<li><a href='".str_replace("{page}",1,$tnamerule)."'>首页</a></li>rn"; } else { $indexpage="<li >首页</li>rn"; } //下一页,未页的链接 if($this->PageNo!=$totalpage && $totalpage>1) { $nextpage.="<li><a href='".str_replace("{page}",$nextpagenum,$tnamerule)."'>下一页</a></li>rn"; $endpage="<li><a href='".str_replace("{page}",$totalpage,$tnamerule)."'>末页</a></li>rn"; } else { $endpage="<li >末页</li>rn"; }
Modify $indexpage="
<li class="thisclass">首页</li> <li class="thisclass">1</li> <li><a href='news_2.html'>2</a></li> <li><a href='news_3.html'>3</a></li> <li><a href='news_2.html'>下一页</a></li> <li><a href='news_3.html'>末页</a></li>
The second method is simpler and increases the user experience
PS: Using the second method, there is no need to modify the CSS file.
The above is the detailed content of How to solve the style of page turning button of Dedecms list pagelist. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
