CSS stands for Cascading Style Sheet. Cascading Style Sheets (CSS) is a simple mechanism for adding style(e.g., fonts, colors, background-colors, spacing) to Web documents.
<!DOCTYPE>
<html>
<head>
<style>
</style>
</head>
<body>
<h1>
Write Your First CSS Example</h1>
<p>
This is Paragraph.</p>
</body>
</html>
<!DOCTYPE>
<html>
<head>
<style>
</style>
</head>
<body>
<h1>
Write Your First CSS Example</h1>
<p>
This is Paragraph.</p>
</body>
</html>
As have seen in example above, CSS used to describe the look and formatting of a document written in markup language (HTML). It provides an additional feature to HTML. It is commonly combined with HTML to modify the appearance of web pages and user interfaces.. Additionally, it can be used with any XML document type, including plain XML, SVG, and XUL.
CSS is used along with HTML and JavaScript in most websites to create user interfaces for web applications and user interfaces for many mobile applications.
We are going to explain how to add your own CSS because now you know what CSS is used for.
A CSS rule is made up of two parts: a selector and a declaration block..
Selector: The selector identifies the HTML element to be styled. It could be any tag like <h1>
, <p>
etc.
Declaration Block: The declaration block can include one or more declarations separated by a semicolon. For the above example, there are two declarations:
Notes: If you're going to make another declaration, don't forget to put a semicolon at the end of the previous one, as we did after color: blue and font-size: 12 px we added semicolon(;). If you omit semicolon you will have error.
p
is a selector in CSS (it a tag of the HTML element you want to style: <p>
).color
is a property, and red is the property valuetext-align
is a property, and center is the property valueNow we'll look at how to specify the HTML element to which you want to apply CSS.
NextTotal: RWF 0.00