php中<li>横向排列实例
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php中<li>横向排列实例相关的知识,希望对你有一定的参考价值。
1 <?php 2 3 include "../mydbda.php"; 4 $db = new mydbda(); 5 $sql = "select distinct(First) from pinpai order by First asc"; 6 $str = $db->Select($sql,"CX","mydb"); 7 $hang = explode("|",$str); 8 9 for($i=0;$i<count($hang);$i++) 10 { 11 echo "<div class=‘pq‘><ul><li>$hang[$i]</li>"; 12 $sqlpq = "select Name from pinpai where First = ‘{$hang[$i]}‘"; 13 $strpq = $db->Select($sqlpq,"CX","mydb"); 14 $hpq = explode("|",$strpq); 15 for($m=0;$m<count($hpq);$m++) 16 { 17 echo "<li>$hpq[$m]</li>"; 18 } 19 echo "</ul></div>"; 20 } 21 22 ?> 23 </body> 24 </html> 25 26 <style type="text/css"> 27 * 28 { 29 margin:0px; 30 padding:0px; 31 border:0px; 32 } 33 34 .pq 35 { 36 height:50px;; 37 width:500px; 38 39 } 40 41 li 42 { 43 margin:10px; 44 float:left; 45 list-style:none; 46 } 47 48 </style>
以上是关于php中<li>横向排列实例的主要内容,如果未能解决你的问题,请参考以下文章