Time for action – creating our static HTML file

We'll need a single HTML file for this design, so let's create it and start setting it up:

  1. Open your HTML or text editor and create a new, fresh index.html file.
  2. Add the following to the very first line in the document:
    <!DOCTYPE html>
  3. Save your index.html file.

What just happened?

We created a new HTML file to contain our mockup and added the DOCTYPE declaration to it.

You must always specify DOCTYPE in all HTML documents, so that the browser knows what type of document to expect. If you're familiar with the different DOCTYPE declarations for HTML 4.0, or XHTML Strict, or Transitional, you probably remember it being a fairly lengthy line of code. The great news is that with HTML5, things just got a whole lot simpler.

Tip

Don't forget, even though it's such a simple declaration, you still need the basic DOCTYPE declaration when using HTML5.

The semantic body

After our DOCTYPE, we can add the other essential requirements of an HTML file, the html tags, head tags, title tags, and body tags.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset