Skip to content

ElderNuel/Web-Development-Week-3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

CSS Box Model Demonstration

Project Overview

This project demonstrates the fundamentals of CSS styling with a focus on the CSS Box Model. It showcases how HTML elements are structured as rectangular boxes and how CSS properties like margin, padding, border, and content work together to create visual layouts.

Files

  • index.html: The main HTML file containing the page structure and content
  • styles.css: The external CSS stylesheet containing all styling rules

Features

1. Box Model Visualization

  • Interactive demonstration of content, padding, border, and margin
  • Live controls to adjust spacing values
  • Visual representation of how each property affects element layout

2. Typography Examples

  • Heading styles from H1 to H4
  • Paragraph styling with various text formatting
  • Link styling and hover effects

3. Layout Techniques

  • Flexbox implementation for responsive layouts
  • CSS Grid for component organization
  • Spacing and alignment examples

4. Styled Components

  • Button styles with hover effects
  • Card components with shadows and rounded corners
  • Interactive elements with visual feedback

CSS Concepts Demonstrated

Box Model Properties

  • margin: Controls external spacing between elements
  • padding: Controls internal spacing within elements
  • border: Defines element boundaries
  • content: The actual content of the element

Styling Techniques

  • Color schemes and gradients
  • Typography styling (font-size, line-height, etc.)
  • Flexbox and CSS Grid layouts
  • Responsive design with media queries
  • Hover effects and transitions
  • Box shadows and rounded corners

How to Use

  1. Download both index.html and styles.css
  2. Place them in the same directory
  3. Open index.html in a web browser
  4. Explore the different sections to see CSS concepts in action
  5. Use the interactive controls to adjust box model properties

Browser Compatibility

This project uses modern CSS features that work in all current browsers including:

  • Chrome (60+)
  • Firefox (60+)
  • Safari (12+)
  • Edge (79+)

Code Structure

HTML Structure

The HTML follows semantic markup practices with:

  • <header> for the page header
  • <nav> for navigation
  • <main> for primary content
  • <section> for content sections
  • <footer> for the page footer

CSS Organization

The CSS is organized with logical sections:

  1. CSS Reset and base styles
  2. Typography styles
  3. Layout components
  4. Box model demonstration
  5. Responsive design queries

Customization

You can easily customize this project by:

  1. Modifying color variables in the CSS
  2. Adjusting spacing values for different layouts
  3. Adding new components following the existing patterns
  4. Extending the responsive design for specific screen sizes

Learning Objectives

This project helps developers understand:

  • How to connect CSS to HTML using external stylesheets
  • The impact of the CSS Box Model on layout and spacing
  • How to use basic CSS properties effectively
  • Techniques for creating responsive designs
  • Best practices for CSS organization and maintainability

License

This project is created for educational purposes. Feel free to use and modify as needed.

About

Assignment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors