Basic CSS Example
In this example, we will use all of them with different properties.
<!-- File name: index.html -->
<!DOCTYPE html>
<html>
<head>
<!-- Importing External CSS -->
<link rel="stylesheet" href="style.css" />
<!-- Using Internal CSS -->
<style>
h2 {
color: green;
}
</style>
</head>
<body>
<!-- Using Inline CSS -->
<h2 style="text-align: center;">Welcome To GFG</h2>
<p>CSS Tutorial - w3wiki</p>
</body>
</html>
/* External CSS */
/* File name: style.css */
p {
text-align: center;
}
Output:
CSS Example Output
Also Check: Recent Articles on CSS
CSS Tutorial
CSS (Cascading Styling Sheet) is the language that defines the presentation of a document written in a markup language like HTML. CSS is the language that transforms a basic HTML structure into a user-friendly and visually beautiful webpage. It can change the font, color, size, and spacing of content, split it into multiple columns, or add animations and other features.
In this CSS Tutorial, we’ll learn all the basic to advanced concepts of CSS such as CSS properties, selectors, functions, media queries, and more.
Contact Us