【发布时间】:2015-06-04 15:45:24
【问题描述】:
我想要 PHP 代码来显示数据库中的数据,并且我想将一个特定的类添加到第一个 <li> 。
下面是它的 statc 形式,但我想从我的 MySQL 数据库中动态获取它。
<ul class="photo">
<li class="first"><a href=""><img src="images/image1.jpg" alt="" /></a></li> //only this first line will be giving attribute (class="first")
<li><a href=""><img src="images/image2.jpg" alt="" /></a></li>
<li><a href=""><img src="images/image3.jpg" alt="" /></a></li>
</ul>
<ul class="text">
<li class="first">
<h2><a href="">Image 1 caption</a></h2>
<p>Story............</p>
<a class="next" href="">Next>></a>
</li>
<li> // this is the caption for the line that will be giving attribute (class="first")
<h2><a href="">Image 2 caption</a></h2>
<p>Stories 2.................</p>
<a class="next" href="">Next>></a>
</li>
<li>
<h2><a href="">Image 3 caption</a></h2>
<p>image 3 story................</p>
<a class="next" href="">Next>></a>
</li>
</ul>
【问题讨论】:
-
你到现在都做了什么?
-
明确您的问题。我们能做什么?
标签: php mysql css html slideshow