Web Dev
Web Dev
      What HTML is
      Basic HTML document structure
      Writing your first HTML code
✅ 1. What is HTML?
HTML (HyperText Markup Language) is used to build the structure of web pages. Think of
it as the skeleton of every website.
<!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>
🧠 Explanation:
         Tag                   Description
<!DOCTYPE html>   Tells the browser to use HTML5
<html>            The root of the HTML document
<head>            Contains metadata (title, styles, etc.)
<title>           Title shown on the browser tab
<body>            The visible content on the web page
<h1>              Main heading (biggest text)
<p>               Paragraph
👉 Do this:
<!DOCTYPE html>
<html>
  <head>
    <title>My Profile</title>
  </head>
  <body>
    <h1>Your Name</h1>
    <p>I am learning HTML to build websites!</p>
    <em>"The journey of a thousand miles begins with a single step."</em>
    <hr>
    <p>Check out <a href="https://www.wikipedia.org"
target="_blank">Wikipedia</a></p>
    <br>
    <strong>More coming soon...</strong>
  </body>
</html>
🚀 Once done:
Reply:
Awesome! Let’s continue with Day 2: Headings, Paragraphs, Lists & Links.
Headings and paragraphs are essential to structuring content in a way that is readable and logical.
📝 Headings:
Headings help break up content into sections. There are six levels of headings in HTML (<h1> to
<h6>), where <h1> is the largest and most important, and <h6> is the smallest.
📝 Paragraphs:
Paragraphs are written inside <p> tags. Paragraphs help break up long sections of text into
digestible pieces.
<p>This is a paragraph of text. It will be displayed as a block of text on the
web page. Paragraphs are used for text content.</p>
✅ 2. Lists
HTML supports two types of lists: ordered lists and unordered lists.
<ol>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ol>
<ul>
  <li>Apple</li>
  <li>Banana</li>
  <li>Cherry</li>
</ul>
📝 Nested Lists:
<ul>
  <li>Fruit
     <ul>
       <li>Apple</li>
       <li>Banana</li>
     </ul>
  </li>
  <li>Vegetables
     <ul>
       <li>Carrot</li>
       <li>Spinach</li>
     </ul>
  </li>
</ul>
✅ 3. Links
Links (<a>) are used to navigate between pages or websites.
📝 Creating a Link:
To create a link to another webpage, you use the <a> tag with an href attribute (this defines the
URL).
If you want to open the link in a new tab, you add the target="_blank" attribute.
Example:
<!DOCTYPE html>
<html>
  <head>
    <title>My Day 2 HTML Practice</title>
  </head>
  <body>
    <h1>My Favorite Hobbies</h1>
    <h2>Why I Love Coding</h2>
    <p>Coding is my passion because it allows me to create cool websites and
apps.</p>
     <h3>Hobbies I Enjoy:</h3>
     <ul>
       <li>Reading</li>
       <li>Coding</li>
       <li>Gaming</li>
     </ul>
       <h3>Top 3 Languages:</h3>
       <ol>
         <li>Python</li>
         <li>JavaScript</li>
         <li>HTML/CSS</li>
       </ol>
🎯 Your Goal:
        Display images
        Create tables to organize data
        Understand basic form elements
✅ 1. Images in HTML
The <img> tag is used to display an image.
🧪 Example:
✅ 2. Tables in HTML
  Tag      Meaning
<table> Table container
<tr>    Table row
<td>    Table cell (data)
<th>    Table header
🧪 Example:
<table border="1">
  <tr>
    <th>Name</th>
    <th>Age</th>
  </tr>
  <tr>
    <td>Alice</td>
    <td>22</td>
  </tr>
  <tr>
    <td>Bob</td>
    <td>25</td>
  </tr>
</table>
✅ 3. Intro to Forms
Forms are used to collect input from the user. Common tags:
    Tag             Description
<form>        Container for input fields
    Tag           Description
<input>    Single-line text or buttons
<label>    Describes input field
<textarea> Multi-line text area
<button>   Button to submit or click
🧪 Example:
<form>
  <label for="name">Your Name:</label><br>
  <input type="text" id="name" name="name"><br><br>
  <button type="submit">Submit</button>
