Text Formatting Using Cascading Style Sheet: Pre-Test
Text Formatting Using Cascading Style Sheet: Pre-Test
Q1|
COMPUTER PROGRAMMING 2 | CASCADING STYLESHEET
W5
TEXT FORMATTING USING CASCADING STYLE SHEET
PRE-TEST
Instructions: Select the letter that corresponds to correct answer.
________1. Which among these is not part of the text decoration property?
a. Border b. Overline c. Underline d. Strikethrough
________2. Which among the following is not included in the text transformation property?
a. Changing the text to lowercase c. Capitalize the last letter of the text
b. Changing the text to uppercase d. Capitalize the first letter of the text
________3. What property is used to specify the space between words in a text?
a. Word spacing b. White spacing c. Letter spacing d. Text spacing
________4. What property is used to specify the space between letters?
a. Word spacing b. White spacing c. Letter spacing d. Text spacing
________5. Which of the following is used to make a blur or washed-out effect on the shadow of a
text?
a. Text blur c. Text washed out
b. Text shadow d. Text decoration
TEXT DECORATION
As this property name suggest, it allows you to decorate your text in various ways. The text-
decoration property makes it easy to add lines over, under or through your text, but bear in mind
that it's not a border - the line(s) drawn by the text decoration property will always be the same
color as the text itself. If you need a line in a different color below or above your text, you should
use the border properties. It is not recommended to underline text that is not a link, as this often
confuses the reader. Text-decoration property also allows you to apply several values at once. Refer
to codes and output below.
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
text-decoration: overline;
}
h2 {
text-decoration: line-through;
}
h3 {
text-decoration: underline;
}
h4 {
text-decoration: underline overline;
}
</style>
</head>
<body>
<h1>This is heading 1</h1>
<h2>This is heading 2</h2>
<h3>This is heading 3</h3>
<h4>This is heading 4</h4>
<div style="text-decoration: underline overline
line-through;">HELLO WORLD!"</div>
</body>
</html>
GRADE 11
Q1|
COMPUTER PROGRAMMING 2 | CASCADING STYLESHEET
W5
The value text-decoration: none; is often used to remove underlines from links.
Text Transformation
This property is used to transform text into uppercase, lowercase, or capitalize the first letter of text.
<!DOCTYPE html>
<html>
<head>
<style>
div.a {
text-transform: uppercase;
}
div.b {
text-transform: lowercase;
}
div.c {
text-transform: capitalize;
}
</style>
</head>
<body>
<h1>The text-transform Property</h1>
<h2>text-transform: uppercase:</h2>
<div class="a">Lorem ipsum dolor sit
amet, consectetur adipiscing elit.</div>
<h2>text-transform: lowercase:</h2>
<div class="b">Lorem ipsum dolor sit
amet, consectetur adipiscing elit.</div>
<h2>text-transform: capitalize:</h2>
<div class="c">Lorem ipsum dolor sit
amet, consectetur adipiscing elit.</div>
</body>
</html>
Text Shadow
This property adds shadow to text. The text-shadow property has control over three things -
the color, the placement and the blur. This means that there are four values:
color
x-coordinate (horizontal)
y-coordinate (vertical)
blur radius
You can use either HEX colors of RGB colors when you define the color. The coordinates are based on the
placement of the text and can be either positive or negative. The amount of blur defines how 'washed-out' your shadow
is.
Note: Be mindful of the color of the text, the shadow and the background.
GRADE 11
Q1|
COMPUTER PROGRAMMING 2 | CASCADING STYLESHEET
W5
COMPUTER PROGRAMMING 2
ACTIVITY SHEET|WEEK 5
Name:____________________________________
ACTIVITY 1: CODING
Instructions: Complete the codes to produce the required output. Use the given guide for the value
of properties to be used. (5pts each)
1. Use text decoration on header to have over line and underline.
2. Set the horizontal and vertical shadow effect to 5px, blur radius to 5px and the color to gray.
3. Set the paragraph indent to 50px.
4. Use text decoration to remove the underline on the hyperlink.
5. Make the "hello, world!" all caps.
6. Put a 5px letter spacing on the word SOURCE:
ACTIVITY 2: DEBUGGING
Instructions: You can use the codes below as reference for the coding activity, however there are
four errors that you have to find. Encircle these errors. (5pts each)
Required Output: