๐งฑ 1. What is HTML?
HTML (HyperText Markup Language) is the standard language for creating the structure of web pages.
๐น Key Concepts:
- Elements and tags:
<html>,<head>,<body>,<h1>,<p>, etc. - Attributes:
href,src,alt,id,class - Nesting and semantic structure
๐ก Example:
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello, world!</h1>
<p>This is my first HTML page.</p>
</body>
</html>
๐จ 2. What is CSS?
CSS (Cascading Style Sheets) is used to style and visually format HTML content.
๐น Key Concepts:
- Selectors: element, class (.class), ID (#id)
- Properties: color, font-size, margin, padding, etc.
- Cascading and specificity
- Inline, internal, and external styles
๐ก Example:
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
color: #333;
}
๐ 3. The Box Model
Every HTML element is a box with four layers: Content โ Padding โ Border โ Margin
- padding: space inside the element, around content
- border: visible frame
- margin: space outside the element
[ margin ]
[ border ]
[ padding ]
[ content ]
๐ 4. Layout Techniques
๐น Block vs Inline Elements:
- Block:
<div>,<section>,<p> - Inline:
<span>,<a>,<strong>
๐น Layout Systems:
- float: legacy system
- position: static, relative, absolute, fixed, sticky
- flexbox: modern layout system
- grid: advanced layout system (optional)
โ๏ธ 5. Responsive Design
Responsive websites adapt to different screen sizes and devices.
๐น Tools and Techniques:
Media Queries:
@media (max-width: 600px) {
body {
font-size: 16px;
}
}
- Flexible units: %, em, rem, vw, vh
- Mobile-first approach
๐ 6. Semantic HTML
Use meaningful, descriptive tags for better structure and accessibility:
<header>,<footer>,<main>,<nav>,<section>,<article>
โ Benefits:
- Accessibility
- SEO
- Clear code structure
๐งฐ 7. File Structure of a Website
project/
โโโ index.html
โโโ about.html
โโโ contact.html
โโโ styles/
โ โโโ main.css
โโโ images/
โ โโโ logo.png
โโโ scripts/
โโโ script.js
๐ 8. Developer Tools
- VS Code โ code editor
- Live Server โ live preview in browser
- DevTools โ inspect and debug pages
- Git & GitHub โ version control and deployment
๐ 9. Publishing with GitHub Pages
๐น Steps:
- Push your site to a public GitHub repository
- Go to Settings โ Pages
- Choose the branch (main) and folder (/root or /docs)
- GitHub provides a live link like:
https://yourusername.github.io/your-project/
๐ฏ Summary
- Write well-structured HTML documents
- Apply CSS to style and layout pages
- Build responsive designs for different devices
- Publish your project using GitHub Pages
โก๏ธ Now you're ready to move on to examples and exercises to reinforce what you've learned.