Html basics setup is not accurate


#1

The baseline html structure starts with and should end with . There doesn't need to be a secondary after the opening DOCTYPE.


#2

Hello!

The basic HTML structure is as follows:

<!DOCTYPE html>
<html>
<head>
<title>(Title goes here)</title>
</head>
<body>

</body>
</html>


Paragraphs and headings
#3
<!DOCTYPE html>

That is just to have the editor kind of "proofread" your code. It says to the editor "right away, I want to make all of this code into the html doctype." And you're correct there is no closing argument for this. This is its own line, and will change all code in the editor. Which is why we want it at the top of the editor so we know right away that it's there, and that is how this code is formatted.


#4

Mainly used for working with older editors.... In modern IDE's/editors you shouldn't need to use it, but when working with PHP it might come in handy, because not every web server is up-to-date to parse undefined code.


#5

or <!doctype html>, is a declaration which by definition is absolute. This document has as its root element <html></html>. That's what we declare.

Underlying this is the engine behind the user agent parsing it, which is by and large HTML5. There are other declarations that should be bundled into a standard template: Human Readable Language and Character Set Encoding,

 <html lang="EN-CA">
  <head>
    <meta charset="UTF-8">
    <title>After the above</title>
  </head>
  <body>
  </body>
</heml>

We can, as it were, encode our CSS and string portions of JS external files.

@charset "UTF-8";

@ rules appear at the top of a style sheet and this one is best if it is first for all practical purposes.

The JS side is better explained here,

http://ecmanaut.blogspot.ca/2006/07/encoding-decoding-utf8-in-javascript.html

As far as PHP goes, it's legacy PHP that's the issue, not modern HTML. That's just text to PHP. It could care less.

How do I know this? I'm paying 6 bucks a month for legacy PHP support in my hosting plan. The site is 13 years old. To rid myself of this expense I have to root out all the legacy PHP. As if. I dug and dug and dug and still haven't got to the bottom of it. Half of my stuff is PHP is one way or another.

Edit... Just had a brain fart. Of course encoding will have a bearing with PHP in later builds. I take back what I said earlier about just text.