INTRODUCTION TO CSS
To :-
By:- Swarnim Gottlieb
Mr.Sanju Mahawar Sir Prince Ramanan
What Is CSS ??
Cascading Style Sheet(CSS)
• A Cascading style sheet(CSS) is a web page derived from multiple sources with a
defined order of precedence where the defmition of any style element conflict.
• CSS saves a lot of work
• CSS define how HTML elements are to be displayed
Syntax Of CSS
• A CSS rule set consist of a selector and a declaration block.
Selector Declaration Declaration
Property Value Property Value
• The selector points to the HTML element you want to style
• The Declaration block contains one or more declarations separated by semicolons.
• Each declaration includes a property name and a value, separated by a colon.
TYPES OF CSS
There are 3 types of CSS styles declaration are as follows:
1. Internal(Embedded) Styles
2. Inline Styles
3. External Styles Internal (Embedded)Styles
Internal styles are placed inside the head section of a particular web page via the style
tag. Internal styles are also called "Embedded" styles . Inline Styles
Inline styles are placed directly inside an HTML element in the code.
External Styles An external style sheet is a separate page which is then linked to the web
page.
CSS Color Font Style
<!DOCTYPE html>
<html>
<head>
<style>
• The CSS color property defines
h1 {
the text color to be used
color: blue;
font-family: verdana;
• The CSS font-family property defines the font font-size: 300%;
to be used. }
p {
color: red;
• The CSS font-size property defines the text
size to be used. font-family: courier;
font-size: 160%;
}
</style>
</head>
<body>
<h1></h1>
<p>.</p>
</body>
</html>
CSS Border
• The CSS border property defines a border around an HTML element
p {
border: 2px solid powderblue;
}
CSS Padding
The CSS padding property defines a padding (space) between the text and the border.
p {
border: 2px solid powderblue;
padding: 30px;
}
»
CSS Margin
The CSS margin property defines a margin (space) outside the border.
• p {
border: 2px solid powderblue;
margin: 50px;
}
• THANK YOU