这样的列表显示是怎么循环的呢
怎么没有上传图片功能的
这样不规则的图片循环怎么写代码?
------解决方案--------------------
<meta charset="utf-8"><style>
.main_wrapper{width:900px;min-height:200px;margin:10px auto;overflow:hidden;}
.two_pictures{width:200px;float:left;margin-bottom:10px;padding:5px;margin:6px;}
.main_wrapper,.two_pictures,img{border:1px solid #ABC;}
.pic_1{height:150px;width:200px;}
.pic_2{height:100px;width:200px;}
<!--样式随便改-->
</style><div class="main_wrapper">
<?php for($i=0;$i<8;++$i){
if(($i)%2==0){
$style1="pic_2";
$style2="pic_1";
}else{
$style1="pic_1";
$style2="pic_2";
}
$picArr = array(
"http://www.iimei.com/1/xunhuan.jpg",
"http://www.iimei.com/1/xunhuan.jpg"
);//把图片改为动态的,自已调整
echo '
<div class="two_pictures"><img src="'.%24picArr%5B0%5D.'" class="'.$style1.'" alt=" 这样的列表显示是如何循环的呢 " ><script src="https://www.php.cn/hezuo/f220a8ffcae8732bbc8e3d8f7f36834b.js"></script><span>This is a test</span>
<img src="'.%24picArr%5B1%5D.'" class="'.$style2.'" alt=" 这样的列表显示是如何循环的呢 " ><span>This is a test</span>
</div>
';
}
?>
<div class="clear"></div>
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号