diff --git a/Week-1/Day-4/Readme.md b/Week-1/Day-4/Readme.md new file mode 100644 index 0000000..63adea6 --- /dev/null +++ b/Week-1/Day-4/Readme.md @@ -0,0 +1,29 @@ + +# Week 1 – Day 4: CSS Notes + +## 📅 Date +18 December 2025 + +## 🎯 Objective +To understand and practice the core fundamentals of CSS used for styling and layout in web development. + +## 📘 Topics Covered +- CSS introduction and syntax +- Inline, internal, and external CSS +- Selectors (element, class, ID) +- Colors and text styling +- CSS box model +- Width, height, and units +- Display and position properties +- Background styling + +## 📂 Files Included +- `css-notes-day4.md` – Detailed theory notes +- `index.html` – Practice HTML file +- `style.css` – CSS styling file + +## 🧠 Learning Outcome +Gained a strong foundation in CSS fundamentals required for building structured and visually appealing web pages. + +## ✅ Status +Completed diff --git a/Week-1/Day-4/css-notes-day4.md b/Week-1/Day-4/css-notes-day4.md new file mode 100644 index 0000000..8410aa3 --- /dev/null +++ b/Week-1/Day-4/css-notes-day4.md @@ -0,0 +1,124 @@ +# CSS Notes + +## Introduction to CSS +CSS (Cascading Style Sheets) is used to style and visually format HTML elements. It controls layout, colors, fonts, spacing, and overall presentation of web pages. CSS helps maintain separation between content (HTML) and design (CSS). + +## Ways to Apply CSS + +### 1. Inline CSS +CSS written directly inside an HTML tag. +

Hello World

+Not recommended for large projects. + +### 2. Internal CSS +CSS written inside a + +### 3. External CSS (Preferred) +CSS written in a separate .css file. + +Reusable, clean and professional + +## CSS Selectors + +### Element Selector +p { + color: green; +} + +### Class Selector +.box { + background-color: yellow; +} + +### ID Selector +#main { + width: 100%; +} + +### Group Selector +h1, h2, h3 { + font-family: Arial; +} + +## Colors in CSS + +### Color Formats +Named colors: red, blue +Hex: #ff5733 +RGB: rgb(255, 87, 51) +RGBA: rgba(0, 0, 0, 0.5) + +### Text & Font Styling +Common Properties +p { + font-size: 16px; + font-family: Arial, sans-serif; + font-weight: bold; + text-align: center; +} + +### Text Decoration +a { + text-decoration: none; +} + +## CSS Box Model (Very Important) +Every HTML element consists of: +Content +Padding +Border +Margin +div { + padding: 10px; + border: 2px solid black; + margin: 15px; +} +Understanding the box model is crucial for layout control. + +## Width, Height & Units +Units Used +px – fixed size +% – relative +em – relative to parent +rem – relative to root element +.container { + width: 80%; + height: 200px; +} + +## Display Property +Common Values +block +inline +inline-block +none +span { + display: inline-block; + width: 100px; +} + +## Position Property (Basics) +Types +static (default) +relative +absolute +fixed +.box { + position: relative; + top: 10px; + left: 20px; +} + +## Background Styling +body { + background-color: #f5f5f5; +} + +### Background image: +div { + background-image: url("image.jpg"); + background-size: cover; +} \ No newline at end of file diff --git a/Week-1/Day-4/index.html b/Week-1/Day-4/index.html new file mode 100644 index 0000000..7dce9e6 --- /dev/null +++ b/Week-1/Day-4/index.html @@ -0,0 +1,46 @@ + + + + + CSS Fundamentals Practice + + + + +
+

CSS Fundamentals

+

Week 1 – Day 4 Practice

+
+ +
+

About CSS

+

+ CSS is used to style HTML elements and improve the visual appearance + of web pages. It allows developers to control layout, spacing, colors, + fonts, and overall design. +

+
+ +
+

Topics Practiced

+ +
+ +
+
Box One
+
Box Two
+
Box Three
+
+ + + + + diff --git a/Week-1/Day-4/style.css b/Week-1/Day-4/style.css new file mode 100644 index 0000000..c2ad990 --- /dev/null +++ b/Week-1/Day-4/style.css @@ -0,0 +1,64 @@ +/* General Page Styling */ +body { + font-family: Arial, sans-serif; + background-color: #f2f2f2; + margin: 0; + padding: 0; +} + +/* Header Styling */ +#main-header { + background-color: #0047ab; + color: white; + text-align: center; + padding: 20px; +} + +/* Section Styling */ +.content { + background-color: white; + margin: 20px; + padding: 15px; + border: 1px solid #ccc; +} + +/* Paragraph Styling */ +.description { + font-size: 16px; + line-height: 1.6; + color: #333; +} + +/* List Styling */ +ul { + padding-left: 20px; +} + +li { + margin-bottom: 8px; +} + +/* Box Model Practice */ +.box-container { + margin: 20px; +} + +.box { + display: inline-block; + width: 120px; + height: 80px; + background-color: #ffa500; + color: white; + text-align: center; + line-height: 80px; + margin: 10px; + border: 2px solid #cc8400; +} + +/* Footer Styling */ +footer { + background-color: #333; + color: white; + text-align: center; + padding: 10px; +}