FOC-M4-part 1
FOC-M4-part 1
Module - 4
A Brief Introduction to the Internet:
● Origins ARPAnet -
○ late 1960s and early 1970s US DoD developed large scale network. Basic requirement was
that the network should be sufficiently robust. DoD’s ARPA funded for the first project and so
the name ARPAnet .(Advanced Research Projects Agency (ARPA) )
○ ARPANET was available to laboratories & universities that conducted ARPA-funded
research.
● BITnet(Because It’s Time N/W), CSnet(Computer Science Network) :
○ developed in late 1970s & early 1980s.BITnet is began at City University of New York. It was
to provide email and file transfer for other institutions.
○ For different reasons BITnet and CSnet were not widely used.
• Collection of software and protocols that helps to gather or deliver information during
the communication.
• Internet:
• Collection of computers and other devices connected each other and allows them to
communicate each other.
Web Design
• Web pages are retrieved and displayed using the Hypertext Transfer Protocol (HTTP),
which can be secured with HTTPS for enhanced privacy and security.
• HTML provides the structure of a webpage by defining its elements, such as headings,
paragraphs, and images.
• CSS adds styling (e.g., colors, layouts, fonts), while JavaScript enables interactivity and
dynamic functionality (e.g., animations, form validation).
• A web browser renders the page content according to the HTML markup instructions,
displaying it on the user's device.
Understanding Web Content Delivery
• Web content delivery refers to the process through which web content, such as HTML
pages, images, videos, and scripts, is delivered from a server to a user's web browser.
• This involves several components and technologies working together to ensure efficient,
Types of Webpages
Dynamic Webpages
• A dynamic webpage generates content on the fly, often based on user interaction,
database queries, or real-time data.
• Uses server-side programming (e.g., PHP, Python, Node.js, Java, ASP.NET).
• Can interact with databases (e.g., MySQL, MongoDB) to fetch or store data.
• Content changes based on user actions or external data.
• Often integrates APIs or real-time features (e.g., live chat, stock prices).
• Examples:
• Social media platforms (Facebook, Twitter, Instagram).
• E-commerce websites (Amazon, Flipkart).
Key Concepts of Web Content Delivery
2. Web Servers:
• A web server is software or hardware that delivers web content to clients over the
Internet or a local network.
• It processes client requests, typically made through a web browser using the Hypertext
Transfer Protocol (HTTP) or its secure variant, HTTPS.
• When a web server receives a request, it locates the requested resource (such as a
web page, image, or file) and sends it back to the client.
• If the request involves running a server-side script or program, the server executes it
and returns the generated output as a response.
• Examples: Apache, Microsoft IIS.
• HTTPS is the secure version of HTTP with encryption for safe data transmission.
7. Caching:
• Storing a copy of web content closer to the user (in the browser or on proxy servers) for
faster retrieval.
2. DNS Resolution: The browser sends a request to a DNS server to find the IP address
associated with the domain name. The domain name is resolved into an IP address by the
DNS Server.
3. Once the IP address is found, the browser sends a request to that IP address,
asking for the specific web page.
5. Content Transmission: Content is transmitted over the Internet to the user's browser
using TCP/IP.
6. Browser Rendering: The browser receives the web page's data and renders it into a
format that user can read and interact with.
Steps in Web Content Delivery
1. Start the Classic FTP program and click the Connect button. You will be prompted to fill out
information for the site to which you want to connect.
Using an FTP Client
2. Fill in each of the items shown in Figure 1.5 as follows: .
• Enter Site Label
•A name for your site.
•Enter FTP Server Address
•The FTP address provided by your hosting provider (e.g., ftp.yourdomain.com).
•Enter Login Credentials
•Username & Password (provided by your hosting provider).
•Keep Initial Directory Settings Default
•Do not change Initial Remote Directory and Initial Local Directory until you are
familiar with FTP workflows.
Using an FTP Client
3. Save Settings & Connect
•Click OK to save settings and establish a connection.
•Check Connection Status
•A dialog box will show connection progress.
•If successful, an interface appears showing:
•Local directory (your computer) on the left.
•Remote web server files on the right.
Using an FTP Client
4. Navigate to the Document Root
•The document root is the top-level directory for web content.
•Common names for the document root:
•public_html
•www (Alias for public_html)
•htdocs
•This directory is already created by your hosting provider.
•Open the Document Root Directory
•Double-click the directory name to open it
•Contents of this directory will be displayed (may be empty).
•Locate the File to Upload.
•The goal is to transfer the sample.html file you created earlier from your computer to the
web server
•In the left pane (local computer files), find the file (sample.html).
•Navigate if needed to locate the correct folder.
Understanding HTML
• The first tag in a pair is the start tag, the second tag is the end tag.
• It forms the backbone of web pages and applications by providing the basic structure that other
technologies like CSS (Cascading Style Sheets) and JavaScript enhance with styling and
interactivity.
• XHTML is almost identical to HTML 4.01.XHTML is a stricter and cleaner version of HTML 4.01.
Key Features of HTML
1. Markup Language:
• An HTML document must include the four tags <html>, <head>, <title>, and <body>.
Basic Structure of an HTML Document
• Example
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Welcome to HTML Basics</h1>
<p>This is a paragraph in HTML</p>
</body>
</html>
HTML Tags
Common Tags
HTML Tag
• The <html> tag represents the root of an HTML document.
• The <html> tag is the container for all other HTML elements (except for the <!DOCTYPE>
tag).
Head Tag
• The <head> element is a container for metadata (data about data) and is placed between
the <html> tag and the <body> tag.
• Metadata is data about the HTML document. Metadata is not displayed.
• Metadata typically define the document title, character set, styles, scripts, and other meta
information.
• The following elements can go inside the <head> element:
•<title> (required in every HTML document)
•<style>
•<base>
•<link>
•<meta>
•<script>
•<noscript>
Body Tag
• The <body> tag defines the document's body.
• The <body> element contains all the contents of an HTML document, such as headings,
paragraphs, images, hyperlinks, tables, lists, etc.
• Note: There can only be one <body> element in an HTML document.
Title tag
• The <title> tag in HTML is used to define the title of a web page.
• This title is displayed on the browser tab and is often used by search engines as the title of
the page in search results.
<!DOCTYPE html>
<html>
<head>
<title>HTML Elements Reference</title>
</head>
<body>
This is a Web page
Title tag </body>
</html>
Heading Tags
• HTML provides six levels of heading tags, from <h1> (the highest, most important level) to
<h6> (the lowest, least important level).
• These tags are used to define headings and subheadings on a web page, creating a clear
hierarchy and structure for content.
Example: Heading Tags
CODE OUTPUT
Paragraph
• The <p> tag in HTML is used to define a paragraph of text.
• It is a block-level element, meaning it starts on a new line and takes up the full width
available by default.
• Browsers add some default margin above and below paragraphs for readability.
• You can include inline elements such as <strong>, <em>, or <a> within a paragraph.
Example : Paragraph
CODE OUTPUT
<!DOCTYPE html>
<html>
<head>
<title>Sample Web Page</title>
</head>
<body>
<h1>This is an H1 heading (Largest)</h1>
<h2>This is an H2 heading</h2>
<h3>This is an H3 heading</h3>
<h4>This is an H4 heading</h4>
<h5>This is an H5 heading</h5>
<h6>This is an H6 heading (Smallest)</h6>
<p>This is the first paragraph. It introduces the concept of paragraphs in HTML.</p>
</body>
</html>
Font Styles and Sizes (can be nested)
• In HTML, font styles and sizes can be adjusted using various tags and CSS (Cascading Style
Sheets).
• These styles can be nested to apply multiple styling rules to text within different elements. ).
• Here's how you can modify font styles and sizes:
• Font Style Tags
1. <b>: Makes text bold
2. <i>: Makes text italic.
3. <u>: Underlines the text.
4. <em>: Emphasizes text, typically in italics (semantic meaning in HTML).
5. <strong>: Makes text bold with stronger emphasis (semantic meaning in HTML
Example
<!DOCTYPE html>
<html>
<head>
<title>Sample Web Page</title>
</head>
<body>
<h3>Font Size Example</h3>
<p>This is normal text - <b>and this is bold text</b>.</p>
<p>We <em>cannot</em> live like this.</p>
<p>The <i>Titanic</i>, a luxury steamship, sank after striking an iceberg.</p>
<p><strong>This text is important!</strong></p>
<p>This is some <u>mispeled</u> text.</p>
</body>
</html>
break tag
• Line break tag
• Used when the webmaster wants a carriage return but doesn't want a blank line to follow
• The <br> tag is an empty tag. It has no closing tag.
• Example: text a
• <p>text a</p>
• <p>text b</p> text b
• <br>text c
• <br>text d text c
text d
Example
<body>
<h2>Using the <br> Tag</h2>
<p>This is the first line.<br>This is the second line.<br>This is the third line.</p>
<p>Address Example:</p>
<p>
John Doe<br>
123 Main Street<br>
City, Country<br>
</p>
</body>
Horizontal Rule
• The <HR> tag puts a graphical line across the page.
• Horizontal Rule Attributes:
• WIDTH="xx%/xx" -- Controls the width of the line. You may specify either
percentage of the width of a page or actual pixel length
• SIZE="xx" -- Controls the height of the line. You need to specify the dimension in
pixels.
• ALIGN="left/center/right" -- This allows the line to be aligned to the left, right, or
center of the page
<body>
<h2>Default Horizontal Rule</h2>
<hr>
<h2>HR with Specific Width</h2>
<hr width="50%">
<h2>HR with Specific Height</h2>
<hr size="10">
<h2>HR with Alignment</h2>
<p>Left-aligned line:</p>
<hr width="50%" align="left">
<p>Center-aligned line:</p>
<hr width="50%" align="center">
<p>Right-aligned line:</p>
<hr width="50%" align="right">
</body>
Anchor Tag
• The <a> tag in HTML is used to create hyperlinks, enabling users to navigate between
different pages, sections of the same page, or other resources such as files, images, or
external websites.
Example
<body>
<h2>Shopping List</h2>
<ul class="styled-list">
<li>Bread</li>
<li>Milk</li>
<li>Cheese</li>
</ul>
</body>
HTML LISTS
2. Ordered List
• An ordered list is also a list of items.
• The list items are marked with numbers.
• An ordered list starts with the <ol> tag and end with </ol> tag.
• Each list item starts with the <li> tag.
• Syntax
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>
Example
<body>
<h2>Steps to Make Tea</h2>
<ol class="styled-list">
<li>Boil water</li>
<li>Add tea leaves</li>
<li>Simmer for a few minutes</li>
<li>Strain and serve</li>
</ol>
</body>
Nested List
• A nested list in HTML is a list within a list. You can create a nested list using <ul>
(unordered list) or <ol> (ordered list) elements, with <li> (list items) inside them.
• Steps to Create a Nested List Structure:
1. Create a main <ul> or <ol> list.
2. Add <li> elements for list items.
3. Inside a <li>, nest another <ul> or <ol> list.
4. Repeat the process for deeper levels if needed.
<ul>
<li>Fruits
<ul>
<li>Apple</li>
<li>Banana</li>
<li>Grapes
<ul>
<li>Black Grapes</li>
Example of a <li>Green Grapes</li>
</ul>
Nested List </li>
</ul>
</li>
<li>Vegetables
<ul>
<li>Carrot</li>
<li>Spinach</li>
</ul>
</li>
</ul>
HTML Description Lists
• A description list is a list of terms, with a description of each term.
• The <dl> tag defines the description list.
• The <dt> tag defines the term (name), and the <dd> tag describes each term:
Example
<body>
<h2>A Description List</h2>
<dl>
<dt>Coffee</dt>
<dd>- Coffee is a popular beverage made from roasted coffee beans, known for its rich
aroma, bold flavor, and stimulating caffeine content. It is enjoyed worldwide in various forms, from
espresso to lattes, and is a staple in many cultures.</dd>
<dt>Milk</dt>
<dd>- Milk is a nutritious liquid produced by mammals, rich in proteins, calcium, and essential
vitamins. It is widely consumed as a beverage and used in various dairy products like cheese, yogurt, and
butter.</dd>
</dl>
</body>
Image tag
•The <img> tag in HTML is used to display images on a webpage.
•Syntax
Image tag
• Attributes
•src="image.jpg" → Specifies the image file location.
•alt="Description of Image" → Provides alternative text if the image fails to load.
<body>
<h2>Example of Table with Border</h2>
<h4>Horizontal Header:</h4>
<table border="1">
<tr>
<th>Name</th>
<th>Loan No</th>
<th>Amount</th>
</tr>
<tr>
<td>Jones</td>
<td>L-1</td>
<td>5000</td>
</tr>
</table>
<br>
<br>
<h4>Vertical Header:</h4>
<table border="5">
<tr>
<th>Name</th>
<td>Jones</td>
</tr>
<tr>
<th>Loan No</th>
<td>L-1</td>
</tr>
<tr>
<th>Amount</th>
<td>5000</td>
</tr>
</table>
</body>
HTML Form
•A form is an area that can contain form elements.
•Form elements are elements that allow the user to enter information in a form.
•Example - textfields, textarea fields, drop-down menus, radio buttons and checkboxes etc.
•The syntax:-
<form>
input elements
</form>
HTML Form
• HTML has tags to create a collection of objects that implement the information gathering
– The objects are called widgets or controls (e.g., radio buttons ,checkboxes, text
,password , reset, submit )
– All control tags are inline tags
– Most controls are used to gather information from the user in the form of either text or
button selections
– Every form data requires submit button
• When the Submit button of a form is clicked, the form data is encoded and are sent to the
server for processing.
HTML Form Attributes
• The action attribute in an HTML <form> tag specifies the URL where the form data should
be sent when the user submits the form.
• If omitted, the form data is sent to the same page where the form is located.
• Example:
<form action="/action_page.php">
Form Elements
• The HTML <form> Elements
• The HTML <form> element can contain one or more of the following form elements:
• <input>
• <label>
• <select>
• <textarea>
• <button>
• <fieldset>
• <legend>
• <datalist>
• <output>
• <option>
• <optgroup>
The <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.
• Many of the commonly used controls such as text , passwords, checkboxes, Reset, Submit,
radio buttons etc. are created with the <input> tag.
• The type attribute of <input> specifies the kind of widget being created such as checkbox,
text, password, radio button etc.
Text
• If the contents of the textbox should not be displayed when it is entered by the user, a
password control can be used.
• <input type= “password” name = “myPassword” size = “10” maxlength = “10” />
• In this case, regardless of what characters are typed into a password control, only bullets or
asterisks are displayed by the browser.
Example
Example
<body>
<h3>Simple Form</h3>
<form>
<label for="fname">First name:</label>
<input type="text" id="fname" name="fname">
<br>
<label for="lname">Last name:</label>
<input type="text" id="lname" name="lname">
<br>
<label for="password">Password:</label>
<input type="password" id="password" name="password">
<br><br>
<input type="submit" value="Submit">
</form>
</body>
Radio Buttons
• Closely related to checkbox buttons except that only one radio button can be ‘checked’ at a
time.
• Every time a radio button is pressed , the button in the group that was previously on turned
off.
• The type value for the radio buttons is radio.
• Every button in a radio button group MUST have the same name
Checkboxes
• It is used to collect multiple choice input.
• A checkbox control is a single button that is either on/off (checked or not) .
• Every checkbox requires a name attribute and value attribute, which is the widget’s value
in the form data when the checkbox is ‘checked’.
• A checkbox that is not ‘checked’ (off) contribute no value to the form data.
• To initialize a checkbox to ‘checked’, the checked attribute of checkbox must be set to
"checked“.
• Check box should appear in the label elements.
The Submit and Reset Button
• The <input type="submit"> defines a button for submitting the form data to a form-handler.
• The form-handler is typically a file on the server with a script for processing input data.
• The form-handler is specified in the form's action attribute.
• < input type = "reset" value = "Reset Form /">
• <input type = "submit” value = "Submit Form /">
• Submit has two actions:
• 1. Encode the data of the form and send to the server.
• 2. Request that the server execute the server-resident program specified as the value of the action
attribute of <form>
• 3. A Submit button is required in every form
• Reset button is used to reset the form data to its initial value.
Validating Your Web Content
• Validation is the process of testing your pages with a special application that searches for
errors and makes sure your pages follow the strict XHTML standard.
• The World Wide Web Consortium (W3C)—offers an online validation tool you can use.
• To validate a page, follow this URL: http://validator.w3.org/.
Validating Your Web Content
• If you’ve already published a page online, you can use the Validate by URI tab.
• Use the Validate by File Upload tab to validate files stored on your local computer file
system.
• The Validate by Direct Input tab enables you to paste the contents of a file from your text
editor