Week 1 Day 3: CSS Introduction

This commit is contained in:
2025-12-17 16:18:55 +05:30
parent f834744e2a
commit 0c51607942
4 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
# CSS Styling Basics
## Introduction
CSS stands for Cascading Style Sheets.
It is used to style and layout web pages — for example, to change font sizes, colors, spacing, and the general look of HTML content.
## What is CSS?
- CSS is a style sheet language used alongside HTML.
- It separates content (HTML) from presentation (CSS).
## Why Use CSS?
- Makes webpages visually attractive.
- Helps control layout and design across many pages.
- Keeps HTML clean and focused only on structure.
## CSS Syntax
A CSS rule has two parts:
- Selector: chooses the HTML element(s) to style
- Declaration block: contains style properties and values.
## How CSS is Applied
CSS can be added in 3 ways:
Inline inside an HTML tag
Internal inside <style> in the HTML <head>
External as a separate .css file linked from the HTML
## Basic Style Properties
color text color
background-color background color
font-size size of text
margin, padding spacing control
Example:
h1 {
color: blue;
font-size: 2em;
}