</form>
🔍 Example Layout:
<!DOCTYPE html>
<html>
  <head>
    <title>Day 3 Practice</title>
  </head>
  <body>
    <h1>Welcome to My Page</h1>
    <p>Here's an image, a table, and a form for practice.</p>
    <h2>User Table</h2>
    <table border="1">
      <tr>
        <th>Name</th>
           <th>Age</th>
           <th>Country</th>
         </tr>
         <tr>
           <td>Alice</td>
           <td>22</td>
           <td>USA</td>
         </tr>
         <tr>
           <td>Bob</td>
           <td>25</td>
           <td>India</td>
         </tr>
       </table>
       <h2>Contact Form</h2>
       <form>
         <label for="name">Name:</label><br>
         <input type="text" id="name" name="name"><br><br>
         <label for="msg">Message:</label><br>
         <textarea id="msg" name="msg" rows="4" cols="40"></textarea><br><br>
      <button type="submit">Send</button>
    </form>
  </body>
</html>
🏁 Once done:
Reply:
   Tag                 Use
<header>    Page or section header
<nav>       Navigation menu
<main>      Main content of the page
<section>   Grouping related content
<article>   Self-contained content
<aside>     Side content, ads
<footer>    Footer area of the page
🧪 Example:
<body>
  <header>
    <h1>My Website</h1>
    <nav>
       <a href="#">Home</a> | <a href="#">Contact</a>
    </nav>
  </header>
  <main>
    <section>
      <h2>About Me</h2>
      <p>I love coding websites!</p>
    </section>
  </main>
  <footer>
    <p>© 2025 Hassan</p>
  </footer>
</body>
✅ 2. Advanced Form Inputs
🔹 Radio Buttons
<p>Gender:</p>
<input type="radio" id="male" name="gender" value="male">
<label for="male">Male</label>
🔹 Checkboxes
<p>Hobbies:</p>
<input type="checkbox" id="reading" name="hobby" value="Reading">
<label for="reading">Reading</label>
🔹 Dropdown Menu
<label for="country">Select Country:</label>
<select id="country" name="country">
  <option value="pakistan">Pakistan</option>
  <option value="india">India</option>
  <option value="usa">USA</option>
</select>
✅ 3. Form Validation
Required fields
<input type="text" name="fullname" required>
Email field
<input type="email" name="email" required>
Number field
<input type="number" name="age" min="1" max="100">
<!DOCTYPE html>
<html>
<head>
  <title>Day 4 Form</title>
</head>
<body>
  <header>
    <h1>Contact Me</h1>
  </header>
  <main>
    <section>
      <form>
         <label for="fullname">Full Name:</label><br>
         <input type="text" id="fullname" name="fullname" required><br><br>
         <label for="email">Email:</label><br>
         <input type="email" id="email" name="email" required><br><br>
         <p>Gender:</p>
         <input type="radio" id="male" name="gender" value="male">
         <label for="male">Male</label>
         <input type="radio" id="female" name="gender" value="female">
         <label for="female">Female</label><br><br>
         <p>Hobbies:</p>
         <input type="checkbox" id="coding" name="hobby" value="Coding">
         <label for="coding">Coding</label>
         <input type="checkbox" id="sports" name="hobby" value="Sports">
         <label for="sports">Sports</label><br><br>
         <label for="country">Country:</label>
         <select id="country" name="country">
           <option value="pakistan">Pakistan</option>
           <option value="india">India</option>
           <option value="usa">USA</option>
         </select><br><br>
         <button type="submit">Submit</button>
      </form>
    </section>
  </main>
  <footer>
    <p>© 2025 Hassan</p>
  </footer>
</body>
</html>
✅ Your Task:
Ready to begin?
Awesome, Hassan! Welcome to Day 5 of your HTML journey. Today you'll start adding
multimedia and controlling layout using basic HTML tools.
✅ 1. Adding Images
<img src="image.jpg" alt="Description" width="300" height="200">
Explanation:
Example:
<img src="https://via.placeholder.com/300" alt="Sample image" width="300">
✅ 2. Adding Audio
<audio controls>
  <source src="audio.mp3" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>
Explanation:
✅ 3. Adding Video
<video width="400" controls>
  <source src="video.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>
<div>
  <h2>My Blog</h2>
  <p>This is a blog post.</p>
</div>
  <h2>Image</h2>
  <img src="https://via.placeholder.com/300" alt="Sample Image">
  <h2>Audio</h2>
  <audio controls>
    <source src="audio.mp3" type="audio/mpeg">
    Your browser does not support audio.
  </audio>
  <h2>Video</h2>
  <video width="320" height="240" controls>
    <source src="video.mp4" type="video/mp4">
    Your browser does not support video.
  </video>
  <h2>Iframe (Wikipedia)</h2>
  <iframe src="https://www.wikipedia.org" width="600" height="300"></iframe>
