Professional Documents
Culture Documents
CS Fundamentals2-Module 3
CS Fundamentals2-Module 3
This course deals with the principles and practices of e-learning and web development. It develops
students’ knowledge and skills in technological and technical field of specialization. It envisages the
concept of Internet with web browser and internet services with an overview of WWW and its basic
components. It also elaborates the process, such as planning, designing, creating and framework in
building websites. It emphasizes the protocol on web building and to work with HTML, XHTML and CSS in
dealing with tags, fonts, color, list, links and images and others.
The course equips the students with competencies and opportunities for getting information on matters
related to academic and professional of web designing and application of the latest developments in the
specific field of practice to promote quality of work life.
Learning Outcomes
Skills:
Values:
✔ Appreciate the importance of web development for the academic and professional opportunities.
Course Outline
Page | 1
2.1 Overview of HTML Form
2.2 Form Tags
HTML 5 Overview
⮚ HTML5 is the new standard for HTML.
⮚ HTML5 is designed to deliver almost everything you want to do online without requiring
additional plugins. It does everything from animation to apps, music to movies, and can
also be used to build complicated applications that run in your browser.
⮚ HTML5 is also cross-platform (it does not care whether you are using a tablet or a
⮚ Programming languages like PHP or Java use things like logic and conditions to control
the content.
⮚ HTML has gone through several versions, each of which expands the capabilities of
HTML. After HTML 4.01, the W3C pushed XHTML as the next standard. Currently,
HTML5 is in use.
W3C(World Wide Web Consortium) – is the organization created the HTML and CSS and
responsible for shepherding the development of web standards.
WHATWG(Web Hypertext Application Technology Working Group)-another organization
developing most of the HTML5 specification.
Page | 2
Differences between HTML4 and HTML5
Multimedia Language in HTML does not have support HTML5 supports both video and
support for video and audio. audio.
Storage The HTML browser uses cache memory as HTML5 has the storage options
temporary storage. like:application cache, SQL
database, and web storage.
Browser HTML is compatible with almost all In HTML5, we have many new tags,
compatibility browsers because it has been present for elements, and some tags that have
a long time, and the browser made been removed/modified, so only
modifications to support all the features. some browsers are fully compatible
with HTML5.
Graphics support In HTML, vector graphics are possible In HTML5, vector graphics are
with tools Like Silver light, Adobe Flash, supported by default.
VML, etc.
Storage Uses cookies to store data. Uses local storage instead of cookies
Vector and Vector graphics are possible with the help Vector graphics is an integral part
Graphics of technologies like VML, Silverlight, of HTML5, SVG and canvas.
Flash,etc.
Doc type Doctype declaration in html is too long The DOCTYPE declaration in html5 is
<! DOCTYPE HTML PUBLIC "- // W3C // very simple "<! DOCTYPE html>
DTD HTML 4.01 // EN"
"http://www.w3.org/TR/html4/strict.dtd"
>
Multimedia Audio and video are not the part of Audio and video are essential parts
support HTML4. of HTML5,like: <Audio>, <Video>.
Page | 3
<audio>
<video>
Page | 4
New Semantic/Structural Elements
Tag Description
Tag Description
Defines an explanation/pronunciation of
<rt>
characters (for East Asian typography)
Tag Description
Page | 5
<header> Defines a header for a document or section
2. Navigation <nav>-
<header role=”banner”>
<nav role=”navigation”>
<ul>
<li> Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</header>
3. Article
<article>
<h1> Home</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euism
od tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
Page | 6
<h1> About</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euism
od tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis ni
sl ut aliquip ex ea commodo consequat.
</p>
<h1> Contact</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euism
od tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis ni
sl ut aliquip ex ea commodo consequat.
</p>
</article >
4. Aside
<aside>
<h1> Why Choose our Website?</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euism
od tincidunt ut laoreet dolore magna aliquam erat volutpat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis ni
sl ut aliquip ex ea commodo consequat.
</p>
</aside>
5. Footer
<footer>
<p> This is a footer</p>
</footer>
Div - <div> was the de facto choice for surrounding chunks of content such as
pages’ header, footer,main content sidebars and etc. It is a generic container, one
without any semantic meaning at all.You can applu the desired style or JavaScript.
Page | 7
<div class="container">
<header role=”banner”>
<nav role=”navigation”>
<ul>
<li> Home</li>
<li>About</li>
<li>Contact</li>
</ul>
</nav>
</header>
<article>
<h1> Home</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod
tincidunt ut laoreet dolore magna aliquam erat volutpat. </p>
<h1> About</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt
ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci
tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod
tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud
exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod
tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud
exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>
<h1> Contact</h1>
<p>
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl
ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam,
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl
ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam,
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl
ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl
ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl
ut aliquip ex ea commodo consequat.Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>
</article >
<div class="sidebar">
<aside>
<h1> Why Choose our Website?</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh
euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam,
quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
</p>
</aside>
</div>
<footer>
Page | 8
1. SGV(Scalable Vector Graphics)
The HTML <svg> element is a container for SVG graphics.
SVG has several methods for drawing paths, boxes, circles, text, and graphic images.
<!DOCTYPE html>
<html>
<body>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40"
stroke="green" stroke-width="4" fill="blue" />
Sorry, your browser does not support inline SVG.
</svg>
</body>
</html>
Output:
2. Canvas
The HTML <canvas> element is use to draw graohics, on the
fly,via Javascript.An element as a container for graphics and
JavaScript is used to actually draw the graphics.
Removed Elements
Page | 9
• window.localStorage - stores data with no expiration date
• window.sessionStorage - stores data for one session (data is lost when the browser
tab is closed)
Pre-Requisite:
The following are the basic pre-requisite for starters in building websites.
1. Text Editor(Sublime, Notepad ++ ,VS Code)
2. Web Page
A. Identification
1. What organization created HTML and CSS in the first place?
2. True/False. HTML (previous versions) is more compatible with almost all browser.
3. How do you declare the Doc Type in HTML 5?
4. An element that defines the content aside from the page content.
5. How do you declare the character encoding in HTML5?
B. Multiple Choice
1. What are the types of web storage for storing data on the client? Select All That Applies.
A. window.localStorage
B. window.serverStorage
C. window.sessionStorage
D. window.clientStorage
2. Path boxes, shapes and graphic images can be created through what element. All That
Applies.
A. <graphic>
B. <svg>
C. <canvas>
3. What HTML Tag that serve as a container an no semantic meaning on it?
A. <header>
B. <div>
C. <svg>
C. Output
1. Using HTML 5 create one shape (except circle) and display it to the browser.
Your answer must be the code and the screenshot of the output on your browser. 10 pts.
Ex: CODE
<!DOCTYPE html>
<html>
<body>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40"
stroke="green" stroke-width="4" fill="blue" />
Sorry, your browser does not support inline SVG.
</svg>
</body>
</html>
2. The picture shows the basic HTML5 visual outline. Identify what element should be used
on each number. 5pts
Page | 10
Reference
https://www.tutorialspoint.com/e_commerce/e_commerce_business_models.htm
Learning Compass
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
Page | 11
HTML HEADINGS
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Alice in Wonderland</title>
</head>
<body>
<h1>Alice is sitting on a bench with her sister </h1>
<h2>Suddenly , a white rabbit passes by,</h2>
<h3>Checking his watch and lamenting that he's going to be late</h3>
<h4>Alice follows the rabbit down the hole</h4>
<h5>Where she finds a bottle with note saying "drink me" </h5>
<h6>She drinks it and finds herself shrinking</h6>
</body>
</html>
Note! The attribute “align” is no longer supported and is replaced by “text-align” property in
CSS
Output:
Page | 12
Output:
Quick Exercise:
Which is the output of the following code? The first one or the second one?
<!DOCTYPE html>
<html>
<head
<meta charset="UTF-8">
<title>Lorem Ipsum</title>
</head>
<body>
WELCOME TO E-LEARNING AND WEB DEVELOPMENT SUBJECT
<!-- this is a greeting!!!!!!!!-->
Page | 13
</body>
</html>
The comment tag is used to insert a comment in the HTML source code. It can be placed
anywhere in the document and the browser will ignore everything inside the brackets.
<!DOCTYPE html>
<!-- tells the browser program what type and flavor of HTML is being used -->
<html>
<head> <!-- documents header -->
<meta charset="UTF-8"> <!-- how the characters are translated into numbers and stored in the file -->
<title>Document</title>
</head>
<body> <!-- where we put majority of the code -->
</body>
</html>
Output:
Page | 14
Other character entities
<h1 style="background-color:Tomato; text-align: center;">What's My Color</h1>
<h1 style="background-color:Orange;">HTML BACKGROUND COLORS</h1>
<h1 style="background-color:DodgerBlue;">HTML BACKGROUND COLORS</h1>
<h1 style="background-color:MediumSeaGreen;">HTML BACKGROUND COLORS</h1>
<h1 style="background-color:Gray;">HTML BACKGROUND COLORS</h1>
<h1 style="background-color:SlateBlue;">HTML BACKGROUND COLORS</h1>
<h1 style="background-color:Violet;">HTML BACKGROUND COLORS</h1>
<h1 style="background-color:LightGray;">HTML BACKGROUND COLORS</h1>
<h1 style="background-color:yellow;">HTML BACKGROUND COLORS</h1>
Output:
Page | 15
HTML Text with Colors
<h3 style="color:Tomato;">Hello World</h3>
<p style="color:DodgerBlue;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonum
my nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p style="color:MediumSeaGreen;">Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorpe
r suscipit lobortis nisl ut aliquip ex ea commodo consequat.</
Output
Output
Page | 16
Horizontal Rule: <hr>
The horizontal rule tag will create a horizontal line on your web page that goes all the way across
<h1> DO NOT </h1>
<hr>
<h1> CROSS THE LINE </h1>
Tables <table>
• <tr> table rows
• <td> table data
• <th> table header
Page | 17
Code:
Page | 18
Lists <li>
Page | 19
LINKS <a href>
Local Links
• <a href="index.html">Home</a>
• <a href=“test.html">About</a>
External Links
• <a href="https://www.google.com">Google</a>
Email Links
• <a href = "mailto: wilcandilada@gmail.com">Send Email</a>
• <a href = "#">Visit thesame page </a>
h1> This is my first page</h1>
<a href="index.html">Home</a>
<a href="about.html">About</a>
<a href="https://www.google.com">Google</a>
<a href = "mailto: wilcandilada@gmail.com">Send Email</a>
<a href = "#">Visit thesame page </a>
Class Attribute
The class attribute specifies one or more class names for an element and is mostly used to point to
a class in a style sheet.
https://www.tutorialspoint.com/e_commerce/e_commerce_business_models.htm
Castro, E. & Hyslop, B .(2014). HTML and CSS. Peachpit Press.
CHAPTER 3: CSS
Page | 21
Learning Compass
What is CSS?
• A simple designed language intended to simplify the process of making web pages
presentable.
• Handles the look and feel part of the web page.
• CSS 2 is the version of CSS that is best supported across browsers both new and old.
• CSS 3 is still evolving as specification, encapsulates and builds upon CSS2.
Page | 22
Comments on CSS
<h1 style="color:blue;text-align:center;">This is a heading</h1>
<p style="color:red;">This is a paragraph.</p>
2. External CSS
Change the look of an entire website by changing just one file (CSS File) and connects it to
the HTML File
<head>
<link rel="stylesheet" href=“mystyle.css">
</head>
Page | 23
3. Internal CSS
It is used if one single HTML page has a unique style.
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px;
}
</style>
Constructing Selectors
The selector determines which elements a style rule is applied to. A selector can define up to five
different criteria for choosing the elements that should be formatted. However I am going to present
the most commonly used format of a selector.
1. The type or name of element.
h1{
color: red;
}
-all content within the h1 tag are colored in red.
Page | 24
2. The context in which the element is found
h1 emp{
color: red;
}
-the style is applied only to the em elements within h1 elements.
3. The class or ID of an element.
Class:
.error{
color: red;
}
ID:
#error{
color: red;
}
-name of desired element and the class
strong.error{
color: red;
}
Create your own "Student Registration" form using the different form elements and submit the
following:
Page | 25
CHAPTER 4: HTML FORM
Learning Compass
■ Form elements include: buttons, checkboxes, text fields, radio buttons, drop-down
menus, etc
■ A form usually contains a Submit button to send the information in he form elements
to the server
■ The form’s parameters tell JavaScript how to send the information to the server
(there are two different ways it could be sent)
■ Forms can be used for other things, such as a GUI for simple programs
Page | 26
The <form> tag
■ The <form arguments> ... </form> tag encloses form elements (and probably other
elements as well)
■ action="url" (required)
■ Specifies where to send the data when the Submit button is clicked
■ method="get" (default)
■ Form data is sent as a URL with ?form_data info appended to the end
■ Can be used only if data is all ASCII and not more than 100 characters
■ method="post"
■ target="target"
■ Most, but not all, form elements use the input tag, with a type="..." argument to tell which
kind of element it is
■ type can be text, checkbox, radio, password, hidden, submit, reset, button, file, or
image
■ value: the “value” of the element; used in different ways for different values of type
■ Other arguments are defined for the input tag but have meaning only for certain
values of type
Page | 27
Text input
A text field:
<input type="text" name="textfield" value="with an initial value" />
A password field:
<input type="password" name="textfield3" value="secret" />
• Note that two of these use the input tag, but one uses textarea
Buttons
Page | 28
■ Radio buttons:
<br>
<input type="radio" name="radiobutton" value="myValue1" />
male<br>
<input type="radio" name="radiobutton" value="myValue2”
checked="checked" />female
■ If two or more radio buttons have the same name, the user can only select one of them at a
time
■ If you ask for the value of that name, you will get the value specified for the selected radio
button
Labels
■ In many cases, the labels for controls are not part of the control
■ In my testing (Firefox and Opera), this isn’t necessary, but it may be for some
browsers
Page | 29
■ Labels also help page readers read the page correctly
Checkbox
■ A checkbox:
<input type="checkbox" name="checkbox"
value="checkbox" checked="checked">
■ type: "checkbox"
■ Unless you use a label tag, only clicking on the box itself has any effect
■ Additional arguments:
■ multiple
■ if set to "true" (or just about anything else), any number of items may be
selected
Page | 30
■ if set to "false", behavior depends on the particular browser
Create your own "Student Registration" form using the different form elements and submit the
following:
Reference
Page | 31