Introduction To HTML PDF
Introduction To HTML PDF
INTRODUCTION TO BASIC
• A browser does not display the HTML tags, but uses them
to determine how to display the document:
Example:
HTML Page Structure
Below is a visualization of an HTML page structure:
BASIC HTML TAGS
• <!DOCTYPE> • <p>
• <html > • <br>
• <he a d > • <h1>,<h2>,<h3>,<h4>, <h5>,<h6>
• <body> • <a>
• <ti tl e > • <img>
< ! D O CT Y PE h t m l >
• It tells the browser what version of HTML the document is written so that the
browser knows what to expect.
Example:
<html> Tag
• The <html> tag is the container for all other HTML elements (except for
the <!DOCTYPE> tag).
Note: You should always include the lang attribute inside the <html> tag, to
declare the language of the Web page. This is meant to assist search engines
and browsers.
Example:
<head> Tag
• The <head> element is a container for metadata (data about data) and is
placed between the <html> tag and the <body> tag.
• Metadata typically define the document title, character set, styles, scripts, and
other meta information.
Example:
< t i tl e > T a g
• The <title> tag defines the title of the document. The title must be text-only, and
it is shown in the browser's title bar or in the page's tab.
• The contents of a page title is very important for search engine optimization
(SEO)! The page title is used by search engine algorithms to decide the order
when listing pages in search results.
Example: Output:
<body> Tag
• The <body> element contains all the contents of an HTML document, such as
headings, paragraphs, images, hyperlinks, tables, lists, etc.
Example:
<p> Tag
• The <p> tag defines a paragraph.
• Browsers automatically add a single blank line before and after each <p>
element.
Example:
<br> Tag
• The <br> tag inserts a single line break.
• The <br> tag is an empty tag which means that it has no end tag.
Example:
Output:
<h1> to <h2> Tag
• <h1> defines the most important heading. <h6> defines the least important
heading.
Example: Output:
<a> Tag
• The <a> tag defines a hyperlink, which is used to link from one page to another.
• The most important attribute of the <a> element is the href attribute, which
indicates the link's destination.
Example:
<img> Tag
• The <img> tag is used to embed an image in an HTML page.
• Images are not technically inserted into a web page; images are linked to web pages. The <img> tag
creates a holding space for the referenced image.
Note: Also, always specify the width and height of an image. If width and height are not specified, the
page might flicker while the image loads.
Tip: To link an image to another document, simply nest the <img> tag inside an <a> tag (see example
below).
Example:
END OF DISCUSSION