CSS practical exercises

Below is a set of CSS practical exercises designed to cover the full course content outlined in your syllabus, particularly focusing on Competency 10: Develops websites incorporating multimedia technologies (using HTML5) and Competency 10.5: Uses Style Sheets to change the appearance of web pages . Each exercise includes a description, syllabus coverage, aim, and CSS code.

Exercise 10.1: Basic CSS Styling

Description : Write a CSS file to style an HTML page by changing the background color, font size, and text alignment.
Syllabus Coverage : Introduction to style sheets, syntax, and basic formatting.
Aim : Introduce students to CSS basics and how to link it with HTML.

Exercise 10.2: Using CSS Selectors

Description : Write a CSS file that uses element, class, and ID selectors to style different parts of an HTML page.
Syllabus Coverage : CSS selectors (element, class, ID).
Aim : Teach students how to use different types of CSS selectors effectively.

Exercise 10.3: Internal vs. External CSS

Description : Create two versions of the same webpage—one using internal CSS and the other using external CSS.
Syllabus Coverage : Ways of inserting CSS (internal, external).
Aim : Teach students the difference between internal and external CSS.

External CSS Example :

styles.css

Exercise 10.4: Formatting Links and Lists

Description : Write a CSS file to style hyperlinks and lists (ordered and unordered).
Syllabus Coverage : Appearance formatting (links, lists).
Aim : Teach students how to style links and lists for better user experience.

Exercise 10.5: Styling Tables

Description : Write a CSS file to style a table with borders, alternating row colors, and hover effects.
Syllabus Coverage : Appearance formatting (tables).
Aim : Teach students how to make tables visually appealing and functional.

Exercise 10.6: Responsive Design

Description : Write a CSS file to create a responsive layout that adjusts based on screen size.
Syllabus Coverage : Advanced CSS concepts (responsive design).
Aim : Introduce students to responsive web design principles.

Exercise 10.7: Animations

Description : Write a CSS file to create animations like fading or sliding effects.
Syllabus Coverage : Advanced CSS concepts (animations).
Aim : Teach students how to add dynamic effects to web pages.

Exercise 10.8: Flexbox Layout

Description : Write a CSS file to create a flexible layout using Flexbox.
Syllabus Coverage : Advanced CSS concepts (Flexbox).
Aim : Introduce students to modern layout techniques.

Exercise 10.9: Grid Layout

Description : Write a CSS file to create a grid-based layout.
Syllabus Coverage : Advanced CSS concepts (Grid).
Aim : Teach students how to use CSS Grid for complex layouts.

Exercise 10.10: Transitions

Description : Write a CSS file to create smooth transitions for hover effects.
Syllabus Coverage : Advanced CSS concepts (transitions).
Aim : Teach students how to enhance interactivity with smooth transitions.

Above exercises comprehensively cover the CSS-related topics in your syllabus, including selectors , formatting , tables , lists , responsive design , animations , Flexbox , and Grid . They are designed to progressively build students’ skills while aligning with the learning outcomes.

Below are advanced CSS exercises that go beyond the syllabus, exploring modern and creative techniques in web design. These exercises will help you deepen your understanding of CSS and its capabilities in creating visually stunning and interactive websites.

Exercise 1: CSS Grid for Complex Layouts

Description : Create a responsive magazine-style layout using CSS Grid.
What You Learn : Advanced CSS Grid techniques for complex layouts.
Code Example :

Exercise 2: CSS Animations for Loading Spinners

Description : Create a custom loading spinner using CSS animations.
What You Learn : Advanced CSS animations and keyframes.
Code Example :

Exercise 3: Dark Mode Toggle

Description : Create a toggle button to switch between light and dark modes using CSS variables.
What You Learn : CSS variables, pseudo-classes, and interactivity.
Code Example :

Exercise 4: Parallax Scrolling Effect

Description : Create a parallax scrolling effect using CSS and HTML.
What You Learn : Background attachment and scroll effects.
Code Example :

Exercise 5: Custom Scrollbars

Description : Customize the appearance of scrollbars using CSS.
What You Learn : Pseudo-elements and scrollbar styling.
Code Example :

Exercise 6: Glassmorphism Design

Description : Create a glassmorphism-inspired card using CSS.
What You Learn : Transparency, blur effects, and modern design trends.
Code Example :

Exercise 7: Hover Effects with CSS Transitions

Description : Create interactive hover effects on buttons or images using CSS transitions.
What You Learn : Transition properties and hover states.
Code Example :

Exercise 8: Neon Glow Effect

Description : Create a neon glow effect for text or buttons using CSS.
What You Learn : Box shadows and glowing effects.
Code Example :

Exercise 9: CSS Clip-Path for Creative Shapes

Description : Use clip-path to create unique shapes like circles, polygons, or custom designs.
What You Learn : Advanced CSS clipping and masking.
Code Example :

Exercise 10: Interactive Navigation Menu

Description : Create an interactive navigation menu with dropdowns and hover effects.
What You Learn : Dropdown menus, hover effects, and positioning.
Code Example :

These exercises explore advanced CSS concepts such as Grid , animations , transitions , custom scrollbars , glassmorphism , clip-path , and interactive elements . They provide practical, real-world applications of CSS and will help you explore areas beyond the syllabus.

Spread the love