- The <htm> element defines the whole document; it has a start tag <html> and an end tag.
- The element content is another HTML element (the <body> element).
<body>
<h1> My First Heading </h1>
<p> My first paragraph. </p>
</body>
</html>
- The <body> element defines the document body. It has a start tag <body> and an end tag </body>. The element content is two other HTML elements (<h1> and <p>).
<h1> My First Heading </h1>
<p> My first paragraph. </p>
</body>
- The <h1> element defines a heading. It has a start tag <h1> and an end tag </h1>.
- The element content is: My First Heading.
- The <p> element defines a paragraph. It has a start tag <p> and an end tag </p>. The element content is: My First paragraph.
DON'T FORGET THE END TAG!
SUMMARY
All HTML elements can have attributes.
- title attribute: provides additional "tool-tip" information; specifies extra information about an element
- href attribute: provides address information for links
- width and height attributes: provide size information for images
- alt attribute: text for screen readers
- disabled attribute: specifies that an input element should be disabled
- id attribute: specifies a unique id for an element
- src attribute: specifies the URL (web address for an image)
- style attribute: specifies the inline CSS style for an element
- value attribute: specifies the value (text content) for an input element
Use lowercase HTML attribute names.
Use quote attributes with double quotes.
No comments:
Post a Comment