HTML elements are the fundamentals of HTML. HTML documents are simply a text file made up of HTML elements. These elements are defined usingHTML tags. HTML tags tell your browser which elements to present and how to present them. Where the element appears is determined by the order in which the tags appear.
OK, lets look more closely at the example that we created in the previous lesson.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>HTML Tutorial Example</title> </head> <body> <p>Less than 5 minutes into this HTML tutorial and I've already created my first homepage!</p> </body> </html>
Explanation of the above code:- The <!DOCTYPE... > element tells the browser which version of HTML the document is using.
- The <html> element can be thought of as a container that all other tags sit inside (except for the !DOCTYPE tag).
- The <head> tag contains information that is not normally viewable within your browser (such as meta tags, JavaScript and CSS), although the<title> tag is an exception to this. The content of the <title> tag is displayed in the browser's title bar (right at the very top of the browser).
- The <body> tag is the main area for your content. This is where most of your code (and viewable elements) will go.
- The <p> tag declares a paragraph. This contains the body text.
You'll also notice that the closing tag is slightly different to the opening tag - the closing tag contains a forward slash (/) after the <. This tells the browser that this tag closes the previous one.
UPPERCASE or lowercase?
Therefore... Good: <head>
Bad: <HEAD>
In the next lesson, we learn about some of the more common formatting tags.
Bad: <HEAD>
In the next lesson, we learn about some of the more common formatting tags.
0 comments:
Post a Comment