嵌套在css3中

时间:2013-07-24 05:25:57

标签: css3 sencha-touch-2

我是css和Sencha Touch 2的新手。在处理Sencha Touch 2的一些教程时,我看到一个CSS文件,其代码如

/* Increase height of list item so title and narrative fit */
.x-list .x-list-item {
     min-height: 10.5em!important;
     height:7.5em;
}
/* Move the disclosure button up to account for the list item height increase */
.x-list .x-list-disclosure {
     position: absolute;
     bottom: 4.0em;
     right: 0.10em;
}

.x-list .x-list-item是一个css嵌套概念,x-list是一个类名吗? 此外,这个概念纯粹是CSS概念还是Sencha Touch概念?

1 个答案:

答案 0 :(得分:1)

这只是一个纯CSS概念,因此这种语法意味着

.x-list .x-list-item 

选择一个类x-list-item的元素,该元素嵌套在具有类x-list的元素下

第二种语法也是如此。

如果你想让它更加严格,你可以使用element.class选择器,只有当它与element.class组合匹配时才会选择,所以如果你的例子是......

使用类似

的内容
div.x-list span.x-list-item {
   /* This will select span only which is having a class 
      x-list-item which is nested under div element having class 
      x-list */
}