Hey, I've an obvious question.

我有一个明显的问题。

For code like:

代码:

<div>
     <p>We want to format this text :)</p>
</div>

Some people use selector like:

一些人使用选择器:

div > p {
     something
}

And others:

及其他:

div p {
     something
}

What's the difference in this case? In my opinion - none?

这种情况有什么不同?在我看来——没有?

And by the way, isn't the descendant item always a child?! What's the difference between the two? I'm reading w3.org but can't get it :)

顺便问一下,后代的东西是不是永远都是孩子?这两者之间有什么区别?我正在读w3。org,但却无法得到:)

Thank you!

谢谢你!

2 个解决方案

#1


28

Simple:

简单:

 div > p

affects only direct children.

只影响直接的孩子。

 div p

affects grandchildren, grandgrandchildren etc. as well. (Won't make a difference in your example)

影响孙辈、孙辈等。(在你的例子中不会有什么不同)

The child selector isn't supported by IE6.

该子选择器不受IE6的支持。

更多相关文章

  1. 使用ui.router如何让一个控制器成为另一个控制器的孩子?
  2. 如何让父母与孩子一起成长?
  3. 孩子放在父母的兄弟姐妹后面。
  4. 从孩子那里访问父类的财产

随机推荐

  1. android 状态栏透明,源码修改教程
  2. Android控件基本属性介绍
  3. Android:Debug certificate expired on D
  4. android 获取设备型号
  5. android > 调用拨打电话 并子线程监控然
  6. 基于Phone模块的Service实现
  7. Android API 指南
  8. Android使用系统Intent实现分享功能及将
  9. android横屏竖屏 实现
  10. Android游戏开发学习(1)--android设置全