CSS Introduction

CSS (Cascading Style Sheets) is a stylesheet language used to describe the presentation and design of web pages written in HTML. It controls the layout, colors, fonts, and overall look of a website, separating the structure (HTML) from the style.


Why Use CSS?

Separate content from design: Keep your HTML code clean by managing visual styles in a separate CSS file.

Apply consistent styles across multiple pages: Use one stylesheet for the entire site to maintain consistency.

Enhance user experience: Create visually appealing and responsive designs for better interaction.

Responsive design: Make websites adjust and look good on different devices like mobile phones, tablets, and desktops.

Basic Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Introduction</title>
<style>
/* CSS code */
body {
background-color: lightblue;
font-family: Arial, sans-serif;
}
h1 {
color: navy;
text-align: center;
}
p {
color: darkgray;
font-size: 18px;
}
</style>
</head>
<body>
<h1>Welcome to CSS</h1>
<p>This is a simple example of how CSS styles a web page.</p>
</body>
</html>

Try it yourself


Whereisstuff is simple learing platform for beginer to advance level to improve there skills in technologies.we will provide all material free of cost.you can write a code in runkit workspace and we provide some extrac features also, you agree to have read and accepted our terms of use, cookie and privacy policy.
© Copyright 2024 www.whereisstuff.com. All rights reserved. Developed by whereisstuff Tech.