0% found this document useful (0 votes)
60 views3 pages

HTML 5

The document defines several basic HTML elements and their purposes. It explains that all HTML documents require a <!DOCTYPE html> declaration and consist of content between <html> and </html> tags, with the visible content between <body> and </body> tags. It also summarizes common text-level semantics like headings, paragraphs, links, images and their defining tags, as well as empty elements and start/end tags. The document concludes by listing several common attributes and their descriptions.

Uploaded by

Dutu Alin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views3 pages

HTML 5

The document defines several basic HTML elements and their purposes. It explains that all HTML documents require a <!DOCTYPE html> declaration and consist of content between <html> and </html> tags, with the visible content between <body> and </body> tags. It also summarizes common text-level semantics like headings, paragraphs, links, images and their defining tags, as well as empty elements and start/end tags. The document concludes by listing several common attributes and their descriptions.

Uploaded by

Dutu Alin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

HTML Basic

HTML Documents

All HTML documents must start with a document type declaration: <!DOCTYPE html>.
The HTML document itself begins with <html> and ends with </html>.
The visible part of the HTML document is between <body> and </body>.

HTML Headings

HTML headings are defined with the <h1> to <h6> tags.


<h1> defines the most important heading. <h6> defines the least important heading.

HTML Paragraphs
HTML paragraphs are defined with the <p> tag:

HTML Links

HTML links are defined with the <a> tag:


<a href="http://www.w3schools.com">This is a link</a>
The link's destination is specified in the href attribute.

Attributes are used to provide additional information about HTML elements.

HTML Images
HTML images are defined with the <img> tag.

The source file (src), alternative text (alt), width, and height are provided as
attributes:

<img src="w3schools.jpg" alt="W3Schools.com" width="104" height="142"


>

1
HTML Elements

An HTML element usually consists of a start tag and end tag, with the content inserted in
between:

<tagname>Content goes here...</tagname>


The HTML element is everything from the start tag to the end tag:

<p>My first paragraph.</p>

Start tag Element content End tag


<h1> My First Heading </h1>
<p> My first paragraph. </p>
<br>

HTML elements with no content are called empty elements. Empty elements do not have
an end tag, such as the <br> element (which indicates a line break).

HTML Attributes

The lang Attribute

The language of the document can be declared in the <html> tag.


The language is declared with the lang attribute.
Declaring a language is important for accessibility applications (screen readers) and search
engines.
<html lang="en-US">

Below is an alphabetical list of some attributes often used in HTML:

2
The title Attribute
Here, a title attribute is added to the <p> element. The value of the title attribute will be
displayed as a tooltip when you mouse over the paragraph:
<p title="I'm a tooltip">

Attribute Description

alt Specifies an alternative text for an image, when the image cannot be
displayed
disabled Specifies that an input element should be disabled

href Specifies the URL (web address) for a link

id Specifies a unique id for an element

src Specifies the URL (web address) for an image

style Specifies an inline CSS style for an element

title Specifies extra information about an element (displayed as a tool tip)

HTML Headings
Tag Description
<html> Defines the root of an HTML document
<body> Defines the document's body
<head> A container for all the head elements (title, scripts, styles, meta
information, and more)
<h1> to Defines HTML headings
<h6>
<hr> Defines a thematic change in the content

You might also like