HTML
HTML
HTML
WEB DEVELOPMENT
• An HTTP response is what web clients (often browsers) receive from a web
server in answer to an HTTP request. A typical HTTP response contains:
i. HTTP response code.
ii. HTTP response header.
iii. Optional HTTP body.
HTTP vs HTTPS
• The full form of HTTPS is Hypertext Transfer Protocol Secure. This protocol
allows transferring the data in an encrypted form.
• The HTTP protocol does not provide the security of the data and data is
transferred in plain form, while HTTPS ensures the security of the data.
Therefore, we can say that HTTPS is a secure version of the HTTP protocol.
• The use of HTTPS protocol is mainly for transferring sensitive information
such as user login, password and financial data.
WEB BROWSERS
• HTML stands for Hyper Text Markup Language, which is the most widely used
language on the Web to develop web pages. It defines the meaning and structure
of web content.
• HTML is not at all a programming language, rather a markup language. A markup
language is an encoding system to format different elements on the page for
display and printing. It is interpreted by different internet browsers and controls
how a document is displayed. Markup languages contain two main data types: the
text that will be displayed and then the markup to describe how to display it.
• There are more than a hundred other markup languages, but HTML is the most
common one. More than 94% of all web pages are written in HTML.
• An HTML document is essentially a text document having .html or .htm extension.
HISTORY OF HTML
• HTML was created by Berners-Lee in late 1991.
• HTML v2.0 was the first standard HTML specification which was
published in 1995.
• HTML v4.01 was a major version of HTML and it was published in late
1999.
• We are currently using HTML5, which is an extension to HTML 4.01
and was published in 2012.
• HTML versions are maintained by W3 Consortium.
• Originally, HTML was developed with the intent of defining the
structure of documents but currently, HTML5 has evolved into such a
complex technology that supports images, multimedia and a wide
variety of graphical applications.
STRUCTURE OF AN HTML PAGE
[Note: id and class attributes are used to select the element using CSS or
JavaScript.]
HTML TAG & ATTRIBUTE
HTML HEAD
• The <head> element is the container for all the head elements,
which provide extra information about the document (metadata), or
reference to other resources that are required for the document to
display or behave correctly in a web browser.
• The head elements collectively describe the properties of the
document such as:
o Describe the document title.
o Provide meta information like character set.
o Instruct the browser where to find the style sheets or scripts.
• The HTML elements that can be used inside
the <head> are: <title>,<link>, <style>, <meta> and <script> etc.
HTML BODY & META
Body
• The <body> element contains all the contents of an HTML document,
such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
• The <body> tag is the last child of <html> tag.
• There can be only one <body> tag in any HTML document.
Meta
• Usually, within the head tag, additional important information about a
document is described in a variety of ways enclosed by the <meta> tag.
• The <meta> tag is commonly used to provide additional information such
as keywords, descriptions, author information, and other metadata that
may be used by the browser to render the document correctly.
• It may be used by search engines for indexing purposes.
HTML HEADINGS
• src - Specifies the path to the image, it is a required attribute that must be
provided to display the referenced image correctly.
• alt - Specifies an alternate text for the image, if the image for some reason
cannot be displayed. This is also a required attribute for accessibility.
• width - Specifies the image width in pixels, it is an optional attribute.
• height - Another optional attribute that specifies the image height in pixels.
HTML LISTS
Line Breaks
• <br> tag is used to insert a line break (a new line) on
the web page.
• It is an empty tag, which means the closing tag </br>
is not required.
• It is useful to present text with the desired line format.
Horizontal Rules
• <hr> tag in HTML stands for horizontal rule and is used
to insert a horizontal rule or a thematic break in an
HTML page to divide or separate document sections
visually.
• It is an empty tag, so an end tag is not required.
HTML TABLES
• The <table> tag is used to define a table in HTML.
• A table in HTML consists of table cells organized into rows and
columns. By default, table elements do not have any borders.
o Rows. Each table row starts with a <tr> tag which means table row.
o Columns. Each table column starts with a <td> tag which means table
data. Columns or table data elements are the data containers of table
elements. They can contain any kind of HTML elements.
o Table Headers. Headers are essential in tables to provide data
descriptions. Table headers are displayed using <th> tags.
• In addition, there are number of attributes to modify various properties
of table element.
• By default table element is rendered without any borders.
HTML TABLES
HTML INPUTS
• The HTML <input> tag is used to declare an input element .
• It is an element that allows the user to input data.
• A wide variety of inputs are available which is defined by a “type” attribute.
• Inputs are mostly used as building blocks for any HTML form.
• It is always a good practice to provide a description for any input field with
the <label> tag.
<input type=”desired_input_type”>
[Task: Study and practice the use of type attribute for HTML inputs.
Read about other attributes for input elements as well]
HTML INPUT TYPES
Inline styles
Using the style attribute within the HTML start tag.
ADDING CSS TO HTML
Embedded style
Using the <style> element within the head section of a
document.
ADDING CSS TO HTML