You can add attributes to elements in the document.
What is an attribute?
Surely you remember that the elements of a structure in HTML documents and tells the browser how you want your website (for example, <br /> tells the browser to create a new line). Some items may contain more information. This additional information are called attributes.
Example 1:
<h2 style="background-color:#ff0000;"> My friendship with HTML </ h2>
Attributes are always placed in the opening tag and the attribute value is placed in quotation marks. We use a semicolon to separate values ??for the attribute style. We'll come back to this later.
What's the catch?
There are many different attributes. First you will learn a style attribute. Using the style attribute, you can add layout to your website. For example, background color:
Example 2:
<html>
<head>
</head>
<body style="background-color:#ff0000;">
</body>
</html>
<head>
</head>
<body style="background-color:#ff0000;">
</body>
</html>
Shows a red page in the browser - check and see for yourself. For a while we explain exactly how the system works colors.
Note that some tags and attributes using the American spelling for example. color instead of color. It is important for you to be careful using the same spelling that we have in przykładachw course - otherwise, your browser does not understand the code. Also, do not forget to put quotation marks at the end of the attribute value.