</body>
</html>
🔧 Your Task:
Would you like me to give you practice questions or challenges after this?
Without CSS:
With CSS:
In style.css:
body {
  background-color: lightgray;
}
Example:
h1 {
  color: purple;
  font-size: 30px;
}
🔸 Background
body {
  background-color: #f0f0f0;
}
🔸 Borders
div {
  border: 2px solid black;
  padding: 10px;
  margin: 10px;
}
🧱 Starter Code:
<!DOCTYPE html>
<html>
<head>
  <title>Day 6 CSS</title>
  <style>
    body {
       background-color: #e0f7fa;
    }
    h1 {
       text-align: center;
       color: darkblue;
    }
    div {
       border: 2px solid gray;
       padding: 20px;
       background-color: #fdfdfd;
    }
  </style>
</head>
<body>
  <div>
    <p>This content is inside a styled div box.</p>
  </div>
</body>
</html>
Say “Done” when you finish your practice, or share your version for feedback.
Ready to make your page look beautiful with colors and layout? Let’s go!
p {
  color: red;
}
But what if you want to style just one paragraph or a group of elements separately?
HTML:
<p class="note">This is a note.</p>
<p class="note">Another note paragraph.</p>
CSS:
.note {
  color: green;
  font-style: italic;
}
HTML:
<h1 id="main-title">Welcome!</h1>
CSS:
#main-title {
  color: blue;
  font-size: 32px;
}
✅ 4. ✏️Example Code:
<!DOCTYPE html>
<html>
<head>
  <style>
    .highlight {
       background-color: yellow;
       color: red;
    }
    #header-title {
       text-align: center;
       font-size: 30px;
       color: blue;
    }
  </style>
</head>
<body>
</body>
</html>
🧪 Practice Task:
Make a page with:
When you’re ready, tell me "Done" or paste your code for feedback.
Would you like to continue to Day 8 after this?
Sure, Hassan! Let me explain the CSS Box Model in the most simple way possible — like
you're totally new. 😊
1️⃣Content
2️⃣Padding
3️⃣Border
       Thick or thin
       Solid or dashed
       Colored
4️⃣Margin
This is the space outside the box.
It’s the gap between this box and other boxes.
Imagine:
[       Margin        ]
+-------------------+ ← Border
|   [ Padding ]     |
|   | Content     |   |
|   [           ]   |
+-------------------+
✅ Try This
Make a box in your HTML + CSS and do this:
      Change the padding and watch how text moves inside the box.
      Change the margin and watch the whole box move away from others.
      Change the border and see how the outer line changes.
Would you like a practice challenge to test this understanding?
Or should I move you to Day 9: Display and Position?
🧠 1. display Property
🔹 Common Values:
🧪 Try This
index.html
style.css
.box {
  display: inline;
    background-color: yellow;
}
.block {
  display: block;
  background-color: lightblue;
  margin-top: 10px;
}
🧠 2. position Property
🔹 Values & What They Do:
🧪 Example
<div class="outer">
  <div class="inner">I'm absolute</div>
</div>
.outer {
  position: relative;
  height: 200px;
  background: #ddd;
}
.inner {
  position: absolute;
  top: 20px;
  left: 30px;
  background: orange;
}
🔹 clear
.clearfix {
  clear: both;
}
🧠 4. z-index
Controls which element is on top when overlapping.
.box1 {
  z-index: 2;
  position: absolute;
}
.box2 {
  z-index: 1;
  position: absolute;
}
🔧 Practice Task:
Try this mini layout:
HTML
<div   class="header">Header</div>
<div   class="left">Left Side</div>
<div   class="right">Right Side</div>
<div   class="footer">Footer</div>
CSS
.left {
  float: left;
  width: 40%;
  background: lightblue;
}
.right {
  float: right;
  width: 60%;
  background: lightgreen;
}
.footer {
  clear: both;
  background: gray;
}
When you're done practicing, say "Day 10" and we’ll move to Flexbox layout, a powerful
modern layout tool!
Awesome, Hassan! 🌟
Welcome to Day 10 – Flexbox, one of the most important and powerful tools in modern CSS
layout.
🧠 What is Flexbox?
Flexbox stands for Flexible Box Layout.
It helps you align, center, and distribute space in a container — without using float or
positioning.
CSS:
.container {
  display: flex;
  gap: 10px;
}
.box {
  background-color: skyblue;
  padding: 20px;
}
📐 Alignment Example:
.container {
  display: flex;
  justify-content: center;     /* center left-right */
  align-items: center;         /* center top-bottom */
  height: 300px;
  background-color: lightgray;
}
🧪 Practice Task
✅ Goal: Center 3 boxes in the middle of the page
index.html
<!DOCTYPE html>
<html>
<head>
  <title>Flexbox Center</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="container">
    <div class="box">Box 1</div>
    <div class="box">Box 2</div>
    <div class="box">Box 3</div>
  </div>
