Every code of web includes a solid structure. Head, body are include in a html. In the content, one could add up title, headings and paragraphs.
Structure:
- The DOCTYPE declaration defines the document type to be HTML
- The text between <html> and </html> describes an HTML document
- The text between <head> and </head> provides information about the document
- The text between <title> and </title> provides a title for the document
- The text between <body> and </body> describes the visible page content
- The text between <h1> and </h1> describes a heading
- The text between <p> and </p> describes a paragraph
Tags:
The heading defined with <h1> to <h6> tages.
The link defined with <a>tag.
Images are defined with <img> tag, and the width and height are provided as attributes.
Attributes:
alt: Specifies an alternative text for image, when a HTML element can't be displayed.
title: Provide a tip information.
herf: Specifies a URL for a link.
id: A unique id for an element.
src: Specifies a URL for an image.
style: Specifies a CSS style for an element. (style="property:value;")
with style attribut, color, font and ect. could be defined(background-color;color;font-family;font-size;text-align).
Formatting:
Defines pre-formatted text.<pre>
Adding a head line.<hr>
Adding a line break.<br>
Bold text.<b>
Strong text.<strong>
Italic text.<i>
Emphasized text.<em>
Marked text.<mark>
Deleted text.<del>
Inserted text.<ins>
Subscripted text.<sub>
Superscripted text.<sup>
<!doctype HTML>
<html>
<head>
<title>Page Basic.</title>
</head>
<body style = "background-color:lightgrey;">
<h1>This is Heading 1.</h1>
<p>This is paragraph.</p>
<a href="http://www.google.cn/">This is a link(Edit here to modify displayed text)</a><br>
<img src = "w3schools.jpg" alt = "W3Schools.com" width = "104" height = 142>
<p title = "paragraph">This is a paragraph with a title.</p>
<pre style = "color:green; font-family:courier; font-size:150%; text-align:center;">
My Bonnie lies over the ocean.
My Bonnie lies over the sea.
My Bonnie lies over the ocean.
Oh, bring back my Bonnie to me.
</pre>
<h1 style = "color:red;">I'm a red heading</h1>
<p>This text is normal.</p>
<p><b>This text is bold.</b></p>
<p><strong>This text is strong.</strong></p>
<p><i>This text is italic.</i></p>
<p><em>This text is emphasized.</em></p>
<p>This text is small<small>small</small>.</p>
<p>This text is <mark>marked</mark>.</p>
<p>This text is <del>deleted</del>.</p>
<p>This text is <ins>inserted</ins>.</p>
<p>This text is <sub>subscripted</sub>.</p>
<p>This text is <sup>superscripted</sup>.</p>
<p>This text is <q>quoted</q>.</p>
<blockquote cite = "http://www.w3schools.com/html/html_quotation_elements.asp">
The HTML blockquote element defines a quoted section.
Browsers usually indent blockquote elements.
</blockquote>
</body>
</html>
References: