i
What Do You Mean By HTML and CSS?
Common HTML Terms
Creating HTML Document Structure
Common CSS Terms
Selectors
Referencing CSS
CSS Resets
Getting to Know HTML And Semantics Overview
Identifying Divisions and Spans
Using Text Based Element
Building Structure
Creating Hyperlinks
Getting to Know CSS :The Cascade
Calculating Specificity
Combining Selectors
Layering Styles With Multiple Classes
Common CSS Properties
CSS Aural Media/Style Sheets
CSS Pagination
CSS Overflow
CSS White Space
CSS Word Wrap
CSS Outline
CSS Visibility
CSS Counters
CSS Animation
CSS Transition
CSS Tooltips
CSS Tooltip Animation
CSS Arrow
CSS Flexbox
CSS Media Queries
CSS 2D Transforms
CSS 3D Transforms
How are Elements Displayed?
Display Property Controls And Box Model?
Working With Box Model
Width and Height
Margins and Padding
Borders, Individual Border Sides, Border Radius, Box Sizing, Content Box and Padding Box
Developer Tools
Removing Spaces between Inline-Block Elements
Positioning With Floats
Floats in Practice
Positioning With Inline-Block
Clearing and Containing Floats
Creating Reusable Layouts
Uniquely Positioning Layouts
Adding Colour To Text
Changing Font Properties
Font Family
Font Size, Font Style, Font Variant, Font Weight And Line Height
Shorthand Font Properties
Applying Text Properties
Text Properties All Together
Using Web-Safe Fonts
Including Citation And Quotes
Adding A Background Colour
Adding a Background Image and Background Repeat
Background Position and Shorthand Background Image Values
Designing Gradient Backgrounds
Changing the Direction of a Gradient Background
Using Multiple Background Images
Exploring New Background Properties
Unordered Lists
Ordered Lists
Description Lists
Nested Lists
List Item Styling
List Style Type Values
List Style Position Property
Adding Media And Adding Images
Sizing Images
Positioning Images, Inline Positioning Images, Blocking Positioning Images , Positioning Images Flush Left or Right
Adding Audio
Adding Videos
Adding Inline Frames
Semantically Identifying Figures And Captions
Building Forms And Initializing a Form
Text Fields And Text Areas
Multiple Choice Inputs And Menus
Form Buttons
Other Inputs
Organizing Form Element
Form And Input Attributes
Login Form Example
Organizing Data with Tables
Creating A Table
Table Header
Table Structure
Table Head, Body and Foot
Combining Multiple Cells
Table Borders
Table Striping
Aligning Text
Completely Styled Table
HTML Coding Practices
Use the Proper Document Structure
Keeping the Syntax Organized
Use Practical ID and Class Values
CSS Coding Practices
Write CSS Using Multiple Lines and Spaces
Use Proper Class Names
Build Proficient Selectors
Use Desired Classes When Needed
Use Shorthand Hexadecimal Color Values
Drop Units Zero Values
HTML abbr tag
HTML acronym tag (Not for HTML 5)
HTML area tag
HTML basefont tag
HTML blockquote tag
HTML datalist tag
HTML Description List
HTML ins tag
Marquee HTML Tag
HTML object tag
HTML picture tag
HTML SVG
Every selector used in CSS has its specific weight. A selector's placement and weight in the cascade determines how its style should get rendered.
In the 1st Chapter, we talked about 3 kinds of selectors: type, class and ID selectors. Each of them comes with different specificity weight.
The type selector comes with the least specificity weight with a point value of 0-0-1. The class selector comes with medium specificity weight with a point value of 0-1-0. The highest specificity weight is of ID selector with a point value of 1-0-0. We can see here that the specificity points gets determined by utilizing three columns. The 1st column counts ID selectors, the 2nd one counts Class selectors, and the 3rd one counts Type selectors.
Whenever there is a styling conflict, then the selector with a higher specificity weight is said to be more superior. Suppose at one place a paragraph is chosen using a Type selector, and at the second instance, a paragraph is selected using an ID selector. As the ID selector has more specificity value, it will take the precedence regardless of the cascade.
Let's take an example of that.
The HTML code contains a paragraph element with 'food' as the id attribute value. In our CSS code, the paragraph is selected using two kinds of selectors, one is the Type, and the other is the ID selector. Though the Type selector comes after the ID selector, the ID selector outweighs the Type selector since it has a higher specificity weight and the paragraph will get displayed with the green background.
We need to remember the specificity weight of different selectors. It may happen that the CSS code is not giving up the desired styling. The reason for the break in the cascade may be due to the specificity weight.
Seeing how the specificity and cascade work is a tremendous obstacle, and we'll keep on covering this subject. But for now, let's see how can we be more intentional and particular with our selectors by combining them.
Don't miss out!