</body>
</html>
style.css
body {
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}
.container {
  display: flex;
  gap: 15px;
}
.box {
  background-color: steelblue;
  color: white;
  padding: 30px;
  font-size: 20px;
}
Would you like a Flexbox cheat sheet, or should we move to a mini layout project using
Flexbox next?
Great choice, Hassan! Here's a super simple and complete Flexbox cheat sheet that you can
use any time while working with layouts.
.container {
  display: flex;
}
This makes .container a flex container, and its children become flex items.
📌 Example
.container {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
}
.item {
  flex: 1;
  padding: 10px;
  background-color: lightblue;
}
Awesome, Hassan! 🌟 Welcome to Day 11 – CSS Grid — a major skill that web developers use
to create powerful, responsive page layouts.
🎨 CSS:
.grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns */
  gap: 10px;
}
.item {
  background-color: #0099cc;
  color: white;
  padding: 20px;
  text-align: center;
}
✅ Output:
A layout with 2 columns and 2 rows. Each .item fills one cell.
         Property                      Description
display: grid         Turns a container into a grid
grid-template-columns Defines number/size of columns
grid-template-rows    Defines number/size of rows
gap                   Adds space between rows/columns
        Property                            Description
place-items                Shorthand for align-items + justify-items
📦 Item Properties
  Property              Description
grid-column Start/end position of item (columns)
grid-row    Start/end position of item (rows)
grid-area   Name an area for placing items
🧪 Practice Task
Create a simple 2x3 grid layout for services (like cards).
✅ index.html
<!DOCTYPE html>
<html>
<head>
  <title>Grid Layout</title>
  <link rel="stylesheet" href="style.css">
</head>
<body>
</body>
</html>
✅ style.css
body {
  font-family: sans-serif;
  background: #f5f5f5;
  margin: 0;
  padding: 20px;
}
.grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.item {
  background: #007acc;
  color: white;
  padding: 30px;
  text-align: center;
  border-radius: 10px;
  transition: 0.3s;
}
.item:hover {
  background: #005999;
  cursor: pointer;
}
Perfect, Hassan! 🚀
Welcome to Day 13 – Media Queries & Responsive Design.
🧠 Syntax:
@media (max-width: 768px) {
  /* CSS rules here only apply when screen width ≤ 768px */
}
  <header>
    <h1>My About Page</h1>
  </header>
  <main class="container">
    <div class="text">
      <h2>About Me</h2>
      <p>Hi! I'm Hassan, and I'm learning HTML, CSS, and responsive
design.</p>
    </div>
    <div class="image">
      <img src="https://via.placeholder.com/300" alt="Me">
    </div>
  </main>
</body>
</html>
✅ style.css
body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
}
header {
  text-align: center;
  padding: 20px;
  background: #007acc;
  color: white;
}
.container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 30px;
}
.text {
  max-width: 400px;
}
.image img {
  width: 100%;
  max-width: 300px;
  border-radius: 10px;
}
    .image img {
      max-width: 100%;
    }
}
           Concept                       Use
@media                 Apply styles conditionally
max-width              Target small screens (like phones)
flex-direction: column Stack items vertically on small screens
✅ Challenge (Optional):
What’s next?
Absolutely, Hassan! Here's everything you need to know about @keyframes and CSS
animations — clearly and simply explained, with examples for each part. This is your complete
guide to mastering animations in CSS. 💡🧠
🎯 1. What is @keyframes?
@keyframes   is used to define a sequence of styles that an element should go through over time
— basically, steps of an animation.
🔧 Basic Syntax:
@keyframes animationName {
  0%   { /* starting style */ }
  100% { /* ending style */ }
}
@keyframes slideRight {
  from { transform: translateX(0); }
  to   { transform: translateX(200px); }
}
selector {
  animation: name duration timing-function delay iteration-count direction
fill-mode;
}
Example:
.box {
  animation: slideRight 2s ease-in-out infinite;
}
3. Common Animation Properties
       Property               What it does                              Example
