Start Tag Content End Tag
<p> But it’s my only line! </p>
The start tag is also called the opening tag while the end tag is also called the closing
tag. By the way, the name, or the abbreviation of the n ame of the element is written
inside the tag s. In particular, p stands for a para graph. The closing tag sho uld have an
additional slash (/) before the element’s name.
In order for a paragraph to show in the br owser, we need to add two more things to
get what is generally considered the minimum H TML document. The first line should
be a spe cial dec la ration called DOCTYPE, wh ic h makes a clear announcement that
HTML5 content follows. Th e DOCTYPE declaration is written within angle bra ck-
ets with a preceding exclamation mark and the html keyword after it: <!DOCTYPE
html>. Althoug h it looks like a tag , this is actually the only part of an HTML docu-
ment that isn’t a tag or an elemen t. As a m atter of fact, this code is here for historical
reasons. I don’t want to kill you with details, but you have to include it if you want
your document to be interpreted by the browser correctly.
One more thing that the minimum do cument should conta in is a <tit le> element.
This element is necessary as it identifies the document even w hen it appears out of
context, say as a user’s bookmark or in search results. The document should contain
no more than one <ti tle> element.
Putting it all together, we get the following code:
<!DOCTYPE html>
<title>The Smallest HTML Document</title>
<p>But it’s my only line!</p>
Maria: You just showed us what the document code should look like. But I still don’t
know whe re to type the code and how to view the resulting page.
1.3 The Too ls
Professor: You can use any plain text editor you like. For example, you can use the
Windows No te pad, which is already on your computer if you use Windows.
Mike: What if I don ’t use Windows?
Professor: It doesn’t matter. Just about any operating systems c ontains a plain text
editor. Personally, I use Notepad++, a programm er-friendly free text editor (
notepad-
plus-plus.org
).
After you ty pe the code, it is important that yo u save the file with a
.htm or .html
extension. While it doesn’t really matter which one y ou use, it is q uite important that
you choose one and stick to it consistently. Otherw ise, you could throw yourself into
a r eal mess. For example, you could easily end up editing two dierent files ( same
names, dierent extensions) thinking they’re one and the same file.
1.3. The Tools 3
..................Content has been hidden....................

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