Your browser does not support JavaScript!
Upvotes Anonymous 0 User 0

HTML Attributes

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.
Was this helpful?

Tags

Comments

Leave a Comment

I agree to the Terms of Service
Design © 2015, Downranked, LLC.,
Original user code contributions under MIT License