Task list
Structure of HTML page1/10
Back to the list of tasks
  1. 1. Where HTML begins
  2. 2. The simplest HTML page
  3. 3. HTML page title
  4. 4. HTML page encoding
  5. 5. Connecting styles
  6. 6. Connecting external styles
  7. 7. The mystery of the CSS editor
  8. 8. Connecting scripts
  9. 9. Connecting external scripts
  10. 10. Connecting external styles and scripts again
Nest task
  • Courses
  • Sign up
  • Log in

Loading...
It will be ready in a few seconds.

  • Theory
  • Theory

Where HTML begins

Every HTML document must begin with a document type declaration. The document type is needed so that the browser can determine the HTML version and render the page correctly.

For example, for an older version of HTML 4.01, the doctype looks like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

And for the latest version of HTML, it's already much easier:

<!DOCTYPE html>

The latest version of HTML is also called HTML5. But since this version is already accepted as a standard and distributed almost everywhere, we'll just call it HTML.

  • index.html
  • style.css
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Declaring DOCTYPE</title> <link rel="stylesheet" href="style.css"> </head> <body> </body> </html>
CSS
body { margin: 0; min-height: 100vh; background-color: #f5f5f5; background-image: url("instructor.jpg"); background-position: 50% 50%; background-size: cover; background-repeat: no-repeat; }

The code has changed, click "Update" or enable autorun.

You have moved to another page

Click inside the mini-browser to highlight this window.

100%
GoalsCompleted
0
    1. Change the HTML doctype to a modern one.

    © 2023-2024, codehero.pro