0% found this document useful (0 votes)
70 views

Introduction To CSS: By:-Swarnim Gottlieb Prince Ramanan

CSS (Cascading Style Sheets) allows you to define styles for HTML elements, including how they are displayed. There are three types of CSS styles: internal/embedded styles defined within HTML <style> tags; inline styles defined within individual HTML elements; and external styles defined in an external .css file and linked to the HTML page. CSS rules contain a selector that points to the element being styled and a declaration block with property-value pairs that define styles like color, font, size, border, padding, and margin. CSS can be used to style text, fonts, borders, spacing, and layout of HTML elements.

Uploaded by

Swarnim Gottlieb
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Introduction To CSS: By:-Swarnim Gottlieb Prince Ramanan

CSS (Cascading Style Sheets) allows you to define styles for HTML elements, including how they are displayed. There are three types of CSS styles: internal/embedded styles defined within HTML <style> tags; inline styles defined within individual HTML elements; and external styles defined in an external .css file and linked to the HTML page. CSS rules contain a selector that points to the element being styled and a declaration block with property-value pairs that define styles like color, font, size, border, padding, and margin. CSS can be used to style text, fonts, borders, spacing, and layout of HTML elements.

Uploaded by

Swarnim Gottlieb
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

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

You might also like