NotesforWebTechnologiesUnit I
NotesforWebTechnologiesUnit I
HTML (HyperText Markup Language) is the foundational markup language used to create and
structure content on the web. It defines the meaning and organization of web content, allowing
browsers to render text, images, links, and other elements into interactive web pages. (HTML:
HyperText Markup Language - MDN Web Docs)
📜 History of HTML
HTML was first developed in 1991 by Tim Berners-Lee to facilitate the sharing of documents over the
Internet. Since then, it has undergone several revisions to enhance its capabilities and adapt to the
evolving needs of the web. The latest version, HTML5, introduced new features such as semantic
elements, multimedia support, and improved APIs for web applications.
🎯 Objectives of HTML
Structuring Content: Organizing text, images, and other media into a coherent layout.
Defining Semantics: Providing meaning to content through tags, aiding in accessibility and
SEO.
Integrating with Other Technologies: Working in conjunction with CSS for styling and
JavaScript for dynamic behavior.
An HTML document follows a standardized structure comprising several key elements: (7 The global
structure of an HTML document - W3C)
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
<!DOCTYPE html>: Declares the document type and version of HTML.
<title>: Sets the title of the webpage, displayed on the browser tab.
<body>: Holds all the content visible to users, such as text, images, and interactive elements.
(Document structure bookmark_border - HTML - web.dev)
Header tags define headings, helping to structure content hierarchically: (HTML Course | Structure of
an HTML Document - GeeksforGeeks)
<h1>Main Title</h1>
<h2>Subheading</h2>
These tags improve readability and SEO by outlining the document's structure. (HTML Structure –
Engineering Technology Services)
The <body> tag encapsulates all the content displayed on the webpage, including text, images, links,
and other media. (Introduction to HTML - W3Schools)
The <p> tag defines a paragraph, grouping related sentences together. Browsers typically add spacing
before and after each paragraph to enhance readability. (HTML Course | Structure of an HTML
Document - GeeksforGeeks)
Understanding these fundamental elements is crucial for creating well-structured and accessible web
pages. As you delve deeper into HTML, you'll encounter more advanced tags and attributes that offer
greater control over webpage design and functionality.
Tags for FORM Creation, TABLE, FORM, TEXTAREA, SELECT, IMG, IFRAME
FIELDSET, ANCHOR
Here’s a concise guide to essential HTML tags used for creating forms, tables, and embedding various
elements:
1. <form>
Defines an HTML form for user input. It can contain various form elements like text fields,
checkboxes, radio buttons, submit buttons, etc. (HTML Forms - W3Schools)
Example:
</form>
2. <textarea>
Creates a multi-line text input control, often used for comments or feedback. (HTML textarea tag -
W3Schools)
Example:
3. <select>
Generates a drop-down list, allowing users to select one or more options. (HTML select tag -
W3Schools)
Example:
<select name="options">
</select>
Groups related elements within a form, providing a visual and semantic structure. The <legend> tag
defines a caption for the <fieldset>. (HTML fieldset Tag - GeeksforGeeks)
Example:
<fieldset>
<legend>Personal Information</legend>
</fieldset>
📊 Table Creation Tags
Example:
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table>
<img>
Embeds an image into the HTML page. The src attribute specifies the path to the image, and the alt
attribute provides alternative text. (HTML img tag - W3Schools)
Example:
<iframe>
Embeds another HTML page within the current page. Commonly used for embedding videos, maps,
or other external content. (HTML Iframes - W3Schools)
Example:
<a>
Defines a hyperlink, which is used to link from one page to another. The href attribute specifies the
URL of the page the link goes to. (HTML a Tag | GeeksforGeeks)
Example:
These tags are fundamental for structuring web pages and creating interactive forms. For more
detailed information and additional attributes, you can refer to resources like W3Schools and MDN
Web Docs.
📋 HTML Lists
HTML provides three primary types of lists to organize content: (Introduction to HTML -- Lists)
Purpose: Displays items without a specific order, typically with bullet points.
Syntax:
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
Syntax:
<ol>
<li>First Step</li>
<li>Second Step</li>
</ol>
Syntax:
<dl>
<dt>HTML</dt>
</dl>
For more details, refer to W3Schools on HTML Lists. (HTML Lists - W3Schools)
The <div> (short for "division") tag is a block-level container used to group HTML elements, allowing
for CSS styling and JavaScript manipulation.
Syntax:
<div>
</div>
Common Attributes:
Use Case: Structuring sections of a webpage, such as headers, footers, or content areas.
(HTML Lists - Tutorialspoint)
Example:
<div class="container">
<h2>Welcome</h2>
</div>
🧭 Navbar Design
A navbar (navigation bar) is a crucial UI component that allows users to navigate between different
sections or pages of a website. (How to create navigation bar using tag in HTML)
Creating a Simple Navbar with <div> and <a> Tags
HTML Structure:
<div class="navbar">
<a href="#home">Home</a>
<a href="#about">About</a>
<a href="#services">Services</a>
<a href="#contact">Contact</a>
</div>
CSS Styling:
.navbar {
background-color: #333;
overflow: hidden;
.navbar a {
float: left;
color: #f2f2f2;
text-decoration: none;
.navbar a:hover {
background-color: #ddd;
color: black;
This setup creates a horizontal navigation bar with links that change appearance on hover.
For a detailed tutorial, check out GeeksforGeeks on Creating a Navigation Bar. (How to create
navigation bar using tag in HTML)
By understanding and utilizing HTML lists, the <div> tag, and navigation bars, you can create well-
structured and user-friendly web pages.
Introduction to CSS, types, Selectors, and Responsiveness of a web page
CSS (Cascading Style Sheets) is a cornerstone technology in web development, enabling developers
to control the presentation and layout of HTML documents. By separating content from design, CSS
enhances the flexibility and maintainability of web pages.
🎨 What is CSS?
CSS is a stylesheet language used to describe the visual appearance of HTML elements. It allows
developers to apply styles such as colors, fonts, spacing, and positioning to web content, ensuring a
consistent and appealing user interface across different devices and browsers.
📚 Types of CSS
CSS can be implemented in three primary ways, each with its own use cases:
1. Inline CSS
Example:
Cons: Not scalable; can lead to cluttered HTML. (Difference between Inline, Internal and
External CSS - GeeksforGeeks, What is the difference between inline, internal, and external
CSS?, How to add CSS - W3Schools)
2. Internal CSS
Definition: Defined within a <style> tag in the <head> section of an HTML document.
Example:
<head>
<style>
p { color: green; }
</style>
</head>
Cons: Not reusable across multiple pages. (Difference between Inline, Internal and External
CSS - GeeksforGeeks, Types of CSS (Cascading Style Sheet) - GeeksforGeeks, What is the
difference between inline, internal, and external CSS?)
3. External CSS
Definition: Stored in a separate .css file and linked to the HTML document.
Example:
<head>
</head>
Cons: Requires an additional HTTP request to load the CSS file. (Difference between Inline,
Internal and External CSS - GeeksforGeeks, What is the difference between inline, internal,
and external CSS?)
For a detailed comparison, refer to GeeksforGeeks. (Difference between Inline, Internal and External
CSS - GeeksforGeeks)
🎯 CSS Selectors
Selectors are patterns used to target HTML elements for styling. Understanding different types of
selectors is crucial for effective CSS application. (CSS Selectors | GeeksforGeeks)
1. Basic Selectors
* { margin: 0; padding: 0; }
p { font-size: 16px; }
(Selectors | web.dev)
2. Combinator Selectors
h1 + p { margin-top: 0; }
General Sibling Selector (~): Targets all siblings following a specified element.
h1 ~ p { color: blue; }
3. Pseudo-class Selectors
4. Attribute Selectors
Exact Match:
Partial Match:
For an in-depth exploration, visit W3Schools CSS Selectors. (CSS Selectors - W3Schools)
Responsive Web Design (RWD) ensures that web pages render well on a variety of devices and
window or screen sizes. This adaptability enhances user experience across desktops, tablets, and
mobile devices.
Key Techniques:
1. Fluid Grids: Use relative units like percentages instead of fixed units like pixels.
3. Media Queries: Apply CSS rules based on device characteristics. (Using media queries - CSS:
Cascading Style Sheets - MDN Web Docs)
Example:
body {
Introduction to Bootstrap, downloads/linking, using classes of Bootstrap,
understanding the Grid System in Bootstrap
Bootstrap: Overview and Setup
Bootstrap is a free, open-source front-end framework for building responsive, mobile-first websites
(Bootstrap (front-end framework) - Wikipedia). It was originally developed by Twitter and is now one
of the most popular CSS frameworks. Bootstrap provides predefined CSS and JavaScript components
(like buttons, forms, navbars, etc.) that save time when designing web pages (Bootstrap 5 Get
Started). Using Bootstrap, you get a consistent look-and-feel across browsers, and built-in support
for layouts that automatically adjust to different screen sizes (responsive design) (Bootstrap (front-
end framework) - Wikipedia) (Bootstrap 5 Get Started). In practice, this means you can quickly
prototype pages with working UI elements without writing all the CSS from scratch.
What is Bootstrap? A toolkit of ready-made CSS classes and components that simplify web
design. Bootstrap’s latest version (Bootstrap 5) focuses on a mobile-first approach, meaning
layouts and components adapt easily to smartphones up to desktop sizes (What is Bootstrap)
(Bootstrap (front-end framework) - Wikipedia).
Why use Bootstrap? It speeds up development with pre-styled templates (for typography,
forms, buttons, tables, navigation, etc.) and ensures your site is responsive on all devices
(Bootstrap 5 Get Started). For example, Bootstrap’s grid system and utility classes handle
alignment and spacing so you don’t have to write complex CSS rules yourself.
To use Bootstrap in your project, you must include its CSS and JavaScript files. There are two
common methods: using a CDN (Content Delivery Network) or downloading files locally.
Via CDN: You can link directly to Bootstrap on a CDN. For example, add the following in your
HTML’s <head> for Bootstrap CSS, and before </body> for Bootstrap JS (which also requires a
meta viewport tag for proper responsive behavior):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap Setup</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
</head>
<body>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-..." crossorigin="anonymous"></script>
</body>
</html>
Using a CDN means users may already have Bootstrap cached, and it loads from a server close to
them, improving performance (Bootstrap 5 Get Started).
...
<script src="js/bootstrap.bundle.min.js"></script>
This approach lets you work offline or customize Bootstrap’s source code if needed. Whichever
method you choose, remember to include the <meta name="viewport" content="width=device-
width, initial-scale=1"> in the <head> to ensure proper responsive scaling (Get started with
Bootstrap · Bootstrap v5.2) (Bootstrap 5 Get Started).
Bootstrap’s power comes from its CSS classes. To style an element, add Bootstrap’s class names to
the HTML class attribute. Bootstrap defines classes for layout, components, utilities, and more. Here
are some beginner-friendly examples:
Buttons: Use the .btn class plus a style (e.g. .btn-primary, .btn-success, etc.). For example:
This produces styled buttons with Bootstrap’s colors. (You can also apply .btn classes to <a> or
<input> elements (Bootstrap 5 Buttons).)
Alerts: Bootstrap provides classes for alert boxes that convey messages. Wrap your text in a
<div> with classes like .alert and .alert-success (or -danger, -warning, etc.). For example:
</div>
This creates a green success alert. The class .alert-danger would make a red alert box. Alert boxes can
be dismissed if you add JavaScript, but basic usage just needs the classes (Bootstrap 5 Alerts).
Typography and Text Utilities: Bootstrap also styles headings and text. For example,
headings (<h1>–<h6>) get some default styling, and you can enhance text with classes
like .lead (to make a paragraph stand out) or alignment classes:
The .display-1 class makes an extra-large heading, .lead enlarges and grays paragraph text, and .text-
center centers the text (Bootstrap 5 Text/Typography). Bootstrap has many such utility classes for
colors, spacing, alignment, etc., enabling you to adjust styles without writing new CSS.
In general, Bootstrap classes are pre-built CSS rules. You apply them in your HTML to get the
corresponding style. For example, adding class="btn btn-primary" automatically gives the element
padding, border, background color, and hover effects defined by Bootstrap (Bootstrap 5 Buttons).
This class-based system means you can quickly assemble a well-designed page using simple class
names.
Bootstrap’s grid system lets you create responsive layouts using a container, rows, and columns
structure. The grid is based on a 12-column layout and CSS flexbox. Here’s how it works:
Container: Begin by wrapping your page (or section) in a container. Use <div
class="container"> for a fixed-width, centered layout, or <div class="container-fluid"> for full
width that spans the entire screen (Bootstrap 5 Get Started). For example:
<div class="container">
</div>
The .container adds automatic margins and padding to center the content, while .container-fluid
spans edge-to-edge (Bootstrap 5 Get Started).
Row: Inside the container, create rows using <div class="row">. Rows are horizontal groups
that manage column alignment. Every row can contain columns that should sum up to 12
(for a full-width row) (Bootstrap 5 Grid Basic).
Columns: Inside a row, create columns with classes like .col-*. For example:
<div class="row">
</div>
Here, we used .col-sm-4 three times. The first part (sm) is a breakpoint (small screens and above,
≥576px), and the second part (4) means “4 out of 12 columns wide” (Bootstrap 5 Grid Basic). So on
small (and larger) screens, each column takes up one-third of the row (4+4+4=12). On extra-small
screens (<576px), Bootstrap stacks these .col-sm-4 divs vertically (each row becomes full-width)
because the layout is mobile-first. This behavior is built-in.
More generally, you might see classes like .col-md-6 (half width on medium screens, ≥768px) or .col-
lg-3 (quarter width on large screens, ≥992px). The breakpoint abbreviations are:
o -sm for ≥576px, -md for ≥768px, -lg for ≥992px, -xl for ≥1200px, etc.
These correspond to screen width ranges (for example, 576px–768px, 768px–992px,
etc.) (Bootstrap (front-end framework) - Wikipedia) (Bootstrap 5 Grid Basic). By
choosing appropriate breakpoint classes, you control how many columns appear
side-by-side at different screen sizes.
<div class="container">
<div class="row">
</div>
</div>
In this example, on medium and larger screens each column is one-third width (col-md-4). On small
screens and smaller (col-sm-12), each column takes full width (stacked).
Using Bootstrap’s grid ensures your page automatically adjusts to different devices. You don’t need
media queries yourself; simply picking the right grid classes will reorganize columns for you
(Bootstrap 5 Grid Basic) (Bootstrap 5 Get Started). This is crucial for responsive design, so your site
looks good on phones, tablets, and desktops without extra work.
The grid system is a core reason Bootstrap is so useful in web design. It provides a flexible, simple
way to build complex, responsive layouts. Instead of writing custom CSS for floats or flexbox
breakpoints, you just use rows and columns with intuitive class names. Bootstrap then handles the
underlying CSS to reflow the columns. This lets you focus on content structure instead of low-level
CSS details (Bootstrap 5 Grid Basic).
Summary: In Bootstrap, always wrap your content in a .container (or .container-fluid) (Bootstrap 5
Get Started). Inside it, use <div class="row"> to create a horizontal group, and <div class="col-...">
classes to divide that row into columns. Use the col-{breakpoint}-{number} format to control how
many columns each element spans at different screen widths (Bootstrap 5 Grid Basic).
By understanding and using containers, rows, and columns, you can design responsive layouts
quickly. The Bootstrap grid system, combined with its utility and component classes, makes
responsive web development much easier for students and professionals alike (Bootstrap 5 Get
Started) (Bootstrap 5 Grid Basic).
Sources: Information summarized from the official Bootstrap documentation and tutorials (What is
Bootstrap) (Bootstrap (front-end framework) - Wikipedia) (Bootstrap 5 Get Started) (Bootstrap 5 Get
Started) (Bootstrap 5 Grid Basic). Each code example is adapted from standard Bootstrap usage.
Web pages are written in HTML and are accessed through web browsers.
Works on a client-server model: your browser (client) sends a request to a web server, which
sends back the web page.
Uploading/downloading files
FTP File Transfer Protocol
to/from servers.
🧰 Programs (Software):
🧩 Web Applications:
E-commerce (Amazon)
Online banking
🛠 Development Tools:
🌍 4. Web Browsers
Examples:
Mozilla Firefox
Microsoft Edge
Safari (Apple)
Opera
Features:
Tabbed browsing
Bookmarking
Extensions/add-ons
🧭 5. DNS (Domain Name System)
They ensure:
o Server uptime
o Domain registration
o Technical support
o SSL certificates
GoDaddy
Hostinger
Bluehost
SiteGround
On Windows:
Use XAMPP/WAMP for local web server setup (includes Apache, PHP, MySQL).
On Linux/Unix:
Cloud hosting uses a network of virtual servers (cloud) rather than a single server.
AWS
Google Cloud
Microsoft Azure
DigitalOcean
Dedicated Hosting Entire server for one website High-traffic or large sites
✅ Conclusion
Understanding the WWW and how web content is developed, hosted, and accessed is essential for
web developers. This foundational knowledge helps students move toward creating their own
websites using web technologies and hosting platforms.