Web301 - Prelim Lesson
Web301 - Prelim Lesson
VI. Module Outcomes After studying this module on the basics of HTML, the students shall be
able to:
1) Determine the basic terminologies used in web designing.
2) Narrate the important key points in the history of Internet
3) Narrate how server-client architecture works
4) Identify the important elements of HTML, CSS and Bootstrap
5) Create a web pages to solve a particular business requirement.
Lesson Objectives:
At the end of this lesson, you will be able to:
Explain and understand how web works
Understand major components of internet
Understand major software components of internet
Understand types of Internet Programming Languages
Explain the process of requesting Information via URLs
Discussions
ARPA
February 7, 1958 was the day Secretary of Defense Neil McElroy signed Department of Defense
Directive 5105.15. His signature launched the Advanced Research Projects Agency (ARPA), now known
as the Defense Advanced Research Projects Agency (DARPA). The creation of the agency is an
important moment in science history because it led to the creation of the internet we recognize today.
The existing national defense network relied on telephone lines and wires that were
susceptible to damage. In 1962, J.C.R. Licklider, a scientist from ARPA and MIT, suggested connecting
computers to keep a communications network active in the US in the event of a nuclear attack.
This network came to be known as the ARPA Network, or ARPAnet. Packet switching made data
transmission possible in 1965, and by 1969, military contractor Bolt, Beranek, and Newman
(BBN) developed an early form of routing devices known as interface message processors (IMPs), which
revolutionized data transmission.
The Stanford University Network was the first local area network connecting distant
workstations. In 1981, the NSF expanded ARPAnet to national computer science researchers when it
funded the Computer Science Network (CSNET). BBN assumed CSNET operation management in 1984.
ARPAnet adopted the transmission control protocol (TCP) in1983 and separated out the military network
(MILnet), assigning a subset for public research. Launched formally as the National Science Foundation
Network (NSFNET) in 1985, engineers designed it to connect university computer science departments
across the US.
"ARPAnet's transition to the open networking protocols TCP and IP in 1983 accelerated
the already burgeoning spread of internetworking technology," says Stephen Wolff, principal
scientist with Internet2. "When NSF's fledgling NSFNET adopted the same protocols, ARPAnet
technology spread rapidly not only to university campuses across the USA to support the higher education
community, but also to emergent Internet Service Providers to support commerce and industry."
The NSFNET eventually became a linked resource for the five supercomputing centers across the US,
connecting researchers to regional networks, and then on to nearly 200 subsidiary networks. NSFNET
took on the role of internet backbone across the US, with ARPAnet gradually phased out in 1990.
interface norms we’ve come to expect today (like the browser’s URL address bar and
back/forward/reload options for viewing webpages.)
Eventually the NSFNET modified its acceptable use policy for commercial use, and by 1995,
it was decommissioned. Soon, the internet provider model created network access points that allowed the
for-profit, commercial side of the internet to be developed.
The internet went from being an obscure research idea to a technology that is used by over 3.2 billion
people in less than sixty years.
What do we use the internet for?
Browsing information
Social media and creating awareness
For entertainment (music, videos, movies)
Communicating with people all over the world.
Sharing information
E-commerce and banking
Major Software Components of Internet
Web server -A Web server is software or hardware that uses HTTP (Hypertext Transfer Protocol)
and other protocols to respond to client requests made over the World Wide Web (WWW). Web
server software controls how a user accesses hosted files. It is accessed through the domain names of
websites and ensures the delivery of the site's content to the
requesting user. As hardware, a Web server is a computer that holds web server software and other
files related to a website, such as HTML documents, images and JavaScript files. Web server
hardware is connected to the internet and allows data to be exchanged with other connected devices.
Web Browser - (commonly referred to as a browser) is a software application for accessing
information on the World Wide Web. When a user requests a web page from a particular website, the
web browser retrieves the necessary content from a web server and then displays the page on the
screen.
Below are the types of browser you can use to preview your output in html. Note that you can use
other web browsers available like Konqueror, Lynx among other things.
Note. Internet Explorer (IE) will be replaced by Microsoft Edge in the future. So it means that you should
test your future web application to Microsoft Edge instead of IE
How the Web Works
The World Wide Web has a client/server architecture. This means that a client program running on
your computer (your Web browser) requests information from a server program running on another
computer somewhere on the Internet. That server then sends the requested data back over the Net to
your browser program, which interprets and displays the data on your screen.
Figure below shows the whole process graphically.
at home. The only difference you will notice between the two is speed; otherwise, they work
identically.
There are Web browser programs for just about any computer you can name, from dumb text-only
terminals running on mainframes to off-brand personal computers, such as the Amiga. (I'll list and
discuss the most popular browser programs later in this chapter.)
The Server Computer
On the content-provider side of things, you need a server computer. This machine has requirements
similar to those of the client computer: it must be connected to the Internet and must be able to run a
Web server program.
Tip. A Web server program is often called an HTTPD, for HyperText Transfer Protocol
Daemon. Daemon is computerese for a program that runs unseen in the background.
However, a Web server needs a more robust Internet connection than a Web client does. A server
should ideally be hooked up to the Internet via a fast dedicated T1 or T3 line that remains connected
all the time. Otherwise, people trying to access your Web site will often find that it just isn't there.
It is possible (though excruciatingly slow) to run a Web site on a dial-up line, especially if you can
find an Internet service provider who will let you stay dialed in 24 hours a day without disconnecting
you. However, you must make sure that your ISP can assign a
permanent IP address to your machine-not a new IP address each time you connect. Otherwise,
people won't even be able to find your site.
Note
A good intermediate solution to the direct vs. dial-up problem is an ISDN line. A
sort of super fast digital phone line, an ISDN line costs more than a regular phone
line but much, much less than a dedicated T1 or T3 line. It also requires a special
interface card for your computer. ISDN lines are offered by most phone companies
in urban areas and university towns, but you'll need to find an ISP that can provide
an ISDN connection too. Contact the business office of your local phone company
for details.
HTTPD server software is available for a wide variety of computers (see fig. 2.2). Surprisingly, server
computers don't have to be very powerful; serving up Web content is simply not that demanding. More of
a concern is having a multithreaded, multitasking operating system so that the server can handle several
tasks at once without bogging down. Storage is a concern, however, because Web sites are notorious for
growing without limit.
What is URL
Also known as a web address, a URL (Uniform Resource Locator) is a form of URI and a
standardized naming convention for addressing documents accessible over the Internet and Intranet.
An example of a URL is https://www.computerhope.com, which is the URL for the Computer Hope
website.
model of interaction. It's the reason your browser program always seems to be saying "Waiting for
reply…" in its status display line
A browser's request for information takes the form of a URL (Uniform Resource Locator), which is
also referred to as a page's address or location.
Web browsers generally display the URL of the Web page currently being viewed near the top of the
window as shown in red box below. Eample is https://yahoo.com
URL example
http://www.microsoft.com/msoffice/freestuf/msword/download/ia/default.htm
The "http://" portion of the URL indicates that the browser has requested a transfer via HTTP protocol;
that is, it wants a Web page. "www.microsoft.com" is the domain name of the server being queried; in
this case, it's the Web server at Microsoft. The "msoffice/freestuf/msword/download/ia/" portion of the
path name.
URL is the path name on the server's hard drive for the file you want. (Fortunately, this example is of one
of the longer path names you're likely to run into on the Web.) "default.htm" is the name of the actual
HTML file on the server
Tip
If the protocol portion of a URL is https:// or snews://, it means that the connection
is secure.
URLs can reference not only Web pages, but also just about any service on the Internet, including FTP,
Gopher, WAIS, Usenet, and Telnet. You can even load in a file from your own computer! Table 1 below
shows the syntax for the various types of sites that can be accessed via a Web browser.
Table 1. URL Syntax for Addressing Various Types of Internet Sites
URL Syntax Type of Access
The domain name portion of a URL may include a colon followed by a port number, like this:
http://www.somesite.net:80/path/webpage.htm
This tells the server to access the site via a specific assigned port.
Tip
Port 80 is the default port defined in the HTTP specification. If not given, it is
assumed.
Web page file names usually end in .htm or .html to indicate that they are HTML content files. Many
home pages don't have path names or file names at all. Their URLs are in a very abbreviated format:
What Servers Do
When you analyze what a server does, you begin to fully realize just how much of the look and feel
of the World Wide Web is in the browser program.
The browser client strips an URL down to its component parts: protocol, address, path name, and file
name. From the protocol portion, it determines how it is going to interact with the server that it's
addressing and how to display the data it will receive. It then calls the address contained in the URL
and waits for a response from the server.
Once the server realizes that a request is coming through, it likewise checks the URL for the
connection protocol (e.g., http:// for a Web page). It takes the path name and file name that it has been
given, finds them on its hard drive, and sends the data off to the browser using the correct protocol.
Then it's the browser's turn again. This time it gathers in, interprets, and properly displays the data it
has received.
HTTP
The HyperText Transfer Protocol (HTTP) was designed to be quick, simple, and nonintrusive. The
connection between a server and a client program (or agent) is temporary and must be reestablished
for every data transfer.
The HTTP specification incorporates a whole set of methods that are used to perform the tasks
associated with servicing a Web site, including information retrieval, searching, front-end updating,
and annotation. The specification is open-ended, so additional functionality can be added without
making the whole Web obsolete.
As discussed previously, messages are passed in a format that is similar to Internet Mail and the
Multipurpose Internet Mail Extensions (MIME); gateways enable browsers to request the execution
of CGI applications on the server hardware; and communication is possible with other Internet
protocols, such as SMTP, NNTP, FTP, Gopher, and WAIS.
HTTP is, like these earlier protocols, a TCP/IP protocol. However, it can be implemented on top of
any other protocol implementation that can communicate over the Internet or on other networks,
including LANs.
Tip
The current version of the HTTP protocol specification can be found at the site
maintained by the HTTP Working Group at http://www.ics.uci.edu/pub/ietf/http/.
Specifications for Library Applications" (Z39. 50:1988) to search index databases on remote
computers
TELNET - a network protocol that allows a user on one computer to log into another computer that
is part of the same network
Wireless Application Protocol - is a technical standard for accessing information over a mobile
wireless network. A WAP browser is a web browser for mobile devices such as mobile phones that
uses the protocol.
Web programming
refers to the writing, markup and coding involved in Web development, which includes Web content,
Web client and server scripting and network security. The most common languages used for Web
programming are XML, HTML, JavaScript, Perl 5 and PHP
Web design is the process of creating websites. It encompasses several different aspects, including
webpage layout, content production, and graphic design.
Web Design vs. Web Development In A Nutshell
In essence, web design refers to both the aesthetic portion of the website and it’s usability. Web
designers use various design programs such as Adobe Photoshop to create the layout and other visual
elements of the website. Web Developers on the other hand, take a website design and actually make
a functioning website from it. Web developers use HTML, CSS, Javascript, PHP and other
programming languages to bring to life the design files.
Internet Programming
HyperText Markup Language (HTML) – a simple markup language used to create hypertext documents
that are portable from one platform to another.
Two General Types of Internet Programming Languages
1. Server-Side programming language - programming language where validation of user input
happens at the server itself acting on or creating a data stream as it is send out to the internet client.
Examples (XML, Java, PERL, ASP.Net, PHP…)
2. Client-Side programming language – the program that runs on the client side or end-user
workstation. Examples (JavaScript, VBScript,Angular….)
Other Important Terms
Surfing – browsing or navigating the Web through pages of information
Web Page – an electronic document written in an Internet language that depicts information
Website – collection of related web pages usually controlled and maintained by single organization
Hypertext or Hyperlinks – an underlined text or an image(indicating by a pointing hand cursor) that
lets you jump from one web page to another.
Static Web Pages – existing HTML pages that are stored in server’s drive
Dynamic Web Pages – HTML pages that are created, dynamically on the fly, as response to a
request by an application
HyperText Transfter Protocol (HTTP) – the standard protocol used for transferring hypertext
pages. Browsers and servers use the HTTP to communicate
Virtual Reality Modeling Language (VRML) – known as the Virtual Reality Markup Language) is
a standard file format for representing 3-dimensional (3D) interactive vector graphics, designed
particularly with the World Wide Web in mind
Uniform Resource Locator (URL) - incorporates the domain name, along with other detailed
information, to create a complete address (or “web address”) to direct a browser to a specific page
online called a web page. In essence, it's a set of directions and every web page has a unique one
SUMMARY
In this lesson you learned the how web works, how client computer connects to server and how they send
and receive information.
And also, in this lesson you learned major software components of internet and how they work each
other.
One of the important things to know in internet programming is what types of internet programming
languages you are using, if it is client side or server-side programming. This is a key to understand how
development is being done in internet.
And lastly, you learned and understand the different ways of using URL and URI’s, the details on how
they used and how they are being implemented in internet.
Lesson Objectives:
At the end of this lesson, you will be able to:
Understand and explain the fundamentals of HTML
Understand and explain the basic structure of HTML including the elements and attributes and
formatting of text using HTML tags.
Discussions
What is HTML?
HTML stands for Hyper Text Markup Language
Hypertext Markup Language is the standard markup language for documents designed to be
displayed in a web browser. It can be assisted by technologies such as Cascading Style Sheets and
scripting languages such as JavaScript
Note HTML is the standard markup language for creating Web pages.
History of HTML
Since the early days of the World Wide Web, there have been many versions of HTML:
Year Version
Note. if you want to define your document as HTML5 the you need to put <!DOCTYPE html> before
html tag. Since HTML5 is the latest version up to this writing, we will be using this tag going forward.
o To close a tag, simply write it again, but place a slash in front of it, as the example above
clearly illustrates.
3. There are distinct sections to an HTML document
o The opening and closing HTML tags are mandatory
o The <HEAD> and </HEAD> tags (and everything between them) are customary, but not
mandatory
o The <BODY> and </BODY> tags are also mandatory - since this is the bit that is
displayed on your screen. Without a BODY, there is nothing to display.
HTML tags are the hidden keywords within a web page that define how your web browser must format
and display the content. Most tags must have two parts, an opening and a closing part. ... Note that the
closing tag has the same text as the opening tag, but has an additional forward-slash ( / ) character
HTML Editors
A simple text editor is all you need to learn HTML.
You can use
Notepad
Notepad++
Context
Visual Studio
Visual Studio Code
Note. Since a simple editor is all you need, I recommend Notepad++ or Context as they support color
coding styles in web designing.
Your first HTML Program
Step 1. Type the code below in either Notepad, Notepad++ or Context.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
Code explanation
The <title> element specifies a title for the HTML page (which is shown in the browser's title bar
or in the page's tab)
The <body> element defines the document's body, and is a container for all the visible contents,
such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
Step 2. Create a directory in your desktop and name it html. In the html folder, save the program as
code.html. Make sure that you put .html as the file extension.
Note. you can save your html code in any path or directory in your computer. We will put all our codes to
this folder going forward.
Step 3. Verify that the code.html file icon is showing a web icon, depending on your default browser.
Here I am using chrome as my default browser that’s why the file icon is showing the chrome browser
icon.
Step 4. To see the output, double click the file. It will show the program in the browser as shown in the
screenshot below.
Explanation. As you can see in the screenshot below, data in the title tag shows in the title bar of your
browser. And data you put in your body tag is shown in the body of the browser.
HTML Elements
An HTML element is defined by a start tag, some content, and an end tag:
The HTML element is everything from the start tag to the end tag as shown in the screenshot below
Note: Some HTML elements have no content (like the <br> element). These elements are called empty
elements. Empty elements do not have an end tag!
HTML contains several elements for defining text with a special meaning.
Tag Description
<h?>….</h?> Heading (?= 1 for largest to 6 for smallest, example h1)
HTML headings are titles or subtitles that you want to display on a webpage.
HTML headings are defined with the <h1> to <h6> tags.
<h1> defines the most important heading. <h6> defines the least important
heading.
<b>…</b> Bold text
<i>…</i> Italic text
<u> ... </u> Underline Text
<strike> ... </strike> Strikeout
<sup> ... </sup> Superscript - Smaller text placed below normal text
<sub> ... </sub> Subscript - Smaller text placed below normal text
<blockquote> ...
Text Block Quote
</blockquote>
<strong> ... </strong> Strong - Shown as Bold in most browsers
<em> ... </em> Emphasis - Shown as Italics in most browsers
<font> ... </font> Font tag obsolete, use CSS instead
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as test2.html
3.Preview your HTML work using your browser
<!DOCTYPE html>
<html>
<head>
<title>Text Heading and Formatting</title>
</head>
<body>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
Note: Use HTML headings for headings only. Don't use headings to make text BIG or bold.
Output
Note.
<p> - to markup a section of text as a paragraph
<br> - means line break. It will display the data in the new line without starting a new paragraph
So if you want to display the data with 5 spaces in between, then you have to put
<br><br><br><br><br>
So what if you don’t want to use <br> or <p> tags? And you want to display the data based on how you
entered it. Then use <pre> tag
Example.
1.Create a document in your text editor.
2.Type the code as shown below and save it as test3.html
3.Preview your HTML work using your browser
Department: DCE
Schedule: every Tuesday at 1-5pm.
</pre>
</body> </html>
Output. You will notice that even if you did not put <p> or <br> tags, the data is displaying based on
how you type the code, as shown in the screenshot below.
Overlapping of Tags
Overlapping of tags is not allowed in writing HTML document as shown below. Take note of the
<b> beginning and </b> end tag. Here all elements are in bold. (unless you want all elements to
be in bold). So it means that when you forget to close a tag, it will have an effect in all of your
elements below that tag.
Example.
1.Create a document in your text editor.
2.Type the code as shown below and save it as sections.html
Explanation. As shown in the screenshot below, if you want to put a line in your web design, then you put
hr tag with attributes of red color, align in the center, and with the thickness of 5 (size = 5). Other tags,
please check section divisions table for details.
Preview your work again in the browser, and now you can see the background color as green.
Note.
In the code, <body bgcolor="green"> , body is your tag, and bgcolor is called attributes which
value is green. It means that the background color of your html document is green. You can have
color value as RGB if you want to.
Notice the attribute value is enclosed with double quotation. In html, you can also put the value
without the double quotation.
Background image
Step 1. In your html folder, put any png, jpg, gif file you want. If you don’t have one that just search it in
your browser.
Note. Welcome to ABC College text is not showing properly because of the background image. For it to
be visible, we need to change the color of the text. See CSS lesson, HTML COLORS for more details.
HTML Entities
Reserved characters in HTML must be replaced with character entities.
If you use the less than (<) or greater than (>) signs in your text, the browser might mix them with
tags.
Some Other Useful HTML Character Entities
Summary
This lesson covers the fundamentals of HTML, including the idea of elements and attributes and ways of
formatting the text using HTML tag.
The examples help you better understand the topics discussed in this lesson, which guides you in web
designing using HTML.
Lesson Objectives:
At the end of this lesson, you will be able to:
Understand the fundamentals of using tables and its corresponding attributes as well as the
process of creating lists in designing your web application.
Discussions
HTML offers three ways for specifying lists of information. All lists must contain one or more list
elements.
Tag Description
<ul> − An unordered list. This will list items using plain bullets.
<ol> − An ordered list. This will use different schemes of numbers to list your items.
<dl> − A definition list. This arranges your items in the same way as they are arranged in a
dictionary.
You can use type attribute for <ul> tag to specify the type of bullet you like. By default, it is a disc.
Following are the possible options –
Value Description
Example:
1.Create a document in your text editor.
2.Type the code as shown below and save it as list1.html
3.Preview your HTML work using your browser
Output
Output:
Type Description
type="I" The list items will be numbered with uppercase roman numbers
type="i" The list items will be numbered with lowercase roman numbers
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as list3.html
3.Preview your HTML work using your browser
<li>Milk</li>
</ol>
</body> </html>
Output:
Tables
The HTML tables allow web authors to arrange data like text, images, links, other tables, etc. into rows
and columns of cells.
Tag Description
<col> Specifies column properties for each column within a <colgroup> element
The HTML tables are created using the <table> tag in which the <tr> tag is used to create table rows
and <td> tag is used to create data cells. The elements under <td> are regular and left aligned by default
Example
1.Create a document in your text editor and type the code as shown below and save it as table1.html
3.Preview your HTML work using your browser
Output
Here, the border is an attribute of <table> tag and it is used to put a border across all the cells. If you do
not need a border, then you can use border = "0".
Table Heading
Table heading can be defined using <th> tag. This tag will be put to replace <td> tag, which is used to
represent actual data cell. Normally you will put your top row as table heading as shown below, otherwise
you can use <th> element in any row. Headings, which are defined in <th> tag are centered and bold by
default.
Example.
1.Create a document in your text editor and type the code as shown below and save it as table2.html
2.Preview your HTML work using your browser
Output
Explanation
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as table3.html
3.Preview your HTML work using your browser
Output
Here, the cellpadding = 5 and cellspacing=5 is the white space between the table cells. Try to put a bigger
number as well as smaller number to check the effect.
Output
Tables Backgrounds
You can set table background using one of the following two ways −
bgcolor attribute − You can set background color for whole table or just for one cell.
background attribute − You can set background image for whole table or just for one cell.
You can also set border color also using bordercolor attribute.
Note − The bgcolor, background, and bordercolor attributes deprecated in HTML5. Do not use these
attributes.
Example.
Modify table4.html by adding a bgcolor = “green” to the table attribute, as shown in the red underline
below
The table should be in green background color, as shown in the screenshot below.
Putting image as background in the table. Modify above program, delete the bgcolor attribute and replace
it with background attribute as shown in red box below.
The table should now have the logo.png as background as shown in the screenshot below. Note that that
logo.png should be inside the images folder.
Example. Modify the above web page by adding width and height on the table attributes as shown in red
box below
When you open the web page in the browser, you can now see that the changes in table width and height
as shown in the screenshot below
A table may contain several <tbody> elements to indicate different pages or groups of data. But it is
notable that <thead> and <tfoot> tags should appear before <tbody>
Example. Type the code below.
1.Create a document in your text editor.
2.Type the code as shown below and save it as table5.html
3.Preview your HTML work using your browser
<title>HTML Table</title>
</head> <body> <table border="1" width="100%">
<thead> <tr>
<td colspan="4"> <center>ABC College Portal</center></td>
</tr> </thead> <tfoot> <tr>
<td colspan="4"><center>Copyright 2020</center></td>
</tr> </tfoot> <tbody>
<tr> <td><center>Home<center></td>
<td><center>Course<center></td>
<td><center>About Us<center></td>
<td><center>Contact Us<center></td>
</tr> <tr height="200px">
<td colspan="4"> Welcome to ABC College </td>
</tr> </tbody> </table> </body> </html>
Output
SUMMARY
This lesson covers the fundamentals of web design using tables and list. Tables and list are very important
tags in HTML as they are giving you a way to arrange your data using tables and display items using lists.
The examples help you better understand the topics discussed in this lesson, which guides you on useful
tips and important notes in web designing using HTML tables and lists.
Lesson Objectives:
At the end of this lesson, you will be able to:
Understand the fundamentals of using text link and image links in designing your web
application.
Understand how to incorporate video and audio files in your web page.
Discussions
Linking Documents
A link is specified using HTML tag <a>. This tag is called anchor tag and anything between the opening
<a> tag and the closing </a> tag becomes part of the link and a user can click that part to reach to the
linked document.
Following is the simple syntax to use <a> tag.
Example
Let's try following example which links https://www.google.com at your page –
1.Create a document in your text editor.
2.Type the code as shown below and save it as link1.html
3.Preview your HTML work using your browser
Output
Click the link. It will open the google web site as shown below.
Note. if you are not connected to the internet then you will see output as shown below
Output
When you click the link1, it will redirect your page to the link1.html
Attribute Description
_top Opens the linked document in the full body of the window.
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as link3.html
Note. Click each link, and you will notice where the browser will open the links.
Output
When you mouseover the logo,you will seethe “Clickk me to g to NASA website”. When you click the
logo,it will open the NASA website as per specified in the<a href>.
HTML Email Links
It is not difficult to put an HTML email link on your webpage but it can cause unnecessary spamming
problem for your email account. There are people, who can run programs to harvest these types of emails
and later use them for spamming in various ways.
Click Joe Young and it will open your mail, depending on your email provider as shown below. Note,
here i am using Outlook.
HTML Media
Multimedia comes in many different formats. It can be almost anything you can hear or see, like
images, music, sound, videos, records, films, animations, and more.
Web pages often contain multimedia elements of different types and formats.
Multimedia Formats
Multimedia elements (like audio or video) are stored in media files.
The most common way to discover the type of a file, is to look at the file extension.
Multimedia files have formats and different extensions like: .wav, .mp3, .mp4, .mpg, .wmv, and .avi.
HTML Video
The HTML <video> element is used to show a video on a web page.
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as video1.html
3.Preview your HTML work using your browser
Explanation
HTML AUDIO
The HTML <audio> element is used to play an audio file on a web page.
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as audio1.html
3.Preview your HTML work using your browser
Summary
This lesson covers the fundamentals of using links and media tags. Link is one of the keys of HTML
designing as it allows the user to navigate to different html pages. Without links, HTML will not be as
good as what you have today.
Also, in this lesson you learned how to incorporate HTML media in your web pages. HTML Media is
making the web more interesting in ways that you can insert video or audio in your web page.
Lesson Objectives:
At the end of this lesson, you will be able to:
Understand the fundamentals of using form and its corresponding attributes in designing your
web application.
Discussions
HTML Forms
HTML Forms are required, when you want to collect some data from the site visitor. For example,
during user registration you would like to collect information such as name, email address, contact
number, age, among other things. In short, an HTML form is used to collect user input.
A form will take input from the site visitor and then will post it to a back-end application such as
ASP.Net, Java Servlet, CGI, ASP Script or PHP script etc. The back-end application will perform
required processing on the passed data based on defined business logic inside the application.
Form Attributes
Apart from common attributes, following is a list of the most frequently used form attributes –
Attribute Description
method Method to be used to upload data. The most frequently used are GET and POST
methods.
target Specify the target window or frame where the result of the script will be displayed. It
takes values like _blank, _self, _parent etc.
encytype You can use the enctype attribute to specify how the browser encodes the data before it
sends it to the server. Possible values are −
application/x-www-form-urlencoded − This is the standard method most forms use in
simple scenarios.
mutlipart/form-data − This is used when you want to upload binary data in the form of
files like image, word file etc.
Tag Description
This is also a single-line text input but it masks the character as soon as a user enters it. They are also
created using HTML <input>tag but type attribute is set to password.
Attributes
Following is the list of attributes for <input> tag and <password> tag
Attribute Description
type Indicates the type of input control and for password input control it will be set
to password. and for text input control it will be set to text
name Used to give a name to the control which is sent to the server to be recognized and get the
value.
value This can be used to provide an initial value inside the control.
size Allows to specify the width of the text-input control in terms of characters.
maxlengt Allows to specify the maximum number of characters a user can enter into the text box.
h
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as form1.html
3.Preview your HTML work using your browser
Output
Here, you will notice the length of the username is longer than the other input box. This is because of the
size attribute. If you want to limit the number of characters that the user enters then you can use the
maxlength attribute. So here for username, you can only enter 15 characters, while you can only enter 10
characters for password.
Attributes
Attribute Description
s
name Used to give a name to the control which is sent to the server to be recognized and
get the value.
Example. Modify the form1.html by adding the code in red box below
Output:
So here, you can now see the comments box. This is prevalent in most web sites where user can enter
his/her comments or suggestions.
Checkbox Control
Checkboxes are used when more than one option is required to be selected. They are also created using
HTML <input> tag but type attribute is set to checkbox..
Attributes
Following is the list of attributes for <checkbox> tag.
Attribute Description
s
Type Indicates the type of input control and for checkbox input control it will be set
to checkbox..
name Used to give a name to the control which is sent to the server to be recognized
and get the value.
Attributes
Following is the list of attributes for radio button.
Attributes Description
type Indicates the type of input control and for checkbox input control it will be set to
radio.
name Used to give a name to the control which is sent to the server to be recognized and
get the value.
value The value that will be used if the radio box is selected.
Example
1.Create a document in your text editor.
2.Type the code as shown below and save it as form2.html
3.Preview your HTML work using your browser
Here, you can only select one because you use the input type radio
Name Used to give a name to the control which is sent to the server to be recognized and get the
value.
multiple If set to "multiple" then allows a user to select multiple items from the menu.
Following is the list of important attributes of <option> tag for Select Box Control
value The value that will be used if an option in the select box box is selected.
selected Specifies that this option should be the initially selected value when the page loads.
Output
name Used to give a name to the control which is sent to the server to be recognized and get the
value.
Output
Button Controls
There are various ways in HTML to create clickable buttons. You can also create a clickable button using
<input>tag by setting its type attribute to button. The type attribute can take the following values
reset This creates a button that automatically resets form controls to their initial values.
button This creates a button that is used to trigger a client-side script when the user clicks that button.
image This creates a clickable button but we can use an image as background of the button.
Output:
Note. the submit button is not showing the image. The reason is that you have logo.png in your images
folder.
Hidden Form Controls
Hidden form controls are used to hide data inside the page which later on can be pushed to the server.
This control hides inside the code and does not appear on the actual page. For example, following hidden
form is being used to keep current page number. When a user will click next page then the value of
hidden control will be sent to the web server and there it will decide which page will be displayed next
based on the passed current page.
Example.
1.Create a document in your text editor.
2.Type the code as shown below and save it as form3.html
3.Preview your HTML work using your browser
Output:
SUMMARY
This lesson covers all the fundamentals of HTML forms. The examples shown helps you better
understand the topics discussed in this lesson, which guides you on useful tips and important notes in web
designing using HTML forms.
Lesson Objectives:
At the end of this lesson, you will be able to:
Understand the fundamentals of CSS, including the idea of selectors, methods of setting colors
and backgrounds, way of formatting fonts and text, styling UI elements, etc…
Discussions
CSS handles the look and feel part of a web page. Using CSS, you can control the color of the text,
the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what
background images or colors are used, layout designs, variations in display for different devices and
screen sizes as well as a variety of other effects.
Advantages of CSS
CSS saves time − You can write CSS once and then reuse same sheet in multiple HTML pages. You
can define a style for each HTML element and apply it to as many Web pages as you want.
Pages load faster − If you are using CSS, you do not need to write HTML tag attributes every time.
Just write one CSS rule of a tag and apply it to all the occurrences of that tag. So less code means
faster download times.
Easy maintenance − To make a global change, simply change the style, and all elements in all the
web pages will be updated automatically.
Superior styles to HTML − CSS has a much wider array of attributes than HTML, so you can give
a far better look to your HTML page in comparison to HTML attributes.
Multiple Device Compatibility − Style sheets allow content to be optimized for more than one type
of device. By using the same HTML document, different versions of a website can be presented for
handheld devices such as PDAs and cell phones or for printing.
Global web standards − Now HTML attributes are being deprecated and it is being recommended
to use CSS. So its a good idea to start using CSS in all the HTML pages to make them compatible to
future browsers.
CSS Syntax
A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding
elements in your document. A style rule is made of three parts −
Selector − A selector is an HTML tag at which a style will be applied. This could be any tag like
<h1> or <table> etc.
Property − A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are
converted into CSS properties. They could be color, border etc.
Value − Values are assigned to properties. For example, color property can have value
either red or #F1F1F1 etc.
Example:
Here table is a selector and border is a property and given value 1px solid #C00 is the value of that
property.
Example
1. Create a document in your text editor and type the code as shown below and save it as css1.html.
2. Preview your HTML work using your browser
Explanation: all <p> elements will be center-aligned, with a cyan text color and font size of 50px.
CSS Selectors
CSS selectors are used to "find" (or select) the HTML elements you want to style.
CSS Selectors
1. Element or Type selectors
The element selector selects HTML elements based on the element name. css1.html is an example
of element or type selectors
2. ID Selector
The id selector uses the id attribute of an HTML element to select a specific element. The id of an
element is unique within a page, so the id selector is used to select one unique element! To select
an element with a specific id, write a hash (#) character, followed by the id of the element.
Example
1.Create a document in your text editor. Type the code as shown below and save it as css2.html
2.Preview your HTML work using your browser
Output in red box below. The CSS rule below will be applied to the HTML element with id="red". Since
you use the id red in p tag as shown in the below, the element Calamba font color is red.
text-align: left;
color: red;
}
.blue {
text-align: center;
color: blue;
}
p.center {
text-align: center;
color: red;
}
</style>
</head> <body>
<p class="red">Calamba</p>
<p class="blue">Laguna</p>
<p class="center">This paragraph will be red and center-aligned.</p>
</body>
</html>
Output in green box below. The CSS rule below will be applied to the HTML element with class red and
blue.
You can also specify that only specific HTML elements should be affected by a class like what you have
below for p.center.
*{ color: #000000;
}
This rule renders the content of every element in our document in black.
Example
1. Create a document in your text editor. Type the code as shown below and save it as css4.html
2. Preview your HTML work using your browser
Output in green box below. The CSS rule below will affect every HTML element on the page
ul em {
color: #000000;
}
1. Inline Styles – An inline CSS is used to apply a unique style to a single HTML element. An inline
CSS uses the style attribute of an HTML element.
2. Internal Style Sheet - Internal styles are defined within the <style> element, inside the <head>
section of an HTML page.
3. External Style Sheet - Each page must include a reference to the external style sheet file inside the
<link> element.
Output in green box below. Also in the output below, you can see the h1 element with style attribute.
This denotes inline CSS. So the <h1> element will be set to red with font size to 90 and <p> element to
black.
color: black; }
</style> </head> <body>
<h1>Calamba</h1>
<p>Laguna</p>
</body> </html>
Output in green box below. You can see that the css is inline because it is is defined in the <head>
section of an HTML page, within a <style> element
mycss.css code
myExternal.html code
Another example. You can use external css available in the internet.
1. Create a document in your chosen editor.
2. For HTML, type the code as shown below and save it as myExternal2.html
3. Preview your HTML work using your browser
<div class="form-group">
<label for="password">Password:</label>
<input type="password" class="form-control" id="pwd" name="password">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form> </div>
</body> </html>
So here, the href link is in the internet. If you don’t have internet then you cannot see the output.
Output:
SUMMARY
This lesson covers the fundamentals of CSS, including the idea of selectors, methods of setting colors and
backgrounds, way of formatting fonts and text and styling UI elements. The examples given help you
better understand the topics discussed in this lesson, which guides you on the useful tips and important
notes in web designing using CSS.
Lesson 7. Bootstrap
Lesson Objectives:
At the end of this lesson, you will be able to:
Understand the features of Bootstrap framework, starting with the basics, such as grid system,
typography styling mechanism, form styling methods, as well as, techniques of styling common
user interface elements like tables, lists as well as carousels, among other things.
Discussions
What is Bootstrap?
Bootstrap is a powerful front-end framework for faster and easier web development. It includes
HTML and CSS based design templates for creating common user interface components like
forms, buttons, navigations, dropdowns, alerts, modals, tabs, accordions, carousels, tooltips, and
so on.
Bootstrap gives you ability to create flexible and responsive web layouts with much less efforts.
Bootstrap was originally created by a designer and a developer at Twitter in mid-2010. Before
being an open-sourced framework, Bootstrap was known as Twitter Blueprint.
History
Bootstrap was developed by Mark Otto and Jacob Thornton at Twitter. It was released as an open source
product in August 2011 on GitHub.
What is Responsive Web Design?
Responsive web design is about creating web sites which automatically adjust themselves to look
good on all devices, from small phones to large desktops.
Mobile first approach − Bootstrap 3, framework consists of Mobile first styles throughout the
entire library instead them of in separate files.
Browser Support − It is supported by all popular browsers.
Easy to get started − With just the knowledge of HTML and CSS anyone can get started with
Bootstrap. Also the Bootstrap official site has a good documentation.
Responsive design − Bootstrap's responsive CSS adjusts to Desktops, Tablets and Mobiles.
More about the responsive design is in the chapter Bootstrap Responsive Design.
Provides a clean and uniform solution for building an interface for developers.
It contains beautiful and functional built-in components which are easy to customize.
It also provides web-based customization.
And best of all it is an open source.
Applications of Bootstrap
Scaffolding − Bootstrap provides a basic structure with Grid System, link styles, and
background.
CSS − Bootstrap comes with the feature of global CSS settings, fundamental HTML elements
styled and enhanced with extensible classes, and an advanced grid system
Step 2. Click the Download button. You will see the screen below
Step 3. Click the download button. In your download folder, you can see a zip file as below
<div class="jumbotron">
<h1>Welcome to ABC College</h1>
</div>
<div class="container">
<h2>Login</h2>
<form>
<div class="form-group">
<label for="user">Username:</label>
<input type="text" class="form-control" id="usr" name="username">
</div>
<div class="form-group">
<label for="password">Password:</label>
<input type="password" class="form-control" id="pwd" name="password">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div> </body> </html>
In this code, you will notice the href of the stylesheets, which is under folder css and the file is
bootstrap.min.css.
If you see the output below, then it means that you have set-up your bootstrap properly.
If you see the output below, then either you did not download the bootstrap properly or the directory is
not ok.
If this is the case, make sure you have the following files on the same directory.
Bootstrap CDN
If you don't want to download and host Bootstrap yourself, you can include it from a CDN (Content
Delivery Network).
MaxCDN provides CDN support for Bootstrap's CSS and JavaScript. You must also include jQuery:
You can do this by replacing
span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1 span 1
span 4 span 8
span 6 span 6
span 12
The grid system is responsive, and the columns will re-arrange automatically depending on the screen
size.
Make sure that the sum adds up to 12 or fewer (it is not required that you use all 12 available
columns).
Responsive web design is a process of designing and building websites to provide better accessibility and
optimal viewing experience to the user by optimizing it for different devices.
With the growing trend of smart phones and tablets, it has become almost unavoidable to ignore the
optimization of sites for mobile devices. Responsive web design is a preferable alternative and an
efficient way to target a wide range of devices with much less efforts.
Responsive layouts automatically adjust and adapts to any device screen size, whether it is a desktop, a
laptop, a tablet, or a mobile phone. See the following Illustration.
Example.
1. Create a document in your text editor.
2. Type the code as shown below and save it as BootsrapResponsive.html
3. Preview your HTML work using your browser
<div class="container">
<div class="jumbotron">
<h1>Welcome to ABC College</h1>
<p class="lead">
ABC College is blah blah blah blah blah . At <a href="http://abccollege.com"
target="_blank">ABC College</a>
you will learn the essential of programming.
</p>
<p><a href="https://www.abccollege.com" target="_blank" class="btn btn-success btn-
lg">Contact Us</a></p>
</div>
<div class="row">
<div class="col-md-6 col-lg-4 col-xl-3">
<h2>HTML</h2>
<p>HTML is the standard markup language for describing the structure of the web pages. Our
HTML tutorials will help you to understand the basics of latest HTML5 language..</p>
<p><a href="https://www.abccollege.com/html-tutorial/" target="_blank" class="btn btn-
success">Learn More »</a></p>
</div>
<div class="col-md-6 col-lg-4 col-xl-3">
<h2>CSS</h2>
<p>CSS is used for describing the presentation of web pages. CSS can save a lot of time and
effort. Our CSS tutorials will help you to learn the essentials of latest CSS3</p>
<p><a href="https://www.abccollege.com/css-tutorial/" target="_blank" class="btn btn-
success">Learn More »</a></p>
</div>
Bootstrap - Table
Bootstrap provides a clean layout for building tables. Some of the table elements supported by Bootstrap
are.
Tag Description
<thead> Container element for table header rows (<tr>) to label table columns.
<tbody> Container element for table rows (<tr>) in the body of the table.
<tr> Container element for a set of table cells (<td> or <th>) that appears on a single row.
<th> Special table cell for column (or row, depending on scope and placement) labels. Must be
used within a <thead>
Example
1. Create a document in your text editor.
2. Type the code as shown below and save it as BootstrapTable.html
3. Preview your HTML work using your browser
<th>Email</th>
</tr> </thead> <tbody>
<tr>
<td>1</td>
<td>Jose</td>
<td>Rizal</td>
<td>[email protected]</td>
</tr> <tr>
<td>2</td>
<td>John</td>
<td>Joe</td>
<td>[email protected]</td>
</tr> <tr>
<td>3</td>
<td>Kurt</td>
<td>Russ</td>
<td>[email protected]</td>
</tr> </tbody> </table> </div> </body> </html>
Output
Example
1. Create a document in your text editor.
2. Type the code as shown below and save it as BootstrapNav.html
3. Preview your HTML work using your browser
Output:
Example
1. Create a document in your text editor.
2. Type the code as shown below and save it as BootstrapButton.html
3. Preview your HTML work using your browser
</div>
</body> </html>
Output
<div class="card-body">
<p>Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier
web development.<a href="https://www.abc.com/twitter-bootstrap-tutorial/" target="_blank">Learn
more.</a></p>
</div> </div> </div>
<div class="card">
<div class="card-header" id="headingThree">
<h2 class="mb-0">
<button type="button" class="btn btn-link collapsed" data-toggle="collapse" data-
target="#collapseThree">3. What is CSS?</button>
</h2> </div>
<div id="collapseThree" class="collapse" aria-labelledby="headingThree" data-
parent="#accordionExample">
<div class="card-body">
<p>CSS stands for Cascading Style Sheet. CSS allows you to specify various style properties for a given
HTML. <a href="https://www.abc.com/css-tutorial/" target="_blank">Learn more.</a></p>
</div> </div> </div> </div> </div> </body> </html>
Output
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<style>
.carousel {
background: #2f4357;
margin-top: 20px; }
.carousel-item {
text-align: center;
min-height: 280px; /* Prevent carousel from being distorted if for some reason image doesn't load
*/
}
</style> </head> <body>
<div class="container-lg my-3">
<div id="myCarousel" class="carousel slide" data-interval="3000" data-ride="carousel">
<!-- Carousel indicators -->
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<li data-target="#myCarousel" data-slide-to="1"></li>
<li data-target="#myCarousel" data-slide-to="2"></li>
</ol>
<!-- Wrapper for carousel items -->
<div class="carousel-inner">
<div class="carousel-item active">
<img src="images/logo.png" width="100px" height="50px" alt="First Slide">
<div class="carousel-caption d-none d-md-block">
<h5>First slide label</h5>
<p>this is first slide.</p>
</div> </div>
<div class="carousel-item">
<img src="images/logo.png" width="100px" height="50px" alt="Second Slide">
Code explanation
The Bootstrap carousel has basically three components — carousel indicators (small circles), carousel
controls (previous and next arrows) and the carousel items or slides.
The outermost container of every carousel requires a unique id (in our case id="myCarousel") so that it
can be targeted by the carousel and carousel controls to function properly.
The data-ride="carousel" attribute of the .carousel element tells the Bootstrap to start animating the
carousel immediately when the page load. Whereas the data-interval attribute specifies the time delay
between two slides.
The .data-slide-to attribute move the slide position to a particular item (index beginning with 0) when
clicking on the specific carousel indicator.
The slides are specified within the .carousel-inner and the content of each slide is defined within
the .carousel-item element that can be text and images.
The data-slide attribute on carousel controls accepts the keywords prev or next, which alters the slide
position relative to its current position.
Rest of the thing is self explanatory, such as the .carousel element specifies the Bootstrap carousel,
the .carousel-indicators element indicates how many slides are there in the carousel and which slide is
currently active, the .carousel-caption element used within the .carousel-item element defines the caption
for that slide etc.
Tip: It is required to add the class .active to one of the slides (i.e. on the .carousel-item element).
Otherwise, the carousel will not be visible.
Note: The .slide class on the .carousel element adds CSS slide transition animation to the carousel that
makes the carousel items slide when showing the new item.
Output
Summary
This lesson covers the fundamentals of Bootstrap framework, starting with the basics, such as grid
system, typography styling mechanism, form styling methods, as well as, techniques of styling common
user interface elements like tables, lists as well as carousels, etc.. The examples help you better
understand the topics discussed in this lesson, which guides you on the useful tips and important notes in
web designing using Bootstrap.