Basic Page
First, make sure you've picked the correct doctype. The basic structure of a page looks like this:
<!-- Insert doctype here -->
<html>
<head>
<title>Your page title</title>
</head>
<body>
// Everything here will show up, this is where you put your contents.
</body>
</html>
- html marks the beginning of the page. It indicates that it is a HTML document.
- head is where you put informations about your page. Anything put here is invisible and don't show up when your page is loaded. It's mostly used for metatags, stylesheets, and so on. This is where you put your page title, between the title element.
- body is the container for all your contents and design.
In order to produce valid codes, there are a few rules to respect:
- Elements must be in lowercase.
- The codes need to be properly nested. (In short, your codes must be "symmetrical")
- "Empty" elements such as br, hr, input, img, meta, etc. must be closed too.
- Attributes values must be put between quotation marks.
- You must put alt="" in images and area tags.
Leave a Comment
Works? Doesn't work? Other tips? Please leave a comment! :)