Thanks to visit codestin.com
Credit goes to www.slideshare.net

U.SHANMUGARAJAN
I –M.Sc (CS)
1
8-Apr-17
What is CSS
 Cascading Style Sheets are known as CSS.
 CSS handles the look and feel part of a web
page. Using CSS, we can control the color of
the text, the style of fonts, the spacing
between paragraphs, how columns are sized
and laid out, what background images or
colors are used and etc.,
2
Advantages of CSS
 CSS saves time
 Easy maintenance
 Multiple Device Compatibility
 Pages load faster
 Platform Independence
3
CSS Versions
 CSS1 was came out in Dec 1996. This version
describes the CSS language as well as a
simple visual formatting model for all the HTML
tags.
 CSS2 was came out in May 1998.This version
adds support for media-specific style sheets
e.g. printers, element positioning and tables.
 CSS3 was came out in June 1999.This version
adds new features in color, Transform,
rounded corners
4
Creating and Applying Styles
 There are three ways of inserting a style sheet:
 Inline (HTML Tags)
 Internal Style sheets
 External Style sheets
5
Inline styles
 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
<h1 style="color:blue;margin-left:30px;">This is a heading</h1>
6
Internal Style Sheet
 An internal style sheet may be used if one
single page has a unique style.
 Internal styles are defined within the <style>
element, inside the <head> section of an
HTML page:
 This makes it easy to apply styles like classes
or id's in order to reuse the code.
7
example
<head>
<style>
body {
background-color: Silver;
}
h1 {
color: red;
margin-left: 40px;
}
</style>
</head>
8
External style sheets
 With an external style sheet, you can change
the look of an entire website by changing just
one file.
 Each page must include a reference to the
external style sheet file inside the <link>
element. The <link> element goes inside the
<head> section.
<link rel="stylesheet" type="text/css" href="mystyle.css"
9
Style Builder
 Style Builder is Microsoft’s way to quickly
apply styles to our web documents.
 It’s a dialog box with a number of screens that
allow us to modify the appearance of text and
objects in web documents.
10
Applying Styles using style Builder
 Highlight the item where we want to apply the
style.
 Right click and select Build style.
 Change the style settings to any desired
setting within the style builder
 Select OK to apply style.
11
Style Builder
 The dialog box has the eight types of styles .
1) Font 5) Layout
2) Background 6) Edges
3) Text 7) Lists
4) Position 8) Other
12
Style Builder
13
CSS Basic Syntax
selector { property:value; property:value; }
selector,selector { property:value; }
selector.class { property:value }
selector#id { property:value }
14
CSS-Text
Property name example Possible values
Color color: value; color name, hexadecimal
number
Letter Spacing letter-spacing: value; normal, Length
Text Align text-align: value; left, right, center, justify
Text Decoration text-decoration: value; None, underline, overline,
line through, blink
Text Transform text-transform: value; None, capitalize, lowercase,
uppercase
Word Spacing word-spacing: value; Normal, length
15
CSS-Font
Property name example Possible values
Font Size font-size: value; length
Font Style font-style: value; normal, italic, oblique
Font Variant font-variant: value; normal, small-caps
Font Weight Font-weight: value; Lighter, normal, 100, 200,
300, 400, 500, 600, 700,
800, 900, bold, bolder
16
CSS-Margin
Property name example
margin margin:10px
margin:10px 15px 10px 15px
margin-bottom margin-bottom:10px
margin-top margin-top:10px
margin-left margin-left:10px
margin-right margin-right:10px
17
CSS-Border
Property name example
border border: 1px solid #333333;
border-color border-color: red;
border-style border-style: value;
Values be dashed, dotted, double, groove,
hidden, inset, none, outset, ridge, solid
border-width border-width: value;
18
CSS Anchors and Links <a>
Property name and description example
a:link
sets the color of a link when no event is
occurred
a:link {color: #009900;}
a:visited
Sets the color of a link when the user has
already visited
a:visited {color: #999999;}
a:hover
sets the color of a link when user places
their mouse pointer over the link
a:hover {color: #333333;}
a:focus
same purpose as the last one, but this one
is for users that are not using a mouse
and are tabbing through the links via there
keyboards tab key
a:focus {color: #333333;}
19
THANK YOU
20

Css

  • 1.
  • 2.
    What is CSS Cascading Style Sheets are known as CSS.  CSS handles the look and feel part of a web page. Using CSS, we can control the color of the text, the style of fonts, the spacing between paragraphs, how columns are sized and laid out, what background images or colors are used and etc., 2
  • 3.
    Advantages of CSS CSS saves time  Easy maintenance  Multiple Device Compatibility  Pages load faster  Platform Independence 3
  • 4.
    CSS Versions  CSS1was came out in Dec 1996. This version describes the CSS language as well as a simple visual formatting model for all the HTML tags.  CSS2 was came out in May 1998.This version adds support for media-specific style sheets e.g. printers, element positioning and tables.  CSS3 was came out in June 1999.This version adds new features in color, Transform, rounded corners 4
  • 5.
    Creating and ApplyingStyles  There are three ways of inserting a style sheet:  Inline (HTML Tags)  Internal Style sheets  External Style sheets 5
  • 6.
    Inline styles  Aninline 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 <h1 style="color:blue;margin-left:30px;">This is a heading</h1> 6
  • 7.
    Internal Style Sheet An internal style sheet may be used if one single page has a unique style.  Internal styles are defined within the <style> element, inside the <head> section of an HTML page:  This makes it easy to apply styles like classes or id's in order to reuse the code. 7
  • 8.
    example <head> <style> body { background-color: Silver; } h1{ color: red; margin-left: 40px; } </style> </head> 8
  • 9.
    External style sheets With an external style sheet, you can change the look of an entire website by changing just one file.  Each page must include a reference to the external style sheet file inside the <link> element. The <link> element goes inside the <head> section. <link rel="stylesheet" type="text/css" href="mystyle.css" 9
  • 10.
    Style Builder  StyleBuilder is Microsoft’s way to quickly apply styles to our web documents.  It’s a dialog box with a number of screens that allow us to modify the appearance of text and objects in web documents. 10
  • 11.
    Applying Styles usingstyle Builder  Highlight the item where we want to apply the style.  Right click and select Build style.  Change the style settings to any desired setting within the style builder  Select OK to apply style. 11
  • 12.
    Style Builder  Thedialog box has the eight types of styles . 1) Font 5) Layout 2) Background 6) Edges 3) Text 7) Lists 4) Position 8) Other 12
  • 13.
  • 14.
    CSS Basic Syntax selector{ property:value; property:value; } selector,selector { property:value; } selector.class { property:value } selector#id { property:value } 14
  • 15.
    CSS-Text Property name examplePossible values Color color: value; color name, hexadecimal number Letter Spacing letter-spacing: value; normal, Length Text Align text-align: value; left, right, center, justify Text Decoration text-decoration: value; None, underline, overline, line through, blink Text Transform text-transform: value; None, capitalize, lowercase, uppercase Word Spacing word-spacing: value; Normal, length 15
  • 16.
    CSS-Font Property name examplePossible values Font Size font-size: value; length Font Style font-style: value; normal, italic, oblique Font Variant font-variant: value; normal, small-caps Font Weight Font-weight: value; Lighter, normal, 100, 200, 300, 400, 500, 600, 700, 800, 900, bold, bolder 16
  • 17.
    CSS-Margin Property name example marginmargin:10px margin:10px 15px 10px 15px margin-bottom margin-bottom:10px margin-top margin-top:10px margin-left margin-left:10px margin-right margin-right:10px 17
  • 18.
    CSS-Border Property name example borderborder: 1px solid #333333; border-color border-color: red; border-style border-style: value; Values be dashed, dotted, double, groove, hidden, inset, none, outset, ridge, solid border-width border-width: value; 18
  • 19.
    CSS Anchors andLinks <a> Property name and description example a:link sets the color of a link when no event is occurred a:link {color: #009900;} a:visited Sets the color of a link when the user has already visited a:visited {color: #999999;} a:hover sets the color of a link when user places their mouse pointer over the link a:hover {color: #333333;} a:focus same purpose as the last one, but this one is for users that are not using a mouse and are tabbing through the links via there keyboards tab key a:focus {color: #333333;} 19
  • 20.