animation-name     Name of the keyframes                   slideRight
animation-duration
                   Time for one full cycle (e.g. 2s,       2s
                   500ms)
animation-timing-                                          ease, linear, ease-in, ease-out,
function              Speed curve of animation             ease-in-out
animation-delay       Wait before animation starts         1s
animation-
iteration-count       How many times to run                1, infinite, 3
animation-                                                 normal, reverse, alternate,
direction             Direction of animation               alternate-reverse
animation-fill-       Defines final state (none, forwards, forwards
mode                  backwards, both)
💡 4. Full Example
🔷 HTML
<div class="box"></div>
🔷 CSS
.box {
  width: 100px;
  height: 100px;
  background-color: red;
  animation: moveBox 2s ease-in-out infinite alternate;
}
@keyframes moveBox {
  0%   { transform: translateX(0); }
  100% { transform: translateX(300px); background-color: blue; }
}
💥 What happens?
🧪 6. Practice Ideas
🟢 Fade In Text
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.text {
  animation: fadeIn 1.5s ease forwards;
}
🔵 Bouncing Ball
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-50px); }
}
.ball {
  animation: bounce 0.6s ease-in-out infinite;
}
🟣 Spin Loader
@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.loader {
  animation: spin 1s linear infinite;
}
✅ Summary
                    Key Part                               Meaning
@keyframes                                   Defines the steps of the animation
animation                                    Applies the animation to an element
Use with transform, opacity, color, position Most common properties to animate
      🧪 Practice challenges?
      🎯 A small animation project?
      🧠 Move to Day 15: CSS Variables?
Let me know!
🔸 Syntax:
:root {
  --main-color: #3498db;
  --font-size: 18px;
}
🔸 Using Variables:
h1 {
  color: var(--main-color);
  font-size: var(--font-size);
}
🧪 Practice Example
🔸 HTML:
<h1>Welcome</h1>
<p>This text is styled with CSS variables!</p>
🔸 CSS:
:root {
  --main-color: teal;
  --main-bg: #f0f0f0;
  --font-size: 20px;
}
body {
  background-color: var(--main-bg);
  font-size: var(--font-size);
}
h1 {
  color: var(--main-color);
}
🧠 Bonus Tip:
You can even override variables in specific sections:
.section-dark {
  --main-color: white;
  background-color: black;
  color: var(--main-color);
}
Awesome, Hassan! Let's move to Day 16 — you're getting close to mastering CSS 👊.
🔶 1. Pseudo-classes (:)
They style elements based on their state.
🔸 Common Examples:
    Selector                  Meaning
:hover        When user hovers over the element
:active       While element is being clicked
:focus        When an input field is focused
:first-child Targets the first child in a parent
:nth-child(n) Targets the nth child (like a row in table)
🧪 Example:
button:hover {
  background-color: green;
  color: white;
}
li:first-child {
  font-weight: bold;
}
p:nth-child(2) {
  color: red;
}
🔶 2. Pseudo-elements (::)
They add virtual elements before or after actual content — without HTML.
🔸 Common Examples:
       Selector           Purpose
::before       Adds content before element
::after        Adds content after element
::first-letter Styles the first letter of text
::selection    Styles selected text highlight
🧪 Example:
h1::before {
  content: "👉 ";
}
p::first-letter {
  font-size: 200%;
  color: red;
}
::selection {
  background: yellow;
  color: black;
}
🔧 Practice Challenge
Create a styled button and heading using pseudo-classes and pseudo-elements:
<!DOCTYPE html>
<html>
<head>
  <style>
    button {
        padding: 10px 20px;
        background-color: royalblue;
        color: white;
        border: none;
        cursor: pointer;
        transition: background-color 0.3s;
    }
    button:hover {
      background-color: darkblue;
    }
    h2::before {
      content: "★ ";
      color: gold;
    }
    h2::after {
      content: " ★";
      color: gold;
    }
    ::selection {
       background: yellow;
       color: black;
    }
  </style>
</head>
<body>
</body>
</html>
Let me know when you’re ready for Day 17: Responsive Design & Media Queries (for mobile-
friendly sites 📱)!
Awesome! Let’s move to Day 17 – Responsive Design & Media Queries — a critical skill in
modern web design. 🌍📱💻
You want your site to adjust automatically to fit all screen sizes!
🔹 Syntax:
@media (max-width: 600px) {
  body {
    background-color: lightblue;
  }
}
This means:
🧪 Practice Example:
🔸 HTML:
<h1>Responsive Page</h1>
<p>This layout changes with screen size!</p>
🔸 CSS:
body {
  background-color: white;
  font-size: 18px;
  text-align: center;
}
💡 Result:
🔹 Control Widths:
.item {
  flex: 1 1 200px; /* grow | shrink | base size */
}
💡 Flexbox Example:
<div class="container">
  <div class="box">Box 1</div>
  <div class="box">Box 2</div>
  <div class="box">Box 3</div>
</div>
.container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}
.box {
  background: tomato;
    padding: 20px;
    margin: 10px;
    flex: 1 1 150px;
    color: white;
}
.item {
  background-color: royalblue;
  color: white;
  padding: 20px;
  text-align: center;
}
.item2 {
  grid-column: span 2;
}
💡 When to Use What?
   Feature         Use Flexbox For               Use Grid For
1D layout     Aligning in a row or column
2D layout                                 Full page or complex layout
Auto wrapping Navigation bars
Exact control                             Image galleries, dashboards
➡️Day 19: CSS Units Deep Dive (em, rem, vh, vw, fr)?
Let me know!
Perfect! Let’s move to Day 19 – CSS Units — a must-know to control size, space, and layout
accurately in CSS. 📏
p {
  font-size: 16px;
}
👉 Use when exact size is needed (but not ideal for responsive designs)
🔶 2. Relative Units
These adjust automatically based on screen size or parent size.
🔶 3. Viewport Units
Viewport = screen size
      vw   = 1% of viewport width
      vh   = 1% of viewport height
h1 {
  font-size: 10vw;        /* 10% of screen width */
}
Means:
🎯 Summary Table:
Unit      Meaning       Responsive?               Use For
px Pixels (fixed size)  ❌           Small icons, borders, precise gaps
%   Percent of parent   ✅           Widths, margins, padding
em Based on parent font ✅           Spacing, scaling text in modules
rem Based on root font  ✅           Consistent global sizing
vw Viewport width       ✅           Big text, full-width banners
vh Viewport height      ✅           Full-screen layouts
fr Grid fraction unit   ✅           Grid layouts
Excellent choice! You're about to wrap up CSS like a pro. Let’s go through:
Keep styles in a .css file — keeps HTML clean and separates concerns.
IDs are meant for uniqueness; use classes for reusable styles.
/* Good */
.btn-primary, .nav-bar, .footer-text
/* Avoid */
.div1, a1, boxx
.card__title {}
.card--active {}
/* Layout */
.container { ... }
.grid { ... }
5. Use Shorthand
margin: 10px 20px 10px 20px;
/* instead of */
margin-top: 10px;
margin-right: 20px;
...
❌ <div style="color:red;">
✅ Use class with external CSS
.button {
  background-color: var(--main-color);
}
🔹 Option 2: Normalize.css
🧱 HTML (index.html)
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Mini Portfolio</title>
  <link rel="stylesheet" href="style.css" />
</head>
<body>
  <header>
    <h1>Hassan Khan</h1>
    <p>Web Developer & Learner</p>
  </header>
  <main>
    <section class="card">
      <img src="https://via.placeholder.com/150" alt="Profile Picture" />
      <h2>About Me</h2>
      <p>I love learning web development and building awesome projects.</p>
      <a class="btn" href="#">Contact Me</a>
    </section>
  </main>
  <footer>
    <p>© 2025 Hassan. All rights reserved.</p>
  </footer>
</body>
</html>
🎨 CSS (style.css)
/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  background-color: #f4f4f4;
  color: #333;
  text-align: center;
    padding: 20px;
}
header {
  margin-bottom: 20px;
}
.card {
  background-color: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 500px;
  margin: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.card img {
  width: 150px;
  border-radius: 50%;
  margin-bottom: 10px;
}
.btn {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}
/* Responsive */
@media (max-width: 600px) {
  .card {
    padding: 15px;
  }
    .btn {
      width: 100%;
    }
}
Would you like a project challenge based on this or should we now start JavaScript Day 1?