Professional Documents
Culture Documents
Introduction
The HyperText Markup Language or HTML is the standard markup language for
documents designed to be displayed in a web browser. It can be assisted by
technologies such as Cascading Style Sheets (CSS) and scripting languages such as
JavaScript.
Hypertext means that the document contains links that allow the reader to jump to
other places in the document or to another document altogether. The latest version
is known as HTML5.
A Markup Language is a way that computers speak to each other to control how text
is processed and presented. To do this HTML uses two things: tags and attributes.
They work together but perform different functions – it is worth investing 2 minutes in
differentiating the two.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>Headings</h1>
<p>Hello world</p>
</body>
</html>
Example explained
● <!DOCTYPE html> declaration defines that this document is an HTML5
document
● <html> element is root element of an HTML page
● <head> element contains meta information about the HTML page
● <title> element specifies a title for the HTML page (which is shown in the
browser’s title bar or in the page’s tab)
● <body> element defines the document's body, and is a container for all the
visible contents, such as headings, paragraphs, images, hyperlinks, tables,
lists, etc.
● <h1> element defines a large heading
● <p> element defines a paragraph
What are HTML Attributes?
Attributes contain additional pieces of information. Attributes take the form of an
opening tag and additional info is placed inside.
In this instance, the image source (src) and the alt text (alt) are attributes of the
<img> tag.
Other attributes :
● Width
● Height
● Style
● Href
● Id
● Class
● Alt
● Src
● Lang
● Title
● Etc
Head
<head> element is a container for metadata and it is placed after html tag and
before body tag.
Metadata typically defines the document title, character set, script, style, and other
metadata information.
<title> defines the title of the website
<link> defines the relationship between the current document and an external
resource
<meta> is typically used to specify the character set, page description, keywords,
author of the document, and viewport settings.
<meta name=”keywords” content=”html, css, js”> define keyword for search engine
Body
The <body> element contains all the contents of an HTML document, such as
headings, paragraphs, images, hyperlinks, tables, lists, etc.
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
Headings
HTML headings are titles or subtitles that you want to display on a webpage.
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
You can also customize the heading with style attributes. We will talk about styling
some elements later
Paragraph
A paragraph always starts on a new line, and browsers automatically add some
white space (a margin) before and after a paragraph.
<p>This is paragraph</p>
<p>This is another paragraph</p>
Horizontal rules
<p>This is paragraph</p>
<hr>
<p>This is another paragraph</p>
Line breaks
Poem
Images
<table>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
<tr>
<td>Dtech</td>
<td>Dalton</td>
<td>Donzo</td>
<tr>
<td>Dybersec</td>
<td>Daps</td>
<td>Del Monte</td>
List
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
● Coffee
● Tea
● Milk
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
1. Coffee
2. Tea
3. Milk
Form
Used for collect user input
<form>
.
form elements
.
</form>
The <form> element is a container for different types of input elements, such as: text
fields, checkboxes, radio buttons, submit buttons, etc.
Input Element
The HTML <input> element is the most used form element
An <input> element can be displayed in many ways, depending on the type attribute.
<form>
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="fname" value="John"><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lname" value="Doe">
</form>
Common Tags
<section>
<div> defines a division or section in html an HTML document, <div> tag is used as a container
for html elements, it can be styled with classes / css or manipulated with id / javascript.
Created by : Daffa Faiz Athallah
Date : 26 / 9 / 22