Learn the fundamentals of HTML and start building your first web pages
HTML is the standard markup language for Web pages. This tutorial follows the latest HTML5 standard. HTML is easy to learn - You will enjoy it!
<br> element). These elements are called empty elements. Empty elements do not have an end tag!HTML elements are the building blocks of HTML pages. An HTML element is defined by a start tag, some content, and an end tag. The content is everything between the start and end tags.
<tagname>Content goes here...</tagname>
All HTML elements can have attributes that provide additional information about elements. Attributes are always specified in the start tag and usually come in name/value pairs.
The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to:
The style attribute is used to add styles to an element, such as color, font, size, and more.
HTML headings are defined with h1 to h6 tags. Paragraphs are defined with the p tag.
HTML headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important heading.
The HTML <p> element defines a paragraph.
A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph.
The HTML style attribute is used to add styles to an element, such as color, font, size, and more.
HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand. Note: A link does not have to be text. A link can be an image or any other HTML element!
By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.
The target attribute specifies where to open the linked document.
_self - Default. Opens the document in the same window/tab as it was clicked_blank - Opens the document in a new window or tab_parent - Opens the document in the parent frame_top - Opens the document in the full body of the windowImages can improve the design and the appearance of a web page.
The HTML <img> tag is used to embed an image in a web 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.
The <img> tag is empty, it contains attributes only, and does not have a closing tag.
src - Specifies the path to the imagealt - Specifies an alternate text for the imageAn HTML iframe is used to display a web page within a web page.
<iframe> tag specifies an inline framesrc attribute defines the URL of the page to embedtitle attribute (for screen readers)height and width attributes specify the size of the iframeborder:none; to remove the border around the iframeHTML lists allow web developers to group a set of related items in lists.
An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
The list items will be marked with bullets (small black circles) by default.
An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
The list items will be marked with numbers by default.
HTML also supports description lists.
A description list is a list of terms, with a description of each term.
The <dl> tag defines the description list, the <dt> tag defines the term (name), and the <dd> tag describes each term.
HTML tables allow web developers to arrange data into rows and columns.
<table> tag defines an HTML table<tr> tag. Each table header is defined with a <th> tag. Each table data/cell is defined with a <td> tag<th> elements are bold and centered<td> elements are regular and left-aligned
Every HTML element has a default display value, depending on what type of element it is.
There are two display values: block and inline.
A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can).
The <div> element is a block-level element.
The <div> element is often used as a container for other HTML elements.
An inline element does not start on a new line and it only takes up as much width as necessary.
This is a <span> element inside a paragraph.
The <span> element is an inline container used to mark up a part of a text, or a part of a document.