CSS 1st Class
CSS 1st Class
<html> HTML was NEVER intended to contain tags for formatting a web
<body> page!
• Each declaration includes a CSS property name and a value, separated by a colon.
• Multiple CSS declarations are separated with semicolons, and declaration blocks are
surrounded by curly braces.
<head> <style> •p is a selector in CSS (it points to the HTML element you want to style:
p { <p>).
text-align: center;
color: red; •color is a property, and red is the property value
} •text-align is a property, and center is the property value
</style> </head>
TYPES OF CSS – EXTERNAL CSS
<!DOCTYPE html>
<html> body {
<head>
HTML FILe
background-color: lightblue;
<link rel="stylesheet" href="style.css"
> }
</head>
<body> h1 {
color: navy;
<h1>This is a heading</h1> margin-left: 20px;
<p>This is a paragraph.</p> }
</body>
</html> CSS File (style.css)
CSS CODES TO TRY
• background-color: red;
• text-decoration-line: underline;
• text-transform: uppercase;
• CSS Comments
• Comments are used to explain the code, and may help when you edit
the source code at a later date.
• Comments are ignored by browsers.
/* This is a comment */