CSS is used to style HTML elements, and it is interpreted by the browser to apply the defined styles to the HTML content. CSS styles are applied to HTML elements in three main parts: the selector, the property, and the value.
A selector targets the HTML element that you want to style. It could be any HTML tag like <h1>, <p>, <table>, etc. The styles defined will be applied to all instances of that HTML tag.
A property is an attribute of the HTML tag that you want to style. These properties are similar to the attributes in HTML and include things like color, font-size, border, etc.
The value is assigned to the property to define how the property should be styled. For example, the color property can have values such as red or #F1F1F1.
selector {
property: value;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>CSS Syntax Example</title>
<style>
h1 {
color: blue;
font-size: 24px;
}
p {
color: #333;
line-height: 1.6;
}
</style>
</head>
<body>
<h1>WAY TO CODE TECHNOLOGIES</h1>
<p>This is a development company.</p>
</body>
</html>