简体   繁体   English

如何在for循环中使用php更改css样式值?

[英]How to change css style value using php in a for loop?

I've downloaded this slider: 我已经下载了此滑块:

http://tympanus.net/codrops/2012/03/15/parallax-content-slider-with-css3-and-jquery/ http://tympanus.net/codrops/2012/03/15/parallax-content-slider-with-css3-and-jquery/

What I want to do is to make the dot (bullet) for each slider a specific color (first is red, second is blue, etc), and not to be white for all slides. 我要做的是使每个滑块的点(子弹)具有特定的颜色(第一个是红色,第二个是蓝色,等等),而不是所有幻灯片都为白色。

The class that controls this issue is .da-dots span.da-dots-current:after (in style.css if you downloaded the files above). 控制此问题的类是.da-dots span.da-dots-current:after (如果下载了上面的文件,则为style.css )。

The problem is how to change the background property of .da-dots span.da-dots-current:after in the index.html (or index.php ) file? 问题是如何在index.html (或index.php )文件中更改.da-dots span.da-dots-current:after的背景属性?

The issue is that the slides are actually a number of DIV 's that are listed in the source code and animated using the jQuery slider above. 问题在于,幻灯片实际上是许多DIV ,这些DIV在源代码中列出并使用上面的jQuery滑块进行动画处理。

My index.php contains: http://codepad.org/6Xoelift 我的index.php包含: http : //codepad.org/6Xoelift

假设仅支持处理CSS3选择器的浏览 ,则可以使用nth-child选择器 :nth-child(1) :nth-child(2) :nth-child(3) …来为每个点设置不同的样式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM