Introduction
CSS helps you make websites look nice and organized. It controls colors, fonts, and layout.
CSS helps you make websites look nice and organized. It controls colors, fonts, and layout.
selector {
property: value;
}p {
color: blue;
}h1 {
font-size: 2rem;
text-align: center;
}.button { background-color: green; color: white; padding: 1rem; }
This example shows a simple webpage styled with CSS inside the <style> tag. The heading is blue and centered. The paragraph text is dark gray and easy to read with spacing around it.
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>Simple CSS Example</title> <style> body { font-family: Arial, sans-serif; background-color: #f0f0f0; margin: 2rem; } h1 { color: #2a7ae2; text-align: center; } p { color: #333333; font-size: 1.2rem; max-width: 600px; margin: 1rem auto; line-height: 1.5; } </style> </head> <body> <h1>Welcome to CSS</h1> <p>CSS makes websites look beautiful and easy to read by adding colors, spacing, and fonts.</p> </body> </html>
CSS stands for Cascading Style Sheets.
You can write CSS inside your HTML file or in a separate file.
Using CSS keeps your website neat and easier to change later.
CSS controls how a webpage looks.
It uses selectors and properties to style elements.
CSS helps make websites pretty and user-friendly.
p { font-size: 1.5rem; color: blue; }div { background-color: #ff000; }Pass the test and this pattern moves unknown