css



CSS Basics: Inline, Internal & External CSS (CSS ମୌଳିକ: ଇନ୍ଲାଇନ୍, ଇନ୍ଟର୍ନାଲ୍ ଏବଂ ଏକ୍ସଟର୍ନାଲ୍ CSS)

🔹 Introduction to CSS (CSS ପ୍ରସ୍ତାବନା)

CSS (Cascading Style Sheets) is used to style HTML elements. It allows web developers to control the layout, colors, fonts, and spacing of web pages.





🎨 Types of CSS (CSS ପ୍ରକାର)

🌟 Inline CSS - Applied directly inside an HTML tag using the `style` attribute.

🌟 Internal CSS - Defined inside the `<style>` tag within the `<head>` section of an HTML document.

🌟 External CSS - Stored in a separate `.css` file and linked to the HTML document using `<link>`.

🔹 Examples of Inline, Internal & External CSS

🔸 **Inline CSS Example:**


<p style="color: blue; font-size: 18px;">This is styled using inline CSS.</p>


🔸 **Internal CSS Example:**


<style>
p { color: red; font-size: 20px; }
</style>
<p>This is styled using internal CSS.</p>


🔸 **External CSS Example:**


<link rel="stylesheet" href="styles.css">
<p>This is styled using an external CSS file.</p>





📌 Using Class & ID in CSS (CSS ରେ Class ଏବଂ ID ବ୍ୟବହାର)

🌟 **Class (`.`) - Used to style multiple elements with the same styling.**


<style>
.highlight { color: green; font-weight: bold; }
</style>
<p class="highlight">This paragraph is highlighted.</p>


🌟 **ID (`#`) - Used to uniquely style a single element.**


<style>
#mainTitle { color: purple; font-size: 24px; }
</style>
<h1 id="mainTitle">This is a unique title.</h1>




🎨 Font Color & Background (ଅକ୍ଷର ରଙ୍ଗ ଏବଂ ପୃଷ୍ଠଭୂମି)

🌟 **Changing Font Color:**


<p style="color: blue;">This text is blue.</p>


🌟 **Changing Background Color:**


<body style="background-color: yellow;">


🌟 **Using Background Image:**


<body style="background-image: url('background.jpg');">






🔤 Character Spacing & Line Height (ଅକ୍ଷର ଭିତରେ ଅନ୍ତର ଏବଂ ଧାଡି ଉଚ୍ଚତା)

🌟 **Character Spacing (`letter-spacing`):**


<p style="letter-spacing: 3px;">This text has more space between letters.</p>


🌟 **Line Height (`line-height`):**


<p style="line-height: 1.8;">This paragraph has increased line height.</p>




🖼 Borders & Outlines (ସୀମା ଏବଂ ଆଉଟ୍ଲାଇନ୍)

🌟 **Adding a Border (`border`):**


<p style="border: 2px solid black;">This text has a black border.</p>


🌟 **Adding an Outline (`outline`):**


<p style="outline: 2px dashed red;">This text has a red dashed outline.</p>




📏 Margins & Padding (ମାର୍ଜିନ୍ ଏବଂ ପ୍ୟାଡିଂ)

🌟 **Margins - Controls the space outside an element.**


<p style="margin: 20px;">This paragraph has a margin of 20px.</p>


🌟 **Padding - Controls the space inside an element (inside the border).**


<p style="padding: 15px;">This paragraph has 15px padding.</p>




🎨 Font Family, Font Size, Hover Effects, Text Alignment, Image Positioning & CSS by Tag Names

🔹 Font Family & Font Size (ଅକ୍ଷର ପରିବାର ଏବଂ ଆକାର)

🌟 Font Family (`font-family`) - Used to define the typeface of text.

p {
font-family: Arial, sans-serif;
}
🌟 Font Size (`font-size`) - Used to control the size of the text.

h1 {
font-size: 24px;

}


🖱 Hover Effects (ହୋଭର୍ ପ୍ରଭାବ)

🌟 Change Color on Hover (`:hover`) - Used to change an element’s appearance when hovered.


button:hover {
background-color: blue;
color: white;
}


🌟 Add Underline on Hover


a:hover {
text-decoration: underline;
}




📝 Text Alignment (ଟେକ୍ସଟ୍ ଅଲାଇନ୍)

🌟 Left Alignment (`text-align: left;`)


p {
text-align: left;
}


🌟 Center Alignment (`text-align: center;`)


h2 {
text-align: center;
}


🌟 Right Alignment (`text-align: right;`)


div {
text-align: right;
}


🌟 Justify Alignment (`text-align: justify;`)


p {
text-align: justify;
}


🖼 Positioning Images (ପ୍ରତିଛବି ସ୍ଥାନିତ କରିବା)

🌟 Center an Image


img {
display: block;
margin: 0 auto;
}


🌟 Float Image to the Left


img {
float: left;
margin-right: 10px;
}


🌟 Float Image to the Right


img {
float: right;
margin-left: 10px;
}




🎯 Applying CSS by Tag Names (ଟ୍ୟାଗ ନାମ ଦ୍ୱାରା CSS ଆବଦ୍ଧ)

🌟 Style All `<p>` Elements

p {
color: green;
font-size: 18px;
}
🌟 Style All `<h1>` Headings

h1 {
font-weight: bold;
text-transform: uppercase;
}
🌟 Style All Links (`<a>`)

a {
color: red;
text-decoration: none;
}