CSS Practice
How to change text color in CSS:
For CSS class use . (dot) and for CSS ID use # (hash)
=============================
HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<title>This is a page with CSS</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="red">This is a red text</div>
<div class="green">This is a green text</div>
</body>
</html>
----------------------------------
CSS:
#red{
color: red;
}
.green{
color: green;
}
===================================
Comments
Post a Comment