Css

 What is CSS?

CSS stands for Cascading Style Sheets.

It is used to style and design web pages.

If HTML is the structure (like walls of a house 🏠),

then CSS is the design (color, paint, decoration).

πŸ”Ή Why do we use CSS?

CSS is used to:

Add colors

Change fonts

Set backgrounds

Adjust spacing

Design layouts

Make websites look attractive ✨

πŸ”Ή Simple Example

HTML

Copy code

<!DOCTYPE html>

<html>

<head>

<style>

  h1 {

    color: blue;

    text-align: center;

  }

</style>

</head>

<body>


<h1>Hello World</h1>


</body>

</html>

πŸ‘‰ In this example:

h1 text becomes blue

Text is center aligned

πŸ”Ή Types of CSS

Inline CSS

Inside the HTML tag

HTML

Copy code

<h1 style="color:red;">Hello</h1>

Internal CSS

Inside <style> tag in <head>

External CSS (Best method)

Separate .css file

HTML

Copy code

<link rel="stylesheet" href="style.css">

πŸ”Ή Basic CSS Syntax

CSS

Copy code

selector {

   property: value;

}

Example:

CSS

Copy code

p {

   color: green;

   font-size: 20px;

}

p → selector

color → property

green → value


Comments

Popular posts from this blog

Jalebi recpie

DS Algorithm

Bandi Madhurima