Documente Academic
Documente Profesional
Documente Cultură
The <body> element contains all the contents of an HTML document, such as
text, hyperlinks, images, tables, lists, etc.
Example
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
br
The <br> tag is an empty tag which means that it has no end tag.
Example
Caption
The <caption> tag must be inserted immediately after the <table> tag.
Example
<table>
<caption>Monthly savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Center
Example:
font
Example
Footer
authorship information
copyright information
contact information
sitemap
back to top links
related documents
Example
<footer>
<p>Posted by: Hege Refsnes</p>
<p>Contact information: <a href="mailto:someone@example.com">
someone@example.com</a>.</p>
</footer>
<h1> defines the most important heading. <h6> defines the least important
heading.
Example
<head> Tag
The <head> element can include a title for the document, scripts, styles, meta
information, and more.
Example
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
<header> Tag
logo or icon
authorship information
Example
<article>
<header>
<h1>Most important heading here</h1>
<h3>Less important heading here</h3>
<p>Some additional information here</p>
</header>
<p>Lorem Ipsum dolor set amet....</p>
</article>
<html> Tag
The <html> tag tells the browser that this is an HTML document.
The <html> tag is the container for all other HTML elements (except for
the <!DOCTYPE> tag).
<!DOCTYPE HTML>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
<img> Tag
The <img> tag defines an image in an HTML page.
The <img> tag has two required attributes: src and alt.
Note: Images are not technically inserted into an HTML page, images are linked
to HTML pages. The <img> tag creates a holding space for the referenced
image.
Tip: To link an image to another document, simply nest the <img> tag inside
<a> tags.
Example
<link> Tag
The <link> tag defines a link between a document and an external resource.
The <link> tag is used to link to external style sheets.
Example
<head>
<link rel="stylesheet" type="text/css" href="theme.css">
</head>
<table> Tag
The <table> tag defines an HTML table.
An HTML table consists of the <table> element and one or more <tr>, <th>,
and <td> elements.
The <tr> element defines a table row, the <th> element defines a table
header, and the <td> element defines a table cell.
A more complex HTML table may also include <caption>, <col>, <colgroup>,
<thead>, <tfoot>, and <tbody> elements.
Example
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<tbody> Tag
The <tbody> tag is used to group the body content in an HTML table.
The <tbody> element is used in conjunction with
the <thead> and <tfoot> elements to specify each part of a table (body,
header, footer).
The <tbody> tag must be used in the following context: As a child of a <table>
element, after any <caption>, <colgroup>, and <thead> elements.
Example
<table>
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
</table>
<td> Tag
The <td> tag defines a standard cell in an HTML table.
Example-
<table>
<tr>
<td>Cell A</td>
<td>Cell B</td>
</tr>
</table>
<tfoot> Tag
The <tfoot> tag is used to group footer content in an HTML table.
The <tfoot> tag must be used in the following context: As a child of a <table>
element, after any <caption>, <colgroup>, <thead>, and <tbody> elements.
Example
<table>
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody>
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>Sum</td>
<td>$180</td>
</tr>
</tfoot>
</table>
<p> Tag
The <p> tag defines a paragraph.
Example
<th> Tag
The <th> tag defines a header cell in an HTML table.
Example
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<title> Tag
The <title> tag is required in all HTML documents and it defines the title of the
document.
Example
<!DOCTYPE html>
<html>
<head>
<title>HTML Reference</title>
</head>
<body>
The content of the document......
</body>
</html>
<tr> Tag
The <tr> tag defines a row in an HTML table.
Example
<table>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<ul> Tag
The <ul> tag defines an unordered (bulleted) list.
Use the <ul> tag together with the <li> tag to create unordered lists.
Example
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
The <object> element is an inline element (it does not insert a new line on a
page), meaning that text and other elements can wrap around it. Therefore, it
can be useful to specify the alignment of the <object> according to surrounding
elements.
Syntax
<object align="left|right|middle|top|bottom">
Attribute Values
Value Description
left Aligns the object to the left
If the width attribute is not set, a table takes up the space it needs to display
the table data.
Syntax
<table width="pixels|%">
Attribute Values
Value Description
pixels Sets the width in pixels (example: width="50")
Note: Do not confuse this with the cellspacing attribute, which specifies the
space between cells.
Syntax
<table cellpadding="pixels">
Attribute Values
Value Description
pixels The space between the cell wall and the cell content
Example
<table cellpadding="10">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Normally, a cell takes up the space it needs to display the content. The height
attribute is used to set a predefined height of a cell.
Syntax
<td height="pixels|%">
Attribute Values
Value Description
The most important attribute of the <a> element is the href attribute, which
indicates the link's destination.
Attributes
For <base> elements, the href attribute specifies the base URL for all relative
URLs on a page.
For <link> elements, the href attribute specifies the location (URL) of the
external resource (most often a style sheet file).
Applies to
The href attribute can be used on the following elements:
Elements Attribute
<a> href
<area> href
<base> href
<link> href
If you're new to HTML, <p> is likely to be the first element that you encounter. It defines
a paragraph of text. The end of the paragraph is marked by a closing </p> tag. ... By
default, most browsers place a line break and a blank line between paragraphs
<img> align Attribute
❮ HTML <img> tag
The <img> element is an inline element (it does not insert a new line on a
page), meaning that text and other elements can wrap around it. Therefore, it
can be useful to specify the alignment of the image according to surrounding
elements.
Syntax
<img align="left|right|middle|top|bottom">
Attribute Values
Value Description
The required alt attribute specifies an alternate textfor an image, if the image cannot
be displayed. Thealt attribute provides alternative information for animage 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).
Example
The required alt attribute specifies an alternate text for an image, if the image
cannot be displayed.
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).
<img> Tag
inline images in the html means that you add the images alongside the text in a line.
The images may be added in within a paragraph along with the text. Not allimages are
best viewed separately from the HTML document and are best displayed as part of the
document. Such images are called In-line Images.
<img src="smiley.gif" alt="Smiley face" height="42" width="42">
The <img> tag has two required attributes: src and alt.
Note: Images are not technically inserted into an HTML page, images are linked
to HTML pages. The <img> tag creates a holding space for the referenced
image.
To start with we'll use a Hex color code, probably the most common method of
adding color to links. In yourHTML anchor tag (<a>), after the href attribute, insert a
style attribute with the color property set to your Hexcolor code (in our case #FF0000).
<html>
<body link="blue">
<p><a href="https://www.w3schools.com">W3Schools.com</a></p>
<p><a href="https://www.w3schools.com/html/">HTML Tutorial</a></p>
</body>
</html>
The link attribute specifies the default color of unvisited links in a document.
Syntax
<body link="color_name|hex_number|rgb_number">
Attribute Values
Value Description
color_name Specifies the link color with a color name (like "red")
hex_number Specifies the link color with a hex code (like "#ff0000")
rgb_number Specifies the link color with an rgb code (like "rgb(255,0,0)")
Lists
An Unordered List:
Item
Item
Item
Item
An Ordered List:
1. First item
2. Second item
3. Third item
4. Fourth item
The list items will be marked with bullets (small black circles) by default:
Example
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Value Description
Example - Circle
<ul style="list-style-type:circle;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Example - Square
<ul style="list-style-type:square;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Example - None
<ul style="list-style-type:none;">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
Example
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Ordered HTML List - The Type Attribute
The type attribute of the <ol> tag, defines the type of the list item marker:
Type Description
type="I" The list items will be numbered with uppercase roman numbers
type="i" The list items will be numbered with lowercase roman numbers
Numbers:
<ol type="1">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Uppercase Letters:
<ol type="A">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
Lowercase Letters:
<ol type="a">
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
The <dl> tag defines the description list, the <dt> tag defines the term (name),
and the <dd> tag describes each term:
Example
<dl>
<dt>Coffee</dt>
<dd>- black hot drink</dd>
<dt>Milk</dt>
<dd>- white cold drink</dd>
</dl>
Example
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
Lists made with bullets are called bulleted lists. The HTML element name for
a bulleted list is "unordered list", because the list items are not arranged in numerical
order (as they would be in a numbered list). Usually bullet points are used tolist things.
Syntax
<table bgcolor="color_name|hex_number|rgb_number">
Attribute Values
Value Description
color_name Specifies the background color with a color name (like "red")
hex_number Specifies the background color with a hex code (like
"#ff0000")
Example
<table bgcolor="#00FF00">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<frame> Tag
The <frame> tag defines one particular window (frame) within a <frameset>.
Example
<frameset cols="25%,50%,25%">
<frame src="frame_a.htm">
<frame src="frame_b.htm">
<frame src="frame_c.htm">
</frameset>
Mailto function
<address> Tag
Definition and Usage
The <address> tag defines the contact information for the author/owner of a
document or an article.
The text in the <address> element usually renders in italic. Most browsers will
add a line break before and after the address element.
Example
<address>
Written by <a href="mailto:webmaster@example.com">Jon Doe</a>.<br>
Visit us at:<br>
Example.com<br>
Box 564, Disneyland<br>
USA
</address>