Let's edit our basic HTML:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
Hi, here is some text.
</body>
</html>
and turn the background green. We can add a style attribute inside the <body> tag:
<body style="background-color: green">
The page then looks like this:
Attributes provide useful information that relates to the HTML element. For example, when you create a link in HTML, you provide an attribute that tells the browser where to send the user when the user clicks on the link.
Leave a comment