- Mastering CSS
- Rich Finelli
- 153字
- 2021-07-08 09:45:53
Descendant selectors
Renaming elements with classes, as you learned in the previous section, is an extremely powerful feature in CSS. However, that's not the only way to target a specific type of element. Descendant selectors will allow you to target elements on a page based on their ancestor elements. This is often necessary because you only want to apply a margin or a new font based on the context of the element. You can use a descendant selector to get that context without putting a class on every element every time you want to target it. I'm going to first explain what parent, sibling, and child elements are as well as what ancestor and descendant elements are. We'll need to be clear about these if we want to use descendant selectors. We'll follow this up by using a practical example of the descendant selector and finishing up by calculating the descendant selector's weight.
- Advanced Splunk
- R語言經典實例(原書第2版)
- AIRAndroid應用開發實戰
- Eclipse Plug-in Development:Beginner's Guide(Second Edition)
- 精通網絡視頻核心開發技術
- 重學Java設計模式
- JavaScript 程序設計案例教程
- Creating Stunning Dashboards with QlikView
- Visual Basic程序設計上機實驗教程
- Terraform:多云、混合云環境下實現基礎設施即代碼(第2版)
- Python硬件編程實戰
- Mastering OAuth 2.0
- C# 7.0本質論
- Mastering Drupal 8
- Python數據可視化之matplotlib實踐