Unit 2 Cascading Style Sheet(CSS)
Features
- Separates the presentation and contents of the HTML document
- Provide numerous attributes to create dynamic effects
- Simple
- Reusable
Style sheet
- A set of statements that specify presentation of a document
- A powerful mechanism for adding styles
- Styles can be assigned by the<STYLE></STYLE>tag
- Each rule is made up of a selector—usually an HTML element such as BODY,p,or h1
Advantages
Selectors
- Element selector
- Inheritance
- Class selectors
- ID selectors
- Contextual Selectors
- Grouping
- Pseudo-classes
Ways of specifying styles
- Inline
- Embedded(Internal style sheets)
- External style sheets(Linking)
- Importing
Ways to cascade style sheets
- By importing the Style sheet
- Multiple websites can use the same style sheet
Related Tags
- span
- div
Style properties