Selectors, Specificity, and the Cascade Год: 2012 Автор: Eric A. Meyer Жанр: фронтенд, CSS, HTML Издательство: O'Reilly Media ISBN: 978-1-44934-249-4 Язык: Английский Формат: ePub Качество: Изначально компьютерное (eBook) Интерактивное оглавление: Да Количество страниц: 64 Описание: Exactly how does the "cascade" in Cascading Style Sheets work? This concise guide demonstrates the power and simplicity of CSS selectors for applying style rules to different web page elements. You’ll learn how your page’s presentation depends on a multitude of style rules and the complex ways they function—and sometimes collide—within the document’s structure. This guide is an excerpt from the upcoming fourth edition of CSS: The Definitive Guide.
Примеры страниц
Оглавление
Preface Conventions Used in This Book Using Code Examples Safari® Books Online How to Contact Us 1. Selectors Basic Style Rules Element Selectors Declarations and Keywords Grouping Grouping Selectors The universal selector Grouping Declarations Grouping Everything Class and ID Selectors Class Selectors Multiple Classes ID Selectors Deciding Between Class and ID Attribute Selectors Simple Attribute Selectors Selection Based on Exact Attribute Value Selection Based on Partial Attribute Values Matching one word in a space-separated list Matching a substring within an attribute value Matching a substring at the beginning of an attribute value Matching a substring at the end of an attribute value A Particular Attribute Selection Type Using Document Structure Understanding the Parent-Child Relationship Descendant Selectors Selecting Children Selecting Adjacent Sibling Elements Selecting Following Siblings Pseudo-Class Selectors Combining Pseudo-Classes Structural Pseudo-Classes Selecting the root element Selecting empty elements Selecting unique children Selecting first and last children Selecting first and last of a type Selecting every nth child Selecting every nth of a type Dynamic Pseudo-Classes Hyperlink pseudo-classes User action pseudo-classes Real-world issues with dynamic styling UI State Pseudo-Classes Enabled and disabled UI elements Check states The :target Pseudo-Class The :lang Pseudo-Class The Negation Pseudo-Class Pseudo-Element Selectors Styling the First Letter Styling the First Line Restrictions on ::first-letter and ::first-line Styling (Or Creating) Content Before and After Elements Summary 2. Specificity and the Cascade Specificity Declarations and Specificity Universal Selector Specificity ID and Attribute Selector Specificity Inline Style Specificity Importance Inheritance The Cascade Sorting by Weight and Origin Sorting by Specificity Sorting by Order Non-CSS Presentational Hints Summary About the Author Copyright
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum