logo

Introduction to CSS

Cascading Style Sheets (CSS) is a stylesheet language used to describe the presentation of a document written in HTML. It controls layout, colors, fonts, and responsive behavior.

Why Learn This?

Separation of Concerns

CSS allows you to separate visual design from your website’s structural HTML, making site-wide theme changes effortless.

Responsive Design

Using media queries, CSS ensures your website looks beautiful on massive desktop monitors and tiny smartphone screens simultaneously.

Animations & Effects

Modern CSS3 allows you to build powerful 3D transforms, glowing shadows, and smooth layout transitions without needing Javascript.

How to Attach CSS

CSS is natively supported by browsers. Create a `.css` file and link it directly into your HTML document.

Inside your HTML <head> tag:
styles.css
1<!-- External CSS File (Best Practice) --> 2<link rel="stylesheet" href="styles.css"> 3 4<!-- Internal CSS Block --> 5<style> 6 body { 7 background-color: #0a1123; 8 color: white; 9 } 10</style>

Official Learning Resources