HTML Headings Are Defined With The To Tags
HTML Headings Are Defined With The To Tags
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
HTML Paragraphs
HTML paragraphs are defined with the <p>
tag.
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
HTML Links
HTML links are defined with the <a> tag.
<a
href="http://www.w3schools.com">This
is a link</a>
HTML Images
HTML images are defined with the <img>
tag.
<body>
<p>This is my first paragraph.</p>
</body>
The <body> element defines the body of the
HTML document.
The element has a start tag <body> and an
end tag </body>.
The element content is another HTML
element (a p element).
The <html> element:
<html>
<body>
<p>This is my first paragraph.</p>
</body>
</html>
<p>This is a paragraph
<p>This is a paragraph
The example above will work in most
browsers, but don't rely on it. Forgetting the
end tag can produce unexpected results or
errors.
Note: Future version of HTML will not allow
you to skip end tags.
Attribute Example
HTML links are defined with the <a> tag.
The link address is specified in the href
attribute:
<a
href="http://www.w3schools.com">This
is a link</a>
Always Quote Attribute Values
Attribute values should always be
enclosed in quotes.
Double style quotes are the most
common, but single style quotes are also
allowed.
Tip: In some rare situations, when the
attribute value itself contains quotes, it is
necessary to use single quotes:
name='John "ShotGun" Nelson'
HTML Tip: Use Lowercase Attributes
Attribute names and attribute values are
case-insensitive.
However, the World Wide Web
Consortium (W3C) recommends
lowercase attributes/attribute values in
their HTML 4 recommendation.
Newer versions of (X)HTML will demand
lowercase attributes.
HTML Headings
Headings are defined with the <h1> to
<h6> tags.
<h1> defines the largest heading. <h6>
defines the smallest heading.
<h1>This is a heading</h1>
<h2>This is a heading</h2>
<h3>This is a heading</h3>
Note: Browsers automatically add an
empty line before and after a heading.
Headings Are Important
HTML Lines
The <hr /> tag creates a horizontal line
in an HTML page.
The hr element can be used to separate
content:
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
<hr />
<p>This is a paragraph</p>
HTML Comments
Comments can be inserted into the HTML
code to make it more readable and
understandable. Comments are ignored
by the browser and are not displayed.
Comments are written like this:
<!-- This is a comment -->
HTML Paragraphs
Paragraphs are defined with the <p> tag.
<p>This is a paragraph</p>
<p>This is another paragraph</p>
HTML Line Breaks
Use the <br /> tag if you want a line
break (a new line) without starting a new
paragraph:
<p>This is<br />a para<br />graph with
line breaks</p>
HTML Formatting Tags
http://www.w3schools.com/images/boat.g
if.
The browser displays the image where
the <img> tag occurs in the document. If
you put an image tag between two
paragraphs, the browser shows the first
paragraph, then the image, and then the
second paragraph.
HTML The Alt Attribute
The required alt attribute specifies an
alternate text for an image, if the image
cannot be displayed.
The value of the alt attribute is an
author-defined text:
<img src="boat.gif" alt="Big Boat" />
The alt attribute provides alternative
information for an image if a user for
some reason cannot view it (because of
slow connection, an error in the src
attribute, or if the user uses a screen
reader).
Basic Notes - Useful Tips
Note: If an HTML file contains ten
images - eleven files are required to
display the page right. Loading images
take time, so my best advice is: Use
images carefully.
Note: When a web page is loaded, it is
the browser, at that moment, that
actually gets the image from a web
server and inserts it into the page.
Therefore, make sure that the images
actually stay in the same spot in relation
to the web page, otherwise your visitors
will get a broken link icon. The broken
link icon is shown if the browser cannot
find the image.
HTML Tables
HTML Tables
Tables are defined with the <table> tag.
A table is divided into rows (with the
<tr> tag), and each row is divided into
data cells (with the <td> tag). td stands
for "table data," and holds the content of