๐จ CSS (Make Your Website Beautiful ๐ฅ)
๐ HTML builds structure, CSS makes it look amazing
๐ง What is CSS?
๐ CSS = Cascading Style Sheets
Used to style HTML elements
Controls:
โข Colors ๐จ
โข Fonts โ๏ธ
โข Spacing ๐
โข Layout ๐ฑ
๐ How to Add CSS?
โ 1. Inline CSS
<h1 style="color:red;">Hello</h1>
โ 2. Internal CSS
<style>
h1 {
color: blue;
}
</style>
โ 3. External CSS (Best Practice ๐ฅ)
<link rel="stylesheet" href="style.css">
h1 {
color: green;
}
๐ฆ CSS Box Model (Very Important)
๐ Every element = box
โข Content โ actual text
โข Padding โ space inside
โข Border โ edge
โข Margin โ space outside
๐ก This is asked in interviews a lot!
โก Flexbox (Layout King ๐)
๐ Used to align elements easily
.container {
display: flex;
justify-content: center;
align-items: center;
}
๐ก Example:
โข Center a button
โข Create navbar
๐งฑ Grid (Advanced Layout)
๐ Used for complex layouts
โข Rows + Columns
โข Perfect for dashboards
๐ฑ Responsive Design
๐ Website should work on:
โข Mobile ๐ฑ
โข Tablet
โข Desktop ๐ป
@media (max-width: 600px) {
body {
background-color: lightblue;
}
}
๐ฏ Mini Project (Do This ๐ฅ)
๐ Style your HTML page:
โข Change colors
โข Add spacing
โข Center content
โข Make button look good
๐ก Pro Tips
โข Learn Flexbox properly โ game changer
โข Donโt memorize โ practice layouts
โข Use DevTools to experiment
Double Tap โค๏ธ For More