如何改变另一堂课的价值?

时间:2013-03-24 22:54:54

标签: html css joomla

以下是一些代码:

<div id="one">
  <div id="two">
    <div class="cell_pad">
    </div>
  </div>
</div>

如何告诉css,you have to change value of class "cell_pad" which is in id="one"

.cell_pad在代码中重复几次,但我要更改one occurence of this class.

我正在使用sparky framework加入joomla。

我在样式表中尝试过这样,但它没有效果:

#one > .cell_pad{}

2 个答案:

答案 0 :(得分:1)

你应该使用

#one .cell_pad{} 

选择#one元素中的所有.cell_pad元素,你可以看看http://www.w3schools.com/cssref/css_selectors.asp

答案 1 :(得分:1)

你应该用这个:

#one .cell_pad 
{
}

这将选择#one元素

中的所有.cell_pad元素