Professional Documents
Culture Documents
COMP 8 - Q3 - L5 - More CSS - Margin and Padding PDF
COMP 8 - Q3 - L5 - More CSS - Margin and Padding PDF
COMP 8 - Q3 - L5 - More CSS - Margin and Padding PDF
MORE CSS
COMPUTER EDUCATION 8
MORE CSS
LEARNING OBJECTIVES
Content
margin-top margin-right
margin-left margin-bottom
These 4 properties are used to set the individual values of margin for each
side of the element.
FORMAT: selector {margin-top: value;}
selector {margin-right: value;}
selector {margin-bottom: value;} Property Value/Sample
selector {margin-left: value;} margin-top (in px, pt, cm, etc.)
margin-bottom 10px, 25cm, 160pt, 400px
margin-left
margin-right
COMPUTER EDUCATION 8
MORE CSS
Content
Sample
Sample
Code
Output
COMPUTER EDUCATION 8
MORE CSS
Content
margin Sample
This is the shorthand margin property Code
for the 4 individual margin side.
FORMAT: selector {margin: top-value right-value
Property bottom-value left-value;}
Value/Sample
margin (in px, pt, cm, etc.)
10px, 25cm, 160pt, 400px
Sample
Output
padding-top padding-right
padding-left padding-bottom
These 4 properties are used to set the individual values of padding for
each side of the element.
FORMAT: selector {padding-top: value;}
selector {padding-right: value;}
selector {padding-bottom: value;}
selector {padding-left: value;} Property Value/Sample
padding-top (in px, pt, cm, etc.)
padding-bottom 10px, 25cm, 160pt, 400px
padding-left
padding-right
COMPUTER EDUCATION 8
MORE CSS
Content
Sample Sample
Code Output
COMPUTER EDUCATION 8
MORE CSS
Content
padding
Sample
This is a shorthand padding property Code
for the 4 individual padding side.
FORMAT: selector {padding: top-value right-value
bottom-value left-value;}
Property Value/Sample
padding (in px, pt, cm, etc.)
10px, 25cm, 160pt, 400px Sample
Output
Content
Source: https://youtu.be/UlG0ZAM65fQ
COMPUTER EDUCATION 8
MORE CSS
Content
Source: https://youtu.be/V072uiG5FIg
Activity
Checkpoint
Note: While you are in CHECKPOINT, refrain from using the buttons “Next”
and “Preview” below. Click the designated button for your answer. ☺
Activity
Checkpoint
QUESTION NO.1
Which CSS code is incorrect? Click your answer.
A
h {padding: 50px 100px 150px 200px;}
B
p {padding: 20px 300 px 80pt 5 cm;}
C
h1 {padding : 10cm 20px 30pt 40px;}
Note: While you are in CHECKPOINT, refrain from using the buttons “Next” and “Preview”
below. Click the designated button for your answer. ☺
Activity
Checkpoint
Try Again
QUESTION NO.1
Which CSS code is incorrect? Click your answer.
A
h {padding: 50px 100px 150px 200px;}
B
p {padding: 20px 300 px 80pt 5 cm;}
C
h1{padding : 10cm 20px 30pt 40px;}
Activity
Checkpoint
Correct
QUESTION NO.1
Which CSS code is incorrect? Click your answer.
A
h {padding: 50px 100px 150px 200px;}
B
p {padding: 20px 300 px 80pt 5 cm;}
C
h1 {padding : 10cm 20px 30pt 40px;}
Next Question
Activity
Checkpoint
QUESTION NO.2
Will this code work?
Note: While you are in CHECKPOINT, refrain from using the buttons “Next” and “Preview”
below. Click the designated button for your answer. ☺
Activity
Checkpoint
Try Again
QUESTION NO.2
Will this code work?
Next Question
Activity
Checkpoint
QUESTION NO.3
Which of the following CSS property sets the value for the left side
padding?
A B C D
margin-left margin-right padding-top padding-left
Note: While you are in CHECKPOINT, refrain from using the buttons “Next” and “Preview”
below. Click the designated button for your answer. ☺
Activity
Checkpoint
Try Again
QUESTION NO.3
Which of the following CSS property sets the value for the left side
padding?
A B C D
margin-left margin-right padding-top padding-left
Activity
Checkpoint
Correct
QUESTION NO.3
Which of the following CSS property sets the value for the left side
padding?
A B C D
margin-left margin-right padding-top padding-left
Next Question
Activity
Checkpoint
QUESTION NO.4
Select the CSS code based on the output.
A B C
Note: While you are in CHECKPOINT, refrain from using the buttons “Next” and “Preview”
below. Click the designated button for your answer. ☺
Activity
Checkpoint Try Again
QUESTION NO.4
Select the CSS code based on the output.
A B C
Activity
Correct
Checkpoint
QUESTION NO.4
Select the CSS code based on the output.
A B C
Finish Line
Activity
Checkpoint
Additional Resources
List of Color Names Supported by All Browsers
• https://www.w3schools.com/cssref/css_colors.asp