I briefly mentioned elements in a previous post, but now I'll go into detail about them. HTML elements are everything from the opening tag to the closing tag, including the tags themselves. The element content is everything between the tags, which in some cases is nothing. When the element is empty, it's called (don't have to think much here) an empty element.
As you begin coding, you'll start creating nested HTML elements. That just means they contain other HTML elements. For example, the code below contains three nested elements:
<!DOCTYPE html>
<html>
<body>
<p>Yup, still a paragraph.</p>
</body>
</html>
Remember, always put an end tag! Some browsers will work fine if you forget it, but it's better to be safe than sorry. It sucks when you spend hours coding something, only to get an error because you missed a closing tag.
No comments:
Post a Comment