Cascading Style Sheets (CSS)
Cascading Style Sheets (CSS)
SHEETS (CSS)
(INTRODUCTION)
PRESENTED BY :
MA. JU DY MA E QU INTA NA
BETHANY MAJABAGUE
C AT H L E A U MA MBO NG
WHAT IS CSS?
4
CSS STRUCTURE
A CSS RULE-SET
CONSISTS OF A
SELECTOR AND A
D E C L A RAT I O N
BLOCK:
5
CSS STRUCTURE
6
ADVANTAGES OF USING CSS
7
DISADVANTAGE OF USING CSS
• Learning Curve
• Security Concerns
8
3 KINDS OF CSS
INLINE STYLE SHEET
10
EMBEDDED STYLE SHEETS (INTERNAL STYLE
SHEETS)
11
EXTERNAL STYLE SHEET
These are the most global of the three kinds of CSS), you can apply
the same one to an unlimited number of pages. They allow you to
develop a consistent style across pages. They easily allow you to
change the layout of the entire web site by simply changing the
external style sheet and every page is instantly updated . External
CSS file has a .css file extension.
Ex. <link rel=“CSS” title=“Default”
href=“style.css” type=“text/css”
12
INLINE STYLE SHEET
13
INLINE STYLES
15
LET'S RE-WRITE THE EXAMPLE ONCE AGAIN, BUT HERE WE
WILL WRITE STYLE SHEET RULES ALONG WITH THE HTML
ELEMENTS USING STYLE ATTRIBUTE OF THOSE ELEMENTS
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p style="color:green;font-size:20px;">
</p>
</body>
16
</html>
The example
shows how to
change the
color and the
left margin of a
<h1> element
AN EXAMPLE OF HTML PAGE WITH INLINE
CSS WOULD LOOK LIKE THIS:
• <!DOCTYPE html>
• <html>
• <body style="background-color:black;">
• <h1 style="color:white;
• padding:30px;">HostingerTutorials</h1>
• <p style="color:white;">Something useful
• here.</p>
• </body>
• </html>
18
EMBEDDED OR INTERNAL STYLE