Zed-King Study app · Free
O Level students across India practise here, free
Google login · no Play Store needed
About this PDF
Cascading Style Sheets — selectors, properties and page styling
This is part of the free O Level M2-R5.1 study material in the Zed-King Study Zone. You can read every page above in your browser, or download the file and study offline. Zed-King Group of Institute is a NIELIT Study Centre in Kaithal, Haryana, and all of this material follows the current NIELIT syllabus.
- Course
- O Level — NIELIT Foundation Diploma
- Module
- M2 — M2-R5.1: Web Designing and Publishing
- Section
- Chapterwise Notes
- Format
- PDF — read online or download
- Price
- Free, no sign-up required
Text from this PDF
The opening pages as plain text — open the reader above for tables, diagrams and the full file.
CHAPTER-4 CSS(Cascading Style Sheet)
“ Think • Code • Beautify ” Topics Covered Introduction to CSS Types of CSS CSS Selectors CSS Properties Index – CSS Sr. No. Topics Page No.
4.1 Introduction to CSS
4.1.1 CSS Features
4.1.2 Advantages of CSS
4.1.3 Major Differences between CSS, CSS2, CSS3
4.1.4 Define CSS Comments
4.2 Types of CSS
4.3 CSS Selectors
4.3.1 CSS Syntax
4.3.2 Types of Selectors
4.3.2.1 Universal Selector
4.3.2.2 ID Selector
4.3.2.3 Tag Selector
4.3.2.4 Class Selector
4.3.2.5 Sub Selector
4.3.2.6 Attribute Selector
4.3.2.7 Group Selector
4.4 CSS Properties
4.4.1 Background Properties
4.4.2 Block Properties
4.4.3 Box Properties
4.4.4 List Properties
4.4.5 Border Properties
4.4.6 Positioning Properties
4.4.7 Text Properties
4.4.8 Font Properties
4.4.9 Table Properties
4.4.10 Menu Design
4.4.11 Image Gallery Definition:-
Chapter 4 CSS (Cascading Style Sheet)
4.1 Introduction to CSS CSS = Cascading Style Sheets Developed by Wium Lie in 1996.
Supported by all modern browsers.
It is a stylesheet language used to control the presentation (look) of HTML documents.
It defines how elements are displayed on screen, paper, or other media.
CSS brings style, layout, and responsiveness to web pages.
It styles HTML elements decides color, size, spacing, layout, background, fonts.
"Cascading" means priority order:
Example Program in CSS:- Inline CSS > Internal CSS > External CSS
4.1.1 CSS Features Major Features of CSS
1. Separation of Structure and Style HTML structure (content).
CSS style (design).
Example: HTML makes a paragraph, CSS changes its color & size.
2. Less Code & Reusability One CSS file can be linked with hundreds of web pages.
Reduces code duplication saves time.
3. Consistency Across Pages Ensures uniform look on all pages (fonts, colors, layouts).
4. Cascading (Priority Order)
CSS applies styles based on priority:
a. Inline CSS (Highest)
b. Internal CSS
c. External CSS
d. Browser default (Lowest)
5. Responsive Web Design Websites adjust automatically on mobile, tablet, desktop.
Done using media queries, flexbox, grid.
6. Improved Performance External CSS files are cached by browsers.
Websites load faster.
7. Advanced Styling & Visual Effects Supports colors, gradients, shadows, filters, transitions, animations.
Makes websites interactive and attractive.
8. Layout Management CSS provides powerful tools:
Box Model margin, border, padding, content.
Flexbox one-dimensional layouts.
Grid two-dimensional layouts.
Positioning & Float element placement.
9. Cross-Browser Compatibility Works on all modern browsers.
10. Media Support Can design for different media types:
Screen (websites)
Print (print-friendly CSS)
Speech (screen readers for blind users)
11. Easy Maintenance Change once in CSS automatically updates all linked pages.
12. Platform Independence Works on any OS (Windows, Linux, Mac, Android, iOS).
Open standard (no license required).
Example Code Demonstrating Features
4.1.2 Advantages of CSS CSS Saves Time one file can be used for many pages.
Consistent Design same look everywhere.
Responsive Design works on mobile, tablet, desktop.
Easy to Update one change reflects on all pages.
Beautiful Styles colors, fonts, animations, effects.
Cross Browser works on Chrome, Firefox, Edge, etc.
Faster Pages external CSS is cached by browser.
Media Support different styles for print, screen, speech.
Free & Open no license, works on all devices.
Quick Memory Trick CSS1 = Basic Styling CSS2 = Layout Control CSS3 = Modern Effects + Responsive Design
4.1.3 Major Differences Between CSS, CSS2, and CSS3 First version of CSS.
Provided basic styling only (colors, fonts, text alignment, background).
Very limited features.
No support for advanced layouts, animations, or media queries.
Extension of CSS1 with more control over layouts.
Introduced:
Positioning (absolute, relative, fixed)
Z-index (stacking order)
Media types (screen, print, speech)
Bidirectional text support (for languages like Arabic, Hebrew).
Still one big specification (not modular).
Better browser support compared to CSS1.
CSS3 – 1999 onwards (modular)
Biggest update to CSS, still evolving.
Modular structure (broken into separate modules like selectors, backgrounds, animations, etc.).
Introduced:
Advanced Selectors nth-child(), :last-child, :not()
Responsive Design media queries, flexible layouts Advanced Layouts Flexbox, Grid, Multi-column Backgrounds & Borders gradients, multiple backgrounds, border-radius, box-shadow Animations & Effects transitions, keyframe animations, transforms (2D/3D)
Color Models RGBA, HSLA, opacity Typography web fonts (@font-face), text-shadow, word-wrap Major Differences between CSS, CSS2, and CSS3 in Tabular Form Feature / Version CSS (CSS1) CSS2 CSS3 Introduced 1996 1998 1999 (modular updates continue till now)
More chapterwise notes for M2-R5.1
Try this HTML, CSS and JavaScript live — free
Type any tag or style from these notes into our free editor, press Run and see the page change. The explained examples show the code and the result side by side.
Prepare for O Level with expert guidance
Classroom training, practical labs and exam registration at Zed-King Institute, Kaithal.
