Unit 1
Unit 1
o Clients are the typical web user's internet-connected devices (for example, your computer
connected to your Wi-Fi, or your phone connected to your mobile network) and web-
accessing software available on those devices (usually a web browser like Firefox or Chrome).
o Servers are computers that store webpages, sites, or apps. When a client wants to access a
webpage, a copy of the webpage code is downloaded from the server onto the client
machine to render by the browser and displayed to the user.
Communication Protocol:
Hypertext Transfer Protocol (HTTP) is an application protocol that defines a language for
clients and servers to speak to each other. HTTP is a protocol for fetching resources such as
HTML documents. It is the foundation of any data exchange on the Web and it is a client-server
protocol, which means requests are initiated by the recipient, usually the Web browser. A
complete document is typically constructed from resources such as text content, layout
instructions, images, videos, scripts, and more.
Full Stack Development
Clients and servers communicate by exchanging individual messages (as opposed to a stream of
data). The messages sent by the client are called requests and the messages sent by the server as
an answer are called responses.
When a client wants to communicate with a server, either the final server or an intermediate
proxy, it performs the following steps:
1. Open a TCP connection: The TCP connection is used to send a request, or several, and receive an
answer. The client may open a new connection, reuse an existing connection, or open several
TCP connections to the servers.
2. Send an HTTP message: HTTP messages (before HTTP/2) are human-readable. With HTTP/2,
these simple messages are encapsulated in frames, making them impossible to read directly, but
the principle remains the same. For example:
Full Stack Development
An HTML document consists of specific tags that form the skeleton of the page. Here’s a look at
a basic HTML document structure
1. <!DOCTYPE HTML>: The <!DOCTYPE html> declaration is placed at the beginning of the
document. It tells the browser that the document follows HTML5 standards, ensuring
consistent rendering across browsers.
2. <html> Tag: The <html> tag wraps the entire document, serving as the root element of an
HTML page. It typically includes the lang attribute to specify the language of the content.
3. <head> Section: The <head> section contains metadata, scripts, styles, and other information
not displayed directly on the page but essential for functionality and SEO.
4. <body> Section: The <body> section contains all the visible content of the web page,
including text, images, videos, links, and more. This is where you’ll add the main elements to
display on the page.
1. Main root
Element Description
2. Document metadata
Metadata contains information about the page. This includes information about styles, scripts and
data to help software use and render the page. Metadata for styles and scripts may be defined in
the page or linked to another file that has the information.
Element Description
Defines the document's title that is shown in a browser's title bar or a page's tab. It
<title> only contains text; HTML tags within the element, if any, are also treated as plain
text.
3. Sectioning root
Element Description
Represents the content of an HTML document. There can be only one such
<body> element in a document.
4. Content sectioning
Content sectioning elements allow you to organize the document content into logical pieces. Use
the sectioning elements to create a broad outline for your page content, including header and
footer navigation, and heading elements to identify sections of content.
Element Description
Indicates that the enclosed HTML provides contact information for a person or
<address> people, or for an organization.
<h1>, <h2>, < Represent six levels of section headings. <h1> is the highest section level
h3>, <h4>, <h and <h6> is the lowest.
Full Stack Development
Element Description
5>, <h6>
Represents a heading grouped with any secondary content, such as subheadings,
<hgroup> an alternative title, or a tagline.
Represents the dominant content of the body of a document. The main content
<main> area consists of content that is directly related to or expands upon the central topic
of a document, or the central functionality of an application.
Represents a part that contains a set of form controls or other content related to
<search> performing a search or filtering operation.
5. Text content
Use HTML text content elements to organize blocks or sections of content placed between the
opening <body> and closing </body> tags. Important for accessibility and SEO, these elements
identify the purpose or structure of that content.
Element Description
Indicates that the enclosed text is an extended quotation. Usually, this is rendered
visually by indentation. A URL for the source of the quotation may be given using
<blockquote> the cite attribute, while a text representation of the source can be given using
the <cite> element.
Provides the description, definition, or value for the preceding term (<dt>) in a
<dd> description list (<dl>).
The generic container for flow content. It has no effect on the content or layout until
<div> styled in some way using CSS (e.g., styling is directly applied to it, or some kind of
layout model like flexbox is applied to its parent element).
Specifies a term in a description or definition list, and as such must be used inside
<dt>
a <dl> element. It is usually followed by a <dd> element; however,
Full Stack Development
Element Description
multiple <dt> elements in a row indicate several terms that are all defined by the
immediate next <dd> element.
A semantic alternative to <ul>, but treated by browsers (and exposed through the
<menu> accessibility tree) as no different than <ul>. It represents an unordered list of items
(which are represented by <li> elements).
Use the HTML inline text semantic to define the meaning, structure, or style of a word, line, or
any arbitrary piece of text.
Element Description
Together with its href attribute, creates a hyperlink to web pages, files, email
<a> addresses, locations within the current page, or anything else a URL can address.
Used to mark up the title of a cited creative work. The reference may be in an
<cite> abbreviated form according to context-appropriate conventions related to citation
metadata.
Displays its contents styled in a fashion intended to indicate that the text is a short
<code> fragment of computer code. By default, the content text is displayed using the user
agent's default monospace font.
Used to indicate the term being defined within the context of a definition phrase or
<dfn> sentence. The ancestor <p> element, the <dt>/<dd> pairing, or the nearest section
ancestor of the <dfn> element, is considered to be the definition of the term.
Marks text that has stress emphasis. The <em> element can be nested, with each
<em> nesting level indicating a greater degree of emphasis.
Represents a range of text that is set off from the normal text for some reason, such
as idiomatic text, technical terms, and taxonomical designations, among others.
<i> Historically, these have been presented using italicized type, which is the original
source of the <i> naming of this element.
Indicates that the enclosed text is a short inline quotation. Most modern browsers
implement this by surrounding the text in quotation marks. This element is
<q> intended for short quotations that don't require paragraph breaks; for long
quotations use the <blockquote> element.
Used to provide fall-back parentheses for browsers that do not support the display
of ruby annotations using the <ruby> element. One <rp> element should enclose
<rp> each of the opening and closing parentheses that wrap the <rt> element that
contains the annotation's text.
Specifies the ruby text component of a ruby annotation, which is used to provide
<rt> pronunciation, translation, or transliteration information for East Asian typography.
The <rt> element must always be contained within a <ruby> element.
Represents small annotations that are rendered above, below, or next to base text,
<ruby>
usually used for showing the pronunciation of East Asian characters. It can also be
Full Stack Development
Element Description
used for annotating other kinds of text, but this usage is less common.
Renders text with a strikethrough, or a line through it. Use the <s> element to
represent things that are no longer relevant or no longer accurate. However, <s> is
<s> not appropriate when indicating document edits; for that, use
the <del> and <ins> elements, as appropriate.
Used to enclose inline text which represents sample (or quoted) output from a
<samp> computer program. Its contents are typically rendered using the browser's default
monospaced font (such as Courier or Lucida Console).
Represents side-comments and small print, like copyright and legal text,
<small> independent of its styled presentation. By default, it renders text within it one font
size smaller, such as from small to x-small.
A generic inline container for phrasing content, which does not inherently represent
anything. It can be used to group elements for styling purposes (using
the class or id attributes), or because they share attribute values, such as lang. It
<span> should be used only when no other semantic element is appropriate. <span> is very
much like a div element, but div is a block-level element whereas a <span> is
an inline-level element.
Represents a span of inline text which should be rendered in a way that indicates
<u> that it has a non-textual annotation. This is rendered by default as a single solid
underline but may be altered using CSS.
<wbr> Represents a word break opportunity—a position within text where the browser
Full Stack Development
Element Description
may optionally break a line, though its line-breaking rules would not otherwise
create a break at that location.
Defines an area inside an image map that has predefined clickable areas.
<area> An image map allows geometric areas on an image to be associated
with hyperlink.
Used to embed sound content in documents. It may contain one or more audio
sources, represented using the src attribute or the source element: the browser will
<audio> choose the most suitable one. It can also be the destination for streamed media,
using a MediaStream.
<map> Used with <area> elements to define an image map (a clickable link area).
Used as a child of the media elements, audio and video. It lets you specify timed
<track> text tracks (or time-based data), for example to automatically handle subtitles. The
tracks are formatted in WebVTT format (.vtt files)—Web Video Text Tracks.
Embeds a media player which supports video playback into the document. You
<video> can also use <video> for audio content, but the audio element may provide a more
appropriate user experience.
8. Embedded content
In addition to regular multimedia content, HTML can include a variety of other content, even if
it's not always easy to interact with.
Element Description
Embeds external content at the specified point in the document. This content is
<embed> provided by an external application or other source of interactive content such as
a browser plug-in.
Represents a nested browsing context, like <iframe> but with more native privacy
<fencedframe> features built in.
Represents a nested browsing context, embedding another HTML page into the
<iframe> current one.
Contains zero or more <source> elements and one <img> element to offer
<picture> alternative versions of an image for different display/device scenarios.
Specifies multiple media resources for the picture, the audio element, or the video
element. It is a void element, meaning that it has no content and does not have a
<source> closing tag. It is commonly used to offer the same media content in multiple file
formats in order to provide compatibility with a broad range of browsers given
their differing support for image file formats and media file formats.
The top-level element in MathML. Every valid MathML instance must be wrapped
<math> in it. In addition, you must not nest a second <math> element in another, but you
can have an arbitrary number of other child elements in it.
10. Scripting
To create dynamic content and Web applications, HTML supports the use of scripting languages,
most prominently JavaScript. Certain elements support this capability.
Element Description
Container element to use with either the canvas scripting API or the WebGL
<canvas> API to draw graphics and animations.
Used to embed executable code or data; this is typically used to embed or refer to
<script> JavaScript code. The <script> element can also be used with other languages,
such as WebGL's GLSL shader programming language and JSON.
Defines one or more columns in a column group represented by its implicit or explicit
<col> parent <colgroup> element. The <col> element is only valid as a child of
a <colgroup> element that has no span attribute defined.
Encapsulates a set of table rows (<tr> elements), indicating that they comprise the body o
<tbody> table's (main) data.
<td> A child of the <tr> element, it defines a cell of a table that contains data.
Encapsulates a set of table rows (<tr> elements), indicating that they comprise the foot of
<tfoot> table with information about the table's columns. This is usually a summary of the column
e.g., a sum of the given numbers in a column.
A child of the <tr> element, it defines a cell as the header of a group of table cells. The
<th> nature of this group can be explicitly defined by the scope and headers attributes.
Encapsulates a set of table rows (<tr> elements), indicating that they comprise the head o
<thead> table with information about the table's columns. This is usually in the form of column
headers (<th> elements).
Defines a row of cells in a table. The row's cells can then be established using a mix
<tr> of <td> (data cell) and <th> (header cell) elements.
12. Forms
HTML provides several elements that can be used together to create forms that the user can fill
out and submit to the website or application. Further information about this available in
the HTML forms guide.
Element Description
An interactive element activated by a user with a mouse, keyboard, finger, voice
<button> command, or other assistive technology. Once activated, it performs an action, such as
submitting a form or opening a dialog.
<fieldset> Used to group several controls as well as labels (<label>) within a web form.
<meter> Represents either a scalar value within a known range or a fractional value.
Container element into which a site or app can inject the results of a calculation or the
<output> outcome of a user action.
Represents a multi-line plain-text editing control, useful when you want to allow users
<textarea> to enter a sizeable amount of free-form text, for example, a comment on a review or
feedback form.