简体   繁体   中英

Why do we need to use element when we have already stated class?

In css, if a person has already stated a class then why does he need to use element after that like what will be the benefits of doing that. For example: There is a class of "content" in element So what will be the difference in css between: .content h1 {...} And .content {....}

.content h1代表任何h1标签到所有具有 class 作为content的元素内的任何级别的子组件,而.content指的是具有 class 作为content的元素。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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