Web Design Notes
Web Design Notes
Unit-I
The Internet is a global network of interconnected computers that communicate using standard
protocols such as TCP/IP (Transmission Control Protocol / Internet Protocol).
It allows users to share information, exchange messages, and access services like email,
websites, and online applications.
Key features:
Communication on the Internet happens through various services and tools that allow people to
share information instantly.
All these rely on Internet protocols like SMTP (for emails), HTTP (for web browsing), and
VoIP (for voice/video calls).
3. Internet Domains
Example:
IP address: [Link]
Domain name: [Link]
Domain structure:
Top-Level Domain (TLD): The last part of a domain name (e.g., .com, .org, .edu, .in).
Second-Level Domain: The main name (e.g., google in [Link]).
Subdomain: A part of a larger domain (e.g., [Link]).
Domain Name System (DNS): Converts domain names into IP addresses so that computers can
locate each other on the Internet.
Servers on the Internet have unique identities to provide and manage services.
To connect to the Internet, a user must establish a connection between their device and the global
network.
Steps and components involved:
Once connectivity is established, data can be sent and received globally using Internet protocols.
---------------------------------------------------------------------------------------------------------------------
Unit II
Introduction to HTML: Anchor Tag – Hyperlink - Head and Body Section – Heading -
Horizontal Ruler – Paragraphs – Tags - Images and Picture – Lists – Tables – Frames - Forms
and forms elements.
Introduction to HTML
HTML (HyperText Markup Language) is the standard language used to create and design
web pages.
It uses tags to structure content like text, images, links, tables, and forms on a webpage.
Every HTML document begins with <html> and ends with </html>.
Basic structure:
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>Welcome</h1>
<p>This is my first webpage.</p>
</body>
</html>
The anchor tag <a> is used to create hyperlinks — clickable text or images that connect one
webpage to another.
Syntax:
Attributes:
Example:
Contains metadata (information about the page) and links to external files like CSS or
JavaScript.
Example:
<head>
<title>My Website</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="[Link]">
</head>
Body Section (<body>)
Contains the visible content of the webpage (text, images, tables, etc.).
Example:
<body>
<h1>Welcome!</h1>
<p>This is the content area.</p>
</body>
3. Heading Tags
HTML provides six levels of headings from <h1> (largest) to <h6> (smallest).
Example:
<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Section Heading</h3>
Use:
Headings help organize content and improve SEO (search engine optimization).
Example:
<p>Introduction</p>
<hr>
<p>Details</p>
Attributes:
Example:
5. Paragraphs (<p>)
Used to define paragraphs of text. Browsers automatically add space before and after
paragraphs.
Example:
Attributes:
Example:
6. Tags
Types of tags:
Container tags: Have both opening and closing (e.g., <p>...</p>, <body>...</body>).
Empty tags: Have no closing tag (e.g., <br>, <hr>, <img>).
7. Images and Picture (<img>)
Syntax:
Attributes:
8. Lists
9. Tables
Basic structure:
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>25</td>
</tr>
</table>
Tags:
10. Frames
Frames are used to divide a webpage into multiple sections where each section can load a
different HTML document.
(⚠️Note: Frames are obsolete in modern HTML, replaced by CSS and <iframe>.)
Forms are used to collect user input (like login details, feedback, etc.).
Basic structure:
Tag Description
---------------------------------------------------------------------------------------------------------------------
Unit III
DHTML and Style sheets: Defining styles - Elements of style - Linking a style sheet to a html
documents - Inline style - External style sheets - Multiple styles- Web page designing.
1. Introduction to DHTML
Purpose:
To make web pages dynamic, responsive, and interactive without reloading the page.
Example features:
2. Defining Styles
Style defines how HTML elements appear on a web page — including color, font, size, spacing,
and layout.
Styles are written using CSS (Cascading Style Sheets).
Syntax:
selector {
property: value;
}
Example:
p{
color: blue;
font-size: 16px;
}
Here,
3. Elements of Style
The elements of style refer to the different CSS properties that control the appearance of
HTML elements.
You can link an external CSS file to your HTML document using the <link> tag inside the
<head> section.
Example:
<head>
<link rel="stylesheet" type="text/css" href="[Link]">
</head>
Explanation:
rel="stylesheet" → Specifies the relationship between the HTML and CSS file.
href="[Link]" → Specifies the path of the external CSS file.
This method allows one CSS file to control the design of multiple web pages.
5. Inline Style
Inline CSS is used to apply a style directly to a single HTML element using the style attribute.
Example:
An external style sheet is a separate .css file that contains all the styles for your website.
Example:
File: [Link]
body {
background-color: lightblue;
}
h1 {
color: darkblue;
text-align: center;
}
Link it to HTML:
Advantages:
A single webpage can use multiple style sheets — internal, external, or inline.
Example:
<head>
<link rel="stylesheet" href="[Link]">
<style>
p { color: red; }
</style>
</head>
<body>
<p style="color: blue;">This text will be blue (inline style wins).</p>
</body>
Using DHTML and CSS, we can design attractive and interactive web pages.
Example:
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
<link rel="stylesheet" href="[Link]">
</head>
<body>
<h1>Welcome to My Page</h1>
<p>This is an example of web page designing using DHTML and CSS.</p>
</body>
</html>
✅ Summary
Concept Description
DHTML Combines HTML, CSS, and JavaScript for dynamic web pages
Web Page Designing Uses HTML for structure, CSS for design, and JS for interactivity
--------------------------------------------------------------------------------------------------------------------
Unit IV
Introduction to Java script: Advantage of JavaScript - Data type - Variable – Array - Operator
and Expression - Control and looping Constructs - Functions - Dialog Boxes.
Introduction to JavaScript
1. What is JavaScript?
JavaScript is a client-side scripting language used to make web pages interactive and
dynamic.
It runs directly in the web browser and can change content, validate forms, handle events, and
more — without reloading the page.
Example:
<script>
[Link]("Welcome to JavaScript!");
</script>
Form validation
Creating animations
Interactive buttons and menus
Dynamic web page content
Web and app development (with frameworks like React, [Link])
2. Advantages of JavaScript
Advantage Description
3. Data Types
4. Variable
A variable is used to store data that can be used and changed later in the program.
Syntax:
Keywords:
Example:
5. Array
Syntax:
let fruits = ["Apple", "Banana", "Mango"];
Array methods:
Example:
Types of Operators:
Logical `&&
String + Concatenation
Example:
let a = 10, b = 5;
let c = a + b;
[Link](c); // Output: 15
7. Control and Looping Constructs
Conditional Statements
(a) if statement
(b) if...else
let i = 1;
while (i <= 5) {
[Link](i + "<br>");
i++;
}
let i = 1;
do {
[Link](i + "<br>");
i++;
} while (i <= 5);
8. Functions
Syntax:
function functionName(parameters) {
// code to execute
}
Example:
function add(a, b) {
return a + b;
}
9. Dialog Boxes
confirm() confirm("Are you sure?"); Displays OK/Cancel dialog. Returns true or false.
prompt() prompt("Enter your name:"); Asks user for input and returns the value.
Example:
✅ Summary Table
Concept Description
---------------------------------------------------------------------------------------------------------------------
Unit V:
JavaScript Document Object Model: Event Handling - Form Object - Built in Object - User
Defined Object-Cookies
1. Introduction to DOM
The Document Object Model (DOM) is a programming interface that represents an HTML or
XML document as a tree structure.
Each element (like <p>, <div>, <form>, etc.) is treated as an object that can be accessed and
modified using JavaScript.
Example:
<p id="demo">Hello!</p>
<script>
[Link]("demo").innerHTML = "Welcome to JavaScript DOM!";
</script>
Explanation:
Uses of DOM:
2. Event Handling
An event is an action that happens in the browser, such as a click, keypress, mouse move, or
form submit.
Event handling means writing JavaScript code to respond to these actions.
Common Events:
Event Description
Example:
<script>
function showMessage() {
alert("Button clicked!");
}
</script>
Explanation:
When the user clicks the button, the event handler (onclick) calls the function showMessage().
3. Form Object
The Form Object represents an HTML <form> element and allows JavaScript to access and
manipulate form data.
Example of a Form:
<form name="myForm">
Name: <input type="text" name="username"><br>
<input type="button" value="Show Name" onclick="displayName()">
</form>
<script>
function displayName() {
let name = [Link];
alert("Your name is: " + name);
}
</script>
Explanation:
Property Description
4. Built-in Objects
JavaScript provides several built-in (predefined) objects to perform common tasks.
Example:
You can create your own custom objects in JavaScript to represent real-world entities.
Example:
Explanation:
Creating a Cookie:
Reading a Cookie:
Deleting a Cookie:
Key Attributes:
Attribute Description
Uses of Cookies:
✅ Summary Table
Concept Description
Question Bank
Unit I
Internet: Basic Concepts – Communicating on Internet – Internet Domains – Internet Server
Identities – Establishing Connectivity on the Internet
Section A:
No Question Options Answer
The main function of a web (a) Store webpages (b) Send emails (c) (a) Store
5
server is to ________. Transfer files (d) Manage databases webpages
Which of these is an Internet (a) Google (b) Airtel (c) Yahoo (d)
13 (b) Airtel
service provider (ISP)? Wikipedia
Which layer of TCP/IP handles (a) Application layer (b) Network layer
(d) Network
15 the physical connection to the (c) Transport layer (d) Network Access
Access layer
network? layer
Section B:
No Question Answer (Key Points)
Explain the steps in establishing Internet (1) Choose an ISP, (2) Connect
8 hardware (modem/router), (3) Configure
connectivity.
IP settings, (4) Test connection, (5)
No Question Answer (Key Points)
Section C:
Answer:
The Internet is a global network of interconnected computers that communicate using the
TCP/IP (Transmission Control Protocol/Internet Protocol).
It allows users to share information, access resources, and communicate worldwide.
Key Points:
Client and Server: The client (user device) requests services, and the server provides
them (like web pages or emails).
IP Address: Every device connected to the Internet has a unique IP address (e.g.,
[Link]).
Domain Name System (DNS): Converts domain names into IP addresses.
Protocols: Rules for communication—e.g., HTTP (web), SMTP (email), FTP (file
transfer).
Routers & Modems: Devices that route and transmit data over networks.
Working:
Answer:
The Internet supports many ways of communication:
Conclusion:
Internet communication is fast, global, cost-effective, and supports both personal and
professional interactions.
Answer:
A domain name is a readable address for identifying a website on the Internet.
Example: [Link]
Structure:
Types of Domains:
Purpose:
Domains simplify access to websites by replacing numerical IP addresses with readable names.
4. What is the Domain Name System (DNS)? Explain its working and importance.
Answer:
Definition:
The Domain Name System (DNS) is an Internet service that translates human-friendly domain
names into IP addresses.
Working Process:
Importance:
Answer:
Definition:
Internet servers are systems that store, manage, and deliver data or services to clients over the
Internet. Each server has a unique identity (IP address and domain name).
1. Web Server:
o Stores and delivers web pages using HTTP or HTTPS. (e.g., Apache, IIS).
2. Mail Server:
o Handles sending and receiving of emails using SMTP and POP3.
3. FTP Server:
o Manages file transfers between systems.
4. DNS Server:
o Resolves domain names to IP addresses.
5. Database Server:
o Stores and manages large sets of data.
Conclusion:
Each server’s identity ensures data is correctly routed and retrieved by the right client.
Answer:
To connect a computer to the Internet, the following steps are followed:
Result:
Once established, the computer can send and receive data across the global Internet.
Answer:
Definition:
TCP/IP (Transmission Control Protocol / Internet Protocol) is a set of communication protocols
that enables network devices to connect and exchange data.
Layers of TCP/IP:
Importance:
Conclusion:
TCP/IP is the foundation of all Internet communication.
Answer:
Advantages:
1. Global Communication: Easy access to email, video calls, and instant messaging.
2. Information Access: Search engines provide knowledge instantly.
3. E-Commerce: Online shopping and banking made easy.
4. Education: E-learning platforms and online courses.
5. Entertainment: Movies, music, and gaming.
6. Remote Work: Enables work-from-home and online collaboration.
Applications:
Conclusion:
The Internet has become an essential tool for communication, business, learning, and
entertainment, making the world more connected and efficient.
Unit II
Introduction to HTML: Anchor Tag – Hyperlink - Head and Body Section – Heading -
Horizontal Ruler – Paragraphs – Tags - Images and Picture – Lists – Tables – Frames - Forms
and forms elements.
Section A
No Question Options Answer
The <head> section contains (a) Main content (b) Page information (c) Images (d)
3 (b)
________. Tables
7 The <hr> tag is used for (a) Horizontal line (b) Heading (c) Table row (d) (a)
No Question Options Answer
The <table> tag is used to (a) Draw lines (b) Create tables (c) Create lists (d)
11 (b)
________. Insert frames
The <frame> tag is used to (a) Create sections (b) Divide window into frames
13 (b)
________. (c) Add border (d) Insert video
The <input> tag is used for (a) Creating lists (b) Taking user input (c)
15 (b)
________. Displaying text (d) Adding links
Section B
No Question Short Answer
What is an anchor tag? Give The anchor tag <a> is used to create hyperlinks. Example: <a
3
an example. href="[Link] Google</a>.
Explain the use of <hr> and <hr> creates a horizontal line for separation. <p> defines a
5
<p> tags. paragraph, adding spacing and readability.
What are HTML tables used Tables are used to arrange data in rows and columns using
7
for? <table>, <tr>, <th>, and <td> tags.
What are HTML forms and Forms collect user input. Example: login or registration. Tags
8
why are they used? used: <form>, <input>, <textarea>, <select>, <button>.
Section C:
Answer:
An HTML document has a hierarchical structure:
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
</head>
<body>
<h1>Welcome</h1>
<p>This is my first webpage.</p>
</body>
</html>
Explanation:
Types of Links:
o External link: Links to another site.
o Internal link: Links within same site.
o Email link: <a href="[Link] Email</a>
Conclusion: Hyperlinks connect documents and enable website navigation.
Answer:
Head Section:
<head>
<title>My Page</title>
<meta charset="UTF-8">
</head>
Body Section:
<body>
<h1>Hello</h1>
<p>Welcome to HTML.</p>
</body>
Conclusion: The head defines document information; the body defines visible content.
Answer:
Tag Used: <img>
Attributes:
Explanation:
The image file must be in the same folder or linked using a full path.
alt text appears if the image cannot load.
Conclusion: Images enhance visual appeal of web pages.
Answer:
Types of Lists:
<ol>
<li>Apple</li>
<li>Banana</li>
</ol>
<dl>
<dt>HTML</dt>
<dd>Hyper Text Markup Language</dd>
</dl>
Answer:
Purpose: Tables organize data in rows and columns.
Tags Used:
<table border="1">
<tr><th>Name</th><th>Age</th></tr>
<tr><td>John</td><td>25</td></tr>
</table>
Explanation:
Answer:
Purpose: To collect input from users.
Main Tag: <form>
Common Elements:
Unit III
DHTML and Style sheets: Defining styles - Elements of style - Linking a style sheet to a html
documents - Inline style - External style sheets - Multiple styles- Web page designing.
Section A:
No Question Options Answer
6 The style attribute is used for (a) External CSS (b) Inline CSS (c) Internal CSS (b)
No Question Options Answer
Which property changes the (a) background (b) background-color (c) bgcolor
8 (b)
background color? (d) color
Multiple styles can be (a) External CSS only (b) Internal CSS only (c)
12 (c)
combined by using ________. Inline, Internal, and External CSS (d) None
The z-index property in CSS is (a) Font alignment (b) Stacking order of elements
15 (b)
used for ________. (c) Background setting (d) Indentation
Section B:
No Question Short Answer
Define DHTML DHTML stands for Dynamic HTML, which combines HTML, CSS,
1 and explain its and JavaScript to make web pages dynamic and interactive. It allows
importance. content to change without reloading the entire page.
What are the Elements: Selectors, Properties, and Values. Example: h1 { color: red;
2 elements of style in font-size: 20px; } – where h1 is the selector, color is the property, and
CSS? red is the value.
What are the types Three types: Inline CSS, Internal CSS, and External CSS. Each can
4
of CSS? define styles in different ways based on the requirement.
What is Inline
Inline style is defined inside an HTML tag using the style attribute.
5 Style? Give
Example: <p style="color:blue;">Hello</p>
example.
What is an External It’s a separate .css file linked to HTML using <link> tag. It allows
6
Style Sheet? reusing same style across multiple web pages.
Define Multiple Multiple styles allow using more than one CSS type (inline, internal,
7
Styles. external). Priority: Inline > Internal > External.
Section C
Answer:
Definition: DHTML (Dynamic HTML) is an advanced form of HTML that allows web pages to
change dynamically without reloading.
Components:
p{
color: red;
font-size: 18px;
}
Here, p is the selector, color and font-size are properties, and red, 18px are values.
Conclusion: These elements control the appearance of web content efficiently.
Answer:
There are three ways to link a CSS style sheet:
Conclusion: External CSS is best for large sites; inline CSS for quick edits.
4. Write short notes on Inline Style and External Style Sheet with examples.
Answer:
Inline Style:
<p style="color:green;">Hello!</p>
[Link]:
p { color: blue; }
Answer:
Concept:
HTML supports Inline, Internal, and External CSS together.
Priority Order:
1. Inline (highest)
2. Internal (middle)
3. External (lowest)
Example:
The paragraph will appear red because inline CSS overrides others.
Conclusion: Multiple styles provide flexibility and layering.
Answer:
1. Consistency: Same style applied to multiple pages.
2. Separation of content and design: Easier to maintain.
3. Faster Loading: Smaller code and better caching.
4. Responsive Design: Adapts to screens.
5. Accessibility: Easier customization for different users.
Conclusion: CSS improves design efficiency and user experience.
7. Explain the steps involved in designing a web page using HTML and CSS.
Answer:
Steps:
Answer:
External Separate CSS file <link rel="stylesheet" href="[Link]"> Many pages Lowest
Conclusion:
External CSS is best for large sites, while inline is suitable for one-time styling.
Unit IV
Introduction to Java script: Advantage of JavaScript - Data type - Variable – Array - Operator
and Expression - Control and looping Constructs - Functions - Dialog Boxes.
Section A:
No Question Options Answer
JavaScript was developed by (a) James Gosling (b) Tim Berners-Lee (c)
2 (c)
________. Brendan Eich (d) Dennis Ritchie
JavaScript code is executed by (a) Server (b) Compiler (c) Browser (d)
3 (c)
________. Database
Which HTML tag is used to include (a) <js> (b) <javascript> (c) <script> (d)
4 (c)
JavaScript code? <code>
The correct way to declare a variable (a) var name; (b) int name; (c) variable
6 (a)
in JavaScript is ________. name; (d) name = variable;
Which of the following is not a (a) String (b) Number (c) Boolean (d)
7 (d)
JavaScript data type? Character
The function to display an alert box is (a) prompt() (b) alert() (c) confirm() (d)
12 (b)
________. display()
The function to get user input through (a) prompt() (b) input() (c) confirm() (d)
13 (a)
dialog box is ________. alert()
The length property of an array (a) Total elements (b) First element (c) Last
14 (a)
returns ________. element (d) Undefined
A function in JavaScript is defined (a) method (b) function (c) define (d)
15 (b)
using the keyword ________. procedure
Section B:
No Question Short Answer
What are the data types 1. String2. Number3. Boolean4. Undefined5. Null6. Object7.
3
in JavaScript? Symbol
Define variable. How is Variable is a name for storing data values. Declared using var, let,
4
it declared in JavaScript? or const. Example: var x = 10;
Define array with An array stores multiple values in one variable. Example:var fruits
5
example. = ["apple", "banana", "mango"];
Write short notes on Control statements determine flow of execution:1. if, if...else,
7
control statements. switch – decision making2. for, while, do...while – loops
Section C:
Answer:
Advantages:
Dynamic typing
Event handling
Object-based language
Case-sensitive
Rich built-in functions
Answer:
1. String: Represents text.
var x;
1. var – Function-scoped.
2. let – Block-scoped.
3. const – Constant, cannot change.
Example:
var a = 10;
let b = 20;
const c = 30;
Rules:
Answer:
Definition: Array stores multiple values in a single variable.
Syntax:
Example:
Array Methods:
Logical `&&
Example:
var x = 5, y = 10;
var sum = x + y; // 15
Answer:
Control Statements:
if (a > b)
alert("A is greater");
else
alert("B is greater");
Switch:
switch(day){
case 1: alert("Monday"); break;
case 2: alert("Tuesday"); break;
default: alert("Invalid");
}
Loops:
for loop:
while loop:
var i=1;
while(i<=5){ [Link](i); i++; }
do...while loop:
var i=1;
do{ [Link](i); i++; } while(i<=5);
Answer:
Definition: Function is a reusable block of code that performs a specific task.
Syntax:
function functionName(parameter){
// code block
}
functionName(argument);
Example:
function greet(name){
alert("Hello " + name);
}
greet("John");
Advantages:
Reusable code
Easier debugging
Modular design
Answer:
1. Alert Box – Displays information.
alert("Welcome!");
Use: Dialog boxes are used for user interaction, form validation, and alerts.
Unit V
JavaScript Document Object Model: Event Handling - Form Object - Built in Object - User
Defined Object-Cookies
Section A:
No Question Options Answer
In JavaScript, an event is (a) An error (b) An action by the user or browser (c)
4 (b)
________. A data type (d) A keyword
Which of the following is an (a) onclick (b) onload (c) onmouseover (d) All of
5 (d)
event? these
Cookies are stored on (a) Server (b) Client computer (c) Cloud (d)
11 (b)
________. Database
User-defined objects can be (a) object() (b) new keyword and constructor
14 (b)
created using ________. function (c) var (d) prototype only
Section B:
No Question Short Answer
What is event Event handling allows JavaScript to respond to user actions such as
2 handling in clicks, mouse movements, or key presses using event attributes (like
JavaScript? onclick, onchange) or event listeners.
Define a user-
User-defined objects are created using constructor functions or object
5 defined object with
literals. Example:var student = {name:"John", age:21};
an example.
6 What is a cookie? A cookie is a small piece of data stored on the client’s computer by the
No Question Short Answer
Write short notes on The Math object provides mathematical constants and functions such as
7
the Math object. [Link], [Link](), [Link](), [Link]().
Section C:
1. Explain the structure and importance of the Document Object Model (DOM).
Answer:
Importance:
Example:
[Link]("demo").innerHTML = "Welcome!";
Answer:
Definition: Event handling is the process of executing code when an event occurs.
Common events:
Methods:
1. Inline Event:
2. Event Listener:
[Link]("btn").addEventListener("click", showMsg);
function showMsg() { alert("Button clicked!"); }
Answer:
Definition: The form object represents an HTML form and lets you access form fields using
JavaScript.
Properties:
Methods:
Example:
<form name="myForm">
<input type="text" name="user">
<input type="button" value="Submit" onclick="submitForm()">
</form>
<script>
function submitForm() {
[Link]();
}
</script>
4. Describe built-in objects in JavaScript with examples.
Answer:
1. String Object:
var s = "Hello";
[Link]([Link]);
2. Array Object:
3. Math Object:
[Link]([Link](16));
4. Date Object:
Answer:
Definition: Objects created by the programmer for custom data types.
var student = {
name: "John",
age: 21,
display: function() {
[Link]([Link] + " is " + [Link] + " years old");
}
};
[Link]();
Answer:
Definition: Cookies store small data (name/value pairs) on client’s computer.
Creating a cookie:
Reading cookies:
alert([Link]);
Deleting cookies:
Answer:
Date Object: Used to work with dates and times.
[Link]([Link]);
[Link]([Link](2,3));
[Link]([Link]());
Use: Helpful for calculations, date/time display, and random number generation.
Answer:
Cookies: Used to store small pieces of user data like usernames or preferences.
Form Object: Represents HTML forms, provides control over inputs and submission.
Event Handling: Responds to user interactions like mouse clicks or key presses using
event listeners.
Example: