The stylesheet is used in HTML to describe how a document is presented on screen. With CSS, easily specify a number of style properties for an HTML element. Each property has a name and a value, which is separated by a colon (:).
You can use CSS in three ways in your HTML document −
Just keep in mind each property declaration is separated by a semi-colon (;). Use the style attribute to add CSS to the HTML elements and attribute. This is how you can add inline style sheet and set text color −
You can try to run the following code to add a style sheet to an HTML page
<!DOCTYPE html> <html> <head> <title>HTML style sheet</title> </head> <body> <h1 style="color:red"> Heading </h1> <p style="color:blue"> This is demo text </p> </body> </html>