Professional Documents
Culture Documents
TLE Grade910 Web Page Design Q2 Weeks1to4 Binded Ver1.0
TLE Grade910 Web Page Design Q2 Weeks1to4 Binded Ver1.0
Technology and
Livelihood
Education (TLE)
Web Page Design
Quarter 2 – Module 1
Develop Basic HTML Document
Using HTML5 and CSS3 Syntax
Technology and Livelihood Education (TLE) – Grade 9/10
Web Page Design
Alternative Delivery Mode
Quarter 2 – Module 1: Develop Basic HTML Document Using HTML5 and CSS3 Syntax
First Edition, 2020
Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.
Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.
Printed in the Philippines by the Schools Division Office of Makati City through the
support of the City Government of Makati (Local School Board)
This module was collaboratively designed, developed and reviewed by educators both
from public and private institutions to assist you, the teacher or facilitator in helping
the learners meet the standards set by the K to 12 Curriculum while overcoming their
personal, social, and economic constraints in schooling.
This learning resource hopes to engage the learners into guided and independent
learning activities at their own pace and time. Furthermore, this also aims to help
learners acquire the needed 21st century skills while taking into consideration their
needs and circumstances.
This module was designed to provide you with fun and meaningful opportunities for
guided and independent learning at your own pace and time. You will be enabled to
process the contents of the learning resource while being an active learner.
1
What I Need to Know
WEEK 1
The main objective of this module is to help you gain knowledge and core
competencyy in Programming .Net Technology (Web Page Design) specifically “Perform
Programming in HTML5 with JavaScript (PPHJ)”. To further explore this area of
expertise students must learn its foundation. This foundation can be observed in the
following learning outcomes listed below.
Learning Outcome: Develop Basic HTML Document Using HTML5 and CSS3 Syntax.
2.1 Design HTML5 Document using Cascading Style Sheet 3 (CSS3)
What I Know
MULTIPLE CHOICE.
Direction: Read the questions following and answer it. Write the letter on the blank
provided before the number.
___ 1. What line of code tells our browser that we want to link a style sheet in the same
folder as our HTML page, and it is named “style.css”?
A. <div id=”box-one”> C. <meta charset=”utf-8”>
B. <link rel=”stylesheet” href=”style.css”> D.#box-one{background-color:gray;}
___ 2. Which of the following most essential parts of CSS refers to some of the creative
things you can do such as adding gradients, background images, and rounded
corners?
A. Backgrounds and Borders C. Styling Tables
B. Cascade and Inheritance D. Text Directions
___ 4. CSS is created and maintained through a group of people within the W3C. What
is it called?
A. CSS Working Group C. Data Analyst
B. Computer Programmers D. Project Engineers
___ 5. What is a type of attribute of HTML tag converted into CSS properties which
could be color, border etc.?
A. Class B. Property C. Selector D. Value
2
Develop Basic HTML
Lesson
Document Using HTML5
1
and CSS3 Syntax
What’s In
SCRABBLE WORD:
Direction: Arrange the given words related to the most essential parts of CSS.
Write your answer on the space provided.
1. OXB DLEOM
2. RTESLSOCE
3. GUGBIDGEN
4. AIGZONRNGI
5. IGINSNZ EMSTI
6. CDACESA ADN NETRCNIEAHI
7. VEFWGONIROL TNTOCNE
8. LESAVU DNA TUSIN
9. EXTT CORNSEIDIT
10. LYNGSTI TLESBA
What’s New
COMPLETION TYPE.
Direction: Complete the codes. Write the letter of the correct answer. Choose your
answer in the box.
a. { b. </style> c. center d. color e. h1
<style>
1. ___ 2. __
3. ________ blue;
text-align: 4._________
}
5. _________
What Is It
3
apply styles to web pages. More importantly, CSS enables you to do this independent of
the HTML that makes up each web page.CSS is easy to learn and understood but it
provides powerful control over the presentation of an HTML document.
WHY CSS?
• CSS saves time: You can write CSS once and reuse the same sheet in multiple HTML
pages.
• Easy Maintenance: To make a global change simply change the style, and all
elements in all the webpages will be updated automatically.
• Search Engines: CSS is considered as a clean coding technique, which means search
engines won’t have to struggle to “read” its content.
• Superior styles to HTML: CSS have 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.
• Offline Browsing: CSS can store web applications locally with the help of offline
cache. Using of this, we can view offline websites.
These ratified specifications are called recommendations because the W3C has no
control over the actual implementation of the language. Independent companies and
organizations create that software.
NOTE: The World Wide Web Consortium, or W3C is a group that makes
recommendations about how the Internet works and how it should evolve.
CSS Selectors - There are a wide variety of CSS selectors available, allowing for fine-
grained precision when selecting elements to style as follows:
• Type, class, and ID selectors
• Attribute selectors
• Pseudo-classes and pseudo-elements
• Combinators
The Box Model - Everything in CSS has a box around it, and understanding these boxes
is key to being able to create layouts with CSS, or to align items with other items. Take
a proper look at the CSS Box Model to move onto more complex layout tasks with an
understanding of how it works and the terminology that relates to it.
Backgrounds and Borders - It is some of the creative things you can do: from adding
gradients, background images, and rounded corners, backgrounds and borders are the
answer to a lot of styling questions in CSS.
Handling Different Text Directions - In recent years, CSS has evolved in order to
better support different directionality of content, including right-to-left but also top-to-
bottom content (such as Japanese) — these different directionalities are called writing
modes. As you progress in your study and begin to work with layout, an understanding
of writing modes will be very helpful to you.
Overflowing Content - Overflow is what happens when there is too much content to be
contained comfortably inside a box. You will learn what it is and how to manage it.
4
CSS Values and Units - Every property used in CSS has a value or set of values that
are allowed for that property. You will take a look at some of the most common values
and units in use.
Sizing Items in CSS - Understanding how big the different features in your design will
be is important. It summarizes the various ways elements get a size via CSS and define
a few terms around sizing that will help you in the future.
Images, Media, and Form Elements - In this part, we will take a look at how certain
special elements are treated in CSS. Images, other media, and form elements behave a
little differently in terms of your ability to style them with CSS than regular boxes.
Understanding what is and isn't possible can save some frustration, and this will
highlight some of the main things that you need to know.
Styling Tables - Styling an HTML table isn't the most glamorous job in the world, but
sometimes we all have to do it. This will provide a guide on how to make HTML tables
looks good, with some specific table styling techniques highlighted.
Debugging CSS - Sometimes when writing CSS, you will encounter an issue where your
CSS doesn't seem to be doing what you expect. This part will give you guidance on how
to go about debugging a CSS problem, and show you how the DevTools included in all
modern browsers can help you find out what is going on.
Organizing your CSS - As you start to work on larger stylesheets and big projects you
will discover that maintaining a huge CSS file can be challenging. It will take a brief look
at some best practices for writing your CSS to make it easily maintainable, and some of
the solutions you will find in use by others to help improve maintainability.
CSS SYNTAX
A CSS comprises 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 –
1. Selector − A selector is an HTML tag at which a style will be applied. This could be
any tag like <h1> or <table> etc.
2. 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.
3. Value − Values are assigned to properties. For example, color property can have
value either red or #F1F1F1 etc.
HOW IT WORKS?
Cascading Style Sheets are simple text files saved in a “.css” extension which contain
style Rules. For example, we had a <h1> heading element on a page, and we wanted to
make it blue, and center aligned. Here is the code we would add to our .css file:
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: blue;
text-align: center;
}
</style>
</head>
<body>
<h1>Good morning Students!</h1>
<h1>This is styled with CSS.</h1>
</body>
</html>
5
EDITOR AND SAVING THE CSS FILE
Use notepad as an editor for CSS. Then, create a new folder on your desktop (or another
location you prefer) and name it CSS-Test. Now, back in your text editing program save
your document as “style.css”.
Our new CSS file is worthless if we do not apply it to a web page. Let’s create an HTML
page. Create a new blank file in Notepad (or TextEdit) and add the following code:
<!DOCTYPE html>
<html> OUTPUT
<head>
<meta charset=”utf-8”>
<title>CSS-Test</title>
</head>
<body>
<h1>CSS-Test</h1>
<div id=”box-one”>
<p>This is box one.</p>
</div>
<p>This is box two.</p>
</div>
</body>
</html>
6
LINKING THE TWO FILES TOGETHER
We still need to tell the web browser to load our “style.css” file when the “index.htm”
page is viewed. Add the following code to “index.htm” directly above our </head> closing
tag:
<link rel=”stylesheet” href=”style.css”>
#box-one {
background-color:yellow;
padding: 10px;
}
What’s More
True or False
Direction: Write T if the statement is True and F if it is false. Write your answer
on the space provided before the number.
___ 1. Our new CSS file is worthless if we apply it to a web page.
___ 2. When you save your CSS file, refresh your HTML page in a web browser to see
the latest output.
___ 3. Use notepad as an editor for CSS.
___ 4. When an element has an “id”, we can access it with a CSS selector by placing a
pound sign (#) in front of its id value.
___ 5. There are a wide variety of CSS selectors available, allowing for fine-grained
precision when selecting elements to style.
___ 6. Selector is assigned to properties.
___ 7. Styling an HTML table is the most glamorous job in the world
___ 8. All elements in all the webpages will be updated automatically.
___ 9. CSS is easy to learn and understood but it provides powerful control over
the presentation of an HTML document.
___ 10. Different directionalities are called writing directional.
7
What I Have Learned?
Fill in the blanks
Direction: Fill in the correct word/s to process what you learned from the Week 1 lesson.
1. _____________ allows you to apply styles to web pages.
2. CSS is created and maintained through a group of people within the W3C called the
__________________.
3. It is some of the creative things you can do with CSS __________________ and borders.
4. ________________ is what happens when there is too much content to be contained
comfortably inside a box.
5.____________________ are assigned to properties. For example, color property can have
value either red or #F1F1F1 etc.
6. Include ________ after typing the file name.
7. – 8. We still need to tell the web browser to load our “___________” file when the
“_____________” page is viewed.
9. A ______________ is an HTML tag at which a style will be applied. This could be any
tag like <h1> or <table> etc.
10. CSS can store web applications locally with the help of _________________.
Direction: Create a heading element on a page “My First CSS Activity”. Add background
color, make it blue, and center aligned. Display at least one paragraph, written as
Verdana with 20px. Save your file as CSS Activity1.htm. Write your answers on a
separate sheet.
Assessment
POST TEST
MULTIPLE CHOICE.
Direction: Read the following and answer it. Write the letter on the blank provided
before the number.
___ 1. Which of the following line of codes link CSS FILE to an HTML page?
A. <div id=”box-one”> C. <meta charset=”utf-8”>
B. <link rel=”stylesheet” href=”style.css”> D.#box-one{background-color:gray;}
___ 4. Which of the following terms allows you to apply styles to web pages?
A. CSS B HTML C. JAVA D. W3C
8
9/10
Technology and
Livelihood
Education (TLE)
Web Page Design
Quarter 2 – Module 2
Create HTML5 Document Using
Advanced Techniques with
JavaScript and CSS3
Technology and Livelihood Education (TLE) – Grade 9/10
Web Page Design
Alternative Delivery Mode
Quarter 2 – Module 2: Create HTML5 Document Using Advanced Techniques with
JavaScript and CSS3
First Edition, 2020
Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.
Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.
Printed in the Philippines by the Schools Division Office of Makati City through the
support of the City Government of Makati (Local School Board)
What I Know
MULTIPLE CHOICE.
Direction: Read the following questions and answer it. Write the letter on the blank
provided before the number.
___ 1. Which of the following style sheets use this line of code below?
<h1 style=”color:blue”>This is a blue heading </h1>
A. External B. Inline C. Internal D. Multiple
___ 2. Which of the following style sheets was most identified in CSS implementation
policy as linked in the head section?
A. External B. Inline C. Internal D. Multiple
___ 3. Which of the following statements describe internal style sheets?
A. It adds the style attribute to the relevant element.
B. It is defined inside <style> element, inside head section.
C. It is ideal when the style is applied to many pages.
D. It is used to apply a unique style for a single element.
___ 4. What is the line of code can be use in inline style sheets?
A. <h1 style=”color:blue”>
B. <style type=”text/css”>
C. Font-size:12px;
D. Type=”text/css”
___ 5. What way of style sheet used when you have this line of code in your program?
href=”sample”
A. External B. Inline C. Internal D. Multiple
1
Create HTML5 Document
Lesson
Using Advanced
2 Techniques with
JavaScript and CSS3
What’s In
ENUMERATION:
Direction: Give at least five (5) most essential parts of the CSS Language
and explain each. Write your answer on a separate sheet of paper.
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
______________
What’s New
IDENTIFICATION.
Direction: Read the following statements about ways of inserting CSS. Write Inline if it
is Inline Style Sheet, Internal if it is Internal Style Sheet, and External, if it is about
External Style Sheet.
7. Each page must link to style sheet using the <link> tag.
2
8. It loses many of the advantages of a style sheet (by mixing
content with presentation).
10. The .css file should not contain any HTML tags.
What Is It
When a browser reads a style sheet, it will format the HTML document according to the
information in the style sheet.
@sample.html
@sample.css
Inline styles are defined within the "style" attribute of the relevant element:
Example:
<!DOCTYPE html>
<html>
<body>
</body>
</html>
OUTPUT
3
Note: An inline style loses many of the advantages of a style sheet (by mixing content
with presentation). Use this method sparingly.
<head>
<style type=”text/css”>
h1
{
color:blue;
font-size:12px;
</style>
</head>
Example:
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
margin-left: 40px;
}
</style>
</head>
<body>
<h1>This is my heading</h1>
<p>This is my paragraph.</p>
</body>
</html>
OUTPUT
4
3. External Style Sheet
With an external style sheet, you can change the look of an entire website by changing
just one file. Each HTML page must include a reference to the external style sheet file
inside the <link> element, inside the head section.
@sample.html
<head>
<link rel=”stylesheet” type=”text/css” href=”sample.css”>
</head>
@sample.css
h1
{
color:red;
font-size:12px;
}
p
{
color:blue;
}
Note: It is ideal when the style is applied to many pages. You can change the look of an
entire Website by changing one CSS file. Each page must link to the style sheet using
the <link> tag.
Example:
External styles are defined within the <link> element, inside the <head> section of an
HTML page:
<!DOCTYPE html>
<html>
<head>
<link rel=”stylesheet” href=”mystyle.css”
</head>
<body>
<h1>This is my heading</h1>
<p>This is my paragraph.</p>
</body>
</html>
OUTPUT
5
An external style sheet can be written in any text editor, and must be saved with a .css
extension. The external .css file should not contain any HTML tags. Here is how the
"mystyle.css" file looks like:
“mystyle.css”
body {
background-color: lightblue;
h1{
color:navy;
margin-left:20px;
Note: Do not add a space between the property value and the unit (such as margin-
left:20px;). The correct way is:margin-left:20px;
What’s More
Direction: Using your output in Quarter 1 Module 4 entitled “Myself”, choose at
least one out of three ways in inserting CSS. Save your work as Activity 2_Surname.css.
Write your answer on a separate sheet of paper.
Code:
6
Rubrics:
Criteria Points Score
Content 20
Creativity 15
Time 15
Management
Total Points 50
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Myself</h1>
<p>Good day everyone!</p>
<p>I am happy to display this page.</p>
</body>
</html>
What I Can Do
Direction: Create a Family Tree and save it as “My Family Tree.css”. Add an external
style sheet with the URL:”myfamilytree_surname.css”. Set background-color according
to your preference color for the page using internal style. Write your answers on a
separate sheet of paper.
Code:
7
Assessment
POST TEST
MULTIPLE CHOICE.
Direction: Read the following and answer it. Write the letter on the blank provided
before the number.
___ 2. What is the missing property to complete the code of Mary? ______:12px;
A. Background-color
B. Color
C. Font-size
D. Text-align
___ 3. Which of the following is the correct line of code in style sheets?
A. color =red
B. href:sample.css
C. font-sze:40px;
D. text-align=left;
References
Webliography
W3Schools (1999-2020), How To Add CSS, from
https://www.w3schools.com/css/css_howto.asp
8
9/10
Technology and
Livelihood
Education (TLE)
Web Page Design
Quarter 2 – Module 3
Create HTML5 Document Using
Advanced Techniques with
JavaScript and CSS3
Technology and Livelihood Education (TLE) – Grade 9/10
Web Page Design
Alternative Delivery Mode
Quarter 2 – Module 3: Create HTML5 Document Using Advanced Techniques with
JavaScript and CSS3
First Edition, 2020
Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.
Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.
Printed in the Philippines by the Schools Division Office of Makati City through the
support of the City Government of Makati (Local School Board)
ii
About this Module
Welcome to Module 3 of Web Page Design! This module is a specialization course
specifically for “Perform Programming in HTML5 with JavaScript (PPHJ)”. Also, this
module is suitable for students who are aiming for a Programming .Net Technology
course in Grade 11 up to Grade 12 and pursue the National Certification Level III which
is offered by TESDA.
The main objective of this module is to help you gain knowledge and core
competencyy in Programming .Net Technology (Web Page Design) specifically “Perform
Programming in HTML5 with JavaScript (PPHJ)”. To further explore this area of
expertise students must learn its foundation. This foundation can be observed in the
following learning outcomes listed below.
What I Know
MULTIPLE CHOICE.
Direction: Read the following and answer it. Write the letter on the blank provided
before the number.
___ 1. CSS selectors are divided into several categories. Which of the following DOES
NOT belong to the group?
A. Attribute B. Combinator C. Contributor D. Simple
B.
___ 2. Which is an example of value?
A. Border B. Color C. Red D. Text-align
B.
___ 3. Which of the following statements describe simple selectors?
A. It selects and style a part of an element .
B. It selects elements based on a certain state.
C. It selects elements based on name, id, class.
D. It selects elements based on a specific relationship between them.
___ 4. What is the format in writing a line of code for class selector?
A. A hash (#) character, followed by the id of the element.
B. A period (.) character, followed by the class name.
C. An asterisk (*) selects all HTML elements on the page.
D. An equal sign (=) character, followed by the group element.
___ 5. Which of the following CSS Selectors that selects all the HTML elements with
the same style definitions?
A. Class B. Group C. ID D. Universal
1
Create HTML5 Document
Lesson Using Advanced
3 Techniques with
JavaScript and CSS3
What’s In
What’s New
IDENTIFICATION:
Direction: Write S if it is Selector, P if it is Property, and V if it is Value.
__ 1. table __ 6. left
__ 2. 200px __ 7. border
__ 3. text-align __ 8. normal
__ 4. h1 __ 9. p
__ 5. black __ 10. font-weight
What Is It
2
CSS SELECTORS
CSS selectors are used to "find" (or select) the HTML elements you want to style.
We can divide CSS selectors into five categories:
• Simple selectors (select elements based on name, id, class)
• Combinator selectors (select elements based on a specific relationship between
them)
• Pseudo-class selectors (select elements based on a certain state)
• Pseudo-elements selectors (select and style a part of an element)
• Attribute selectors (select elements based on an attribute or attribute value)
The CSS Basic Selector
The element selector selects HTML elements based on the element name.
Example 1: Here, all <p> elements on the page will be left-aligned, with a blue text
color:
p{
text-align: left;
color: blue;
}
Example 2: Here, all <h1> elements on the page will be at the center, with a red text
Color and 12px:
h1{
color:red;
font-size: 12px;
}
#para1 {
text-align: center;
color: orange;
}
Example 2:
@sample.html
<p id=”headline”>This is paragraph 1</p>
<p>This is paragraph 2 </p>
<p>This is paragraph 3 </p>
<p>This is paragraph 4 </p>
@sample.css
#headline
{
color:cyan;
font-size:20px;
}
3
The CSS Class Selector
The class selector selects HTML elements with a specific class attribute.
To select elements with a specific class, write a period (.) character, followed by the
class name.
Example 1: All HTML elements with class="center" will be red and center-aligned:
.center {
text-align: center;
color: red;
}
You can also specify that only specific HTML elements should be affected by a class.
Example 2: Only <p> elements with class="center" will be center-aligned:
p.center {
text-align: center;
color: red;
}
Example 4:
@sample.html
<p class=”headlines”>This is paragraph 1</p>
<p>This is paragraph 2 </p>
<p class=”headlines”>This is paragraph 3</p>
<p>This is paragraph 4 </p>
@sample.css
.headlines
{
color:cyan;
font-size:20px;
}
*{
text-align: center;
color: blue;
}
4
The CSS Grouping Selector
The grouping selector selects all the HTML elements with the same style definitions.
Example 1: The following CSS code (h1, h2, and p elements have the same style
definitions):
h1 {
text-align: center;
color: red;
}
h2 {
text-align: center;
color: red;
}
p{
text-align: center;
color: red;
}
It will be better to group the selectors, to minimize the code. To group selectors,
separate each selector with a comma.
Example 2: We have grouped the selectors from the code above:
h1, h2, p {
text-align: center;
color: red;
}
Example 3:
h1, h2, h3, h4, p{
color: cyan;
margin: 5px;
}
All CSS Simple Selectors
5
Some CSS Properties
Text
CSS Background
Fonts
What’s More
Matching Type
Direction: Match the following examples of selectors in Column A with their
corresponding categories in Column B. Write the letter of the correct answer before each
number.
Column A Column B
___ 4. * D. selector
6
What I Have Learned
What I Can Do
Direction: Create your own examples of different selectors and describe it. Write your
answer on the table below.
2. #id
3. *
4. element
5. element,element,….
7
Assessment
POST TEST
MULTIPLE CHOICE.
Direction: Read the following and answer it. Write the letter on the blank provided
before the number.
___ 1. William needs to complete his code by assigning values to properties. But he
missed one part of CSS Syntax. Which of the following parts should William need?
A. Property
B. Selector
C. Value
D. No answer
E.
___ 2. What does the W3C stand for?
A. Word Wide Wave Consortium
B. World Wide Web Consortium
C. Word Wide Web Consolidation
D. World Wide Web Consolidation
___ 3. Which of the following does not belong in the anatomy of a CSS rule?
A. Property
B. Selector
C. Value
D. No answer
References
Webliography
https://www.w3schools.com/css/css_selectors.asp
8
9/10
Technology and
Livelihood
Education (TLE)
Web Page Design
Quarter 2 – Module 4
Create HTML5 Document Using
Advanced Techniques with
JavaScript and CSS3
Technology and Livelihood Education (TLE) – Grade 9/10
Web Page Design
Alternative Delivery Mode
Quarter 2 – Module 4: Create HMTL5 Document Using Advanced Techniques with
JavaScript and CSS3
First Edition, 2020
Republic Act 8293, section 176 states that: No copyright shall subsist in any work of the
Government of the Philippines. However, prior approval of the government agency or office
wherein the work is created shall be necessary for exploitation of such work for profit. Such
agency or office may, among other things, impose as a condition the payment of royalties.
Borrowed materials (i.e., songs, stories, poems, pictures, photos, brand names, trademarks, etc.)
included in this module are owned by their respective copyright holders. Every effort has been
exerted to locate and seek permission to use these materials from their respective copyright
owners. The publisher and authors do not represent nor claim ownership over them.
Printed in the Philippines by the Schools Division Office of Makati City through the
support of the City Government of Makati (Local School Board)
The main objective of this module is to help you gain knowledge and core
competencyy in Programming .Net Technology (Web Page Design) specifically “Perform
Programming in HTML5 with JavaScript (PPHJ)”. To further explore this area of
expertise students must learn its foundation. This foundation can be observed in the
following learning outcomes listed below.
What I Know
IDENTIFICATION:
Direction: Read and identify each statement carefully. Choose the correct answer from
the box given below and write the letter only.
___ 2. It is specified using predefined color names, or RB, HEX, HSL, RGBA, HSLA
values.
___ 4. It is placed inside the <style> element and starts with /* and ends with */.
1
Create HTML5 Document
Lesson Using Advanced
4 Techniques with
JavaScript and CSS3
What’s In
IDENTIFICATION:
Direction: Write S if it is Selector, P if it is Property, and V if it is Value.
__ 1. table __ 6. left
__ 2. 200px __ 7. border
__ 3. text-align __ 8. normal
__ 4. h1 __ 9. p
__ 5. black __ 10. font-weight
What’s New
IDENTIFICATION:
Direction: Write C if it is Comment, Co if it is Color, and B if it is Background.
__ 1. style="opacity:0.3;" __ 6. /* This is a single-line comment */
__ 2. border: 10px solid DodgerBlue __ 7. rgba(0, 128, 0, 0.6)
__ 3. /* Set text color to blue */ __ 8. color:#ff6347
__ 4. style="opacity:0.1 __ 9. rgb(0, 128, 0);
__ 5. color:hsl(9, 100%, 64%) __ 10. style="color:Tomato
What Is It
CSS COMMENTS
Comments are used to explain the code, and may help when you edit the source code
at a later date. Comments are ignored by browsers. A CSS comment is placed inside
the <style> element, and starts with /* and ends with */:
Example 1:
/* This is a single-line comment */
p{
color: blue;
}
You can add comments wherever you want in the code:
Example 2:
p{
color: blue; /* Set text color to blue */
}
2
HTML and CSS Comments
From the HTML tutorial, you learned that you can add comments to your HTML
source by using the <!--...--> syntax. In the following example, we use a combination
of HTML and CSS comments:
<!DOCTYPE html>
<html>
<head>
<style>
p{
color: red; /* Set text color to red */
}
</style>
</head>
<body>
<h2>My Heading</h2>
<!-- These paragraphs will be red -->
<p>Hello World!</p>
<p>This paragraph is styled with CSS.</p>
<p>CSS comments are not shown in the output.</p>
</body>
</html>
@sample.html @sample.css
.headlines
<p class=”headlines”>This is paragraph 1</p>
{
<p>This is paragraph 2 </p>
color:cyan;
<p class=”headlines”>This is paragraph 3</p>
font-size:20px;
<p>This is paragraph 4 </p>
}
CSS COLORS
Colors are specified using predefined color names, or RGB, HEX, HSL, RGBA,
HSLA values.
CSS Color Names – In CSS, a color can be specified by using a color name: orange,
dodger blue, medium sea green, gray, slate blue, violet, light gray, etc. CSS/HTML
support 140 standard color names. To see the HTML Color Names, kindly click this link:
https://www.w3schools.com/colors/colors_names.asp.
CSS Background Color – You can set the background color for HTML elements:
Example:
<!DOCTYPE html>
<html>
<body>
<h1 style="background-color:DodgerBlue;">Welcome to my Website</h1>
<p style="background-color:Tomato;">This website is created for educational purposes
only. </p>
</body>
</html>
OUTPUT:
3
<h1 style="color:Tomato;">Hello World</h1>
<p style="color:DodgerBlue;">Lorem ipsum...</p>
<p style="color:MediumSeaGreen;">Ut wisi enim...</p>
Example:
<!DOCTYPE html>
<html>
<body>
<h3 style="color:Tomato;">Welcome to my Website</h3>
<p style="color:DodgerBlue;">This website is created for educational purposes only.
This website is created for educational purposes only. </p>
<p style="color:MediumSeaGreen;">Thank you for visiting my website. Thank you for
visiting my website. Thank you for visiting my website. </p>
</body>
</html>
OUTPUT:
CSS Color Values – In CSS, colors can also be specified using RGB values, HEX
values, HSL values, RGBA values, and HSLA values:
<!DOCTYPE html>
<html>
<body>
<p>This is 100% solid color</p>
<h1 style="background-color:rgb(255, 99, 71);">Welcome to my Website</h1>
<h1 style="background-color:#ff6347;">Welcome to my Website</h1>
<h1 style="background-color:hsl(9, 100%, 64%);">Welcome to my Website</h1>
<p>This part shows 50% transparent:</p>
<h1 style="background-color:rgba(255, 99, 71, 0.5);">Welcome to my Website</h1>
<h1 style="background-color:hsla(9, 100%, 64%, 0.5);">Welcome to my Website</h1>
<p>In addition to the predefined color names, colors can be specified using RGB, HEX,
HSL, or even transparent colors using RGBA or HSLA color values.</p>
</body>
</html>
OUTPUT:
4
CSS BACKGROUNDS
Transparency Using RGBA - If you do not want to apply opacity to child elements, like
in our example above, use RGBA color values. The following example sets the opacity
for the background color and not the text:
In addition to RGB, you can use an RGB color value with an alpha channel (RGBA) -
which specifies the opacity for a color. An RGBA color value is specified with: rgba(red,
green, blue, alpha). The alpha parameter is a number between 0.0 (fully transparent)
and 1.0 (fully opaque).
Example:
div {
background: rgba(0, 128, 0, 0.3) /* Green background with 30% opacity */
}
<body>
<h1>Transparent Box</h1> OUTPUT:
<p>With opacity:</p>
<div style="opacity:0.1;">
<h1>10% opacity</h1>
</div>
<div style="opacity:0.3;">
<h1>30% opacity</h1>
</div>
<div style="opacity:0.6;">
<h1>60% opacity</h1>
</div>
<div>
<h1>opacity 1</h1>
</div>
5
<p>With RGBA color values:</p> OUTPUT:
<div class="first">
<h1>10% opacity</h1>
</div>
<div class="second">
<h1>30% opacity</h1>
</div>
<div class="third">
<h1>60% opacity</h1>
</div>
<div>
<h1>default</h1>
</div>
<p>Notice how the text gets transparent as well as the background color when using
the opacity property.</p>
</body>
</html>
CSS Background-repeat: no-repeat - Showing the background image only once is also
specified by the background-repeat property:
Example:
Show the background image only once:
6
body {
background-image: url("img_tree.png");
background-repeat: no-repeat; }
In the example above, the background image is placed in the same place as the text. We
want to change the position of the image, so that it does not disturb the text too much.
Matching Type
Direction: Match the following examples of selectors in Column A with their
corresponding categories in Column B. Write the letter of the correct answer before each
number.
Column A Column B
___ 1. <h1 style="color:Tomato;"> A. CSS Background
___ 2. /* This is a single-line comment */ B. CSS Border Color
___ 3. <h1 style="background-color:#ff6347;"> C. CSS Color Values
___ 4. background: rgb(0, 128, 0) D. CSS Comments
___ 5. <h1 style="border: 20px solid Violet;"> E. CSS Text Color
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Myself</h1>
<p>Good day everyone!</p>
<p>I am happy to display this page.</p>
</body>
</html>
What I Can Do
Direction: Using your Myself Activity in Quarter 1, edit the HTML and add CSS code
showing the following instructions below. Write your answers on a separate sheet of
paper.
1. Set the background color for the page
2. Set the background color for <h1>.
7
3. Set gif image as the background image of your page.
4. Set gradient_bg_vertical .png image as the background image of the page, and
repeat it vertically only.
5. Use the shorthand background property to set background image to png image,
show it once, in the top right corner.
Assessment
POST TEST
IDENTIFICATION:
Direction: Read and identify each code carefully. Choose the correct answer from the
box given below and write the letter only.
A. CSS Background Color C. CSS Color Names E.CSS Text Color
B. CSS Border Color D. CSS Comments
References
A. Webliography
W3Schools (1999-2020), CSS Comments,
from https://www.w3schools.com/css/css_comments.asp
W3Schools (1999-2020), CSS Colors, from
https://www.w3schools.com/css/css_colors.asp
W3Schools (1999-2020), HTML Color Names from
https://www.w3schools.com/colors/colors_names.asp.
W3Schools (1999-2020), CSS Background Repeat from
https://www.w3schools.com/css/css_background_repeat.asp
B. Images
W3Schools (1999-2020), CSS Colors, from
https://www.w3schools.com/css/css_colors.asp
W3Schools (1999-2020), HTML Color Names from
https://www.w3schools.com/colors/colors_names.asp.
W3Schools (1999-2020), CSS Background Repeat from
https://www.w3schools.com/css/css_background_repeat.asp