Grade 10: Introduction To Css (Cascading Styling Sheet)
Grade 10: Introduction To Css (Cascading Styling Sheet)
Region V
Division of City Schools
Naga City
DON LEON Q. MERCADO HIGH SCHOOL
INTRODUCTION TO CSS
(Cascading Styling Sheet)
GRADE 10
Quarter 3 Week 1 Module 1
Learning Competency:
LESSON 1
INTRODUCTION TO
CSS
JUNIOR HIGH SCHOOL
GRADE 10
Before starting the module, I want you to set aside other tasks that will disturb you while
enjoying the lessons. Read the simple instructions below to successfully enjoy the
objectives of this kit. Have fun!
1. Follow carefully all the contents and instructions indicated in every page of this module
and follow the given instructions for each of the given learning outcome/s.
2. As you read, you can also do the hands-on to check if you were able to follow the
basic programming procedure.
3. Demonstrate what you have learned by doing what the Activity required you to do so.
4. Analyze conceptually the posttest and apply what you have learned.
5. Enjoy studying!
, LESSON 1
OVERVIEW OF CASCADING STYLING SHEET
EXPECTATIONS:
TECHNICAL TERMS:
A. <head> B. <P>
What is CSS?
CSS Syntax
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:
The element selector selects HTML elements based on the element name.
Here, all <p> elements on the page will be center-aligned, with a red text color:
Example:
p {
text-align: center;
color: red;
}
External CSS
Internal CSS
Inline CSS
External CSS
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.
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 a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
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.
body {
background-color: lightblue;
}
h1 {
color: navy;
margin-left: 20px;
}
Internal CSS
An internal style sheet may be used if one single HTML page has a unique style.
The internal style is defined inside the <style> element, inside the head section.
Example:
Inline styles are defined within the "style" attribute of the relevant element:
<!DOCTYPE html>
<html>
<body>
</body>
</html>
Inline CSS
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style
attribute can contain any CSS property.
Example:
Inline styles are defined within the "style" attribute of the relevant
element:
<!DOCTYPE html>
<html>
<body>
CSS Comments
Comments are used to explain the code, and may help when you edit the
source code at a later date.
A CSS comment is placed inside the <style> element, and starts with /* and
ends with */:
Example:
/* This is a single-line comment */
p {
color: red;
}
/* This is
a multi-line
comment */
p {
color: red;
}
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: red; /* Set text color to red */
}
</style>
</head>
<body>
<h2>My Heading</h2>
</body>
</html>
OUTPUT:
ACTIVITY 1
3. Where in an HTML document is the correct place to refer to an external style sheet?
Direction: Try to solve an exercise by editing some code. Write your answer in
separate sheet .The output must show to change the color of all <p> elements to "red".
<!DOCTYPE html>
<html>
<head>
<style>
</style>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
</body>
</html>
POST TEST
A. <head>
B. <P>
1. A
2. B
3. B
4. C
5. A
ACTIVITY 1
1. Cascading Styl Sheets
2. <link rel="stylesheet" href="mystyle.css">
3. In the Head Section
4. <STYLE>
5. Font
6. /* This is a single-line comment */
7. bgcolor
PREPARED BY:
HAZEL B. FRANCE
Teacher