SlideShare a Scribd company logo
1 of 65
KickStart @ CSS
A Solution to Easy Learning And
Rapid Web Development
Overview
• CSS stands for Cascading Style Sheet.
• CSS is used to control the style of a web document in a simple and easy way.
• CSS handles the look and feel part of a web page.
• Using CSS, you 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,
 As well as a variety of other effects.
• CSS is easy to learn and understand but it provides powerful control over the
presentation of an HTML document.
Advantages
• CSS saves time - You can write CSS once and then reuse same sheet in multiple
HTML pages.
• Pages load faster - you do not need to write HTML tag attributes every time.
• Easy maintenance - To make a global change, simply change the style, and all
elements in all the web pages will be updated automatically.
• Superior styles to HTML - CSS has a much wider array of attributes than HTML.
• Multiple Device Compatibility - Style sheets allow content to be optimized for
more than one type of device
• Global web standards - Now HTML attributes are being deprecated and it is being
recommended to use CSS.
Syntax
• A CSS comprises of style rules that are interpreted by the browser and then
applied to the corresponding elements in your document. A style rule is made of
three parts:
 Selector: A selector is an HTML tag at which style will be applied. This could be any tag
like <h1> or <table> etc.
 Property: A property is a type of attribute of HTML tag. Put simply, all the HTML
attributes are converted into CSS properties. They could be color or border etc.
 Value: Values are assigned to properties. For example color property can have value
either red or #F1F1F1 etc.
• You can put CSS Style Rule Syntax as follows:
 selector { property: value }
 table{ border :1px solid #C00; }
Selectors Type
• The Type Selectors:
h1 {
color: #36CFFF;
}
• The Universal Selectors:
* {
color: #000000;
}
The Descendant Selectors:
ul em {
color: #000000;
}
The Class Selectors:
.black {
color: #000000;
}
Selectors Type
• The ID Selectors:
#black {
color: #000000;
}
• The Child Selectors:
body > p {
color: #000000;
}
• The Attribute Selectors:
input[type="text"]{
color: #000000;
}
Grouping Selectors
• This define style rule will be applicable to h1, h2 and h3 element as well. The order
of the list is irrelevant.
h1, h2, h3 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}
• You can combine various class selectors together
#content, #footer, #supplement {
position: absolute;
left: 510px;
width: 200px;
}
Multiple Style Rules
• You can define these rules to combine multiple properties and corresponding
values into a single block as defined in the following example:
h1 {
color: #36C;
font-weight: normal;
letter-spacing: .4em;
margin-bottom: 1em;
text-transform: lowercase;
}
 Here all the property and value pairs are separated by a semi colon (;).
Associating Styles
• There are four ways to associate styles with your HTML document.
– Embedded CSS
– Inline CSS
– External CSS
– Imported CSS
• Most commonly used methods are Inline CSS and External CSS.
Embedded CSS
• You can put your CSS rules into an HTML document using the <style> element. This
tag is placed inside <head>...</head> tags.
• Rules defined using this syntax will be applied to all the elements available in the
document.
<head>
<style type="text/css" media="...">
Style Rules
............
</style>
</head>
• Following is the example of embed CSS based on above syntax:
<head>
<style type="text/css" media="all">
h1{
color: #36C;
}
</style>
</head>
Inline CSS
• You can use style attribute of any HTML element to define style rules.
• These rules will be applied to that element only.
• The value of style attribute is a combination of style declarations separated by
semicolon (;).
• Here is the generic syntax:
<element style="...style rules....">
<h1 style ="color:#36C;"> This is inline CSS </h1>
• This will produce following result:
This is inline CSS
External CSS
• The <link> element can be used to include an external stylesheet file in your HTML
document.
• An external style sheet is a separate text file with .css extension.
• Here is the generic syntax of including external CSS file:
<head>
<link type="text/css" href="..." media="..." />
</head>
• Consider a simple style sheet file with a name mystyle.css
<head>
<link type="text/css" href="mystyle.css" media="all" />
</head>
Imported CSS
• Here @import is used to import an external style sheet in a manner similar to the
<link> element.
• Here is the generic syntax of @import rule.
<head>
<@import "URL";
</head>
 Here URL is the URL of the style sheet file having style rules.
• You can use another syntax as well:
<head>
<@import url("URL");
</head>
• Example:
<head>
@import "mystyle.css";
</head>
CSS Rules Overriding
• Here is the rule to override any Style Sheet Rule.
• Any inline style sheet takes highest priority. So it will override any rule defined in
<style>...</style> tags or rules defined in any external style sheet file.
• Any rule defined in <style>...</style> tags will override rules defined in any
external style sheet file.
• Any rule defined in external style sheet file takes lowest priority and rules defined
in this file will be applied only when above two rules are not applicable.
Measurement Units
• CSS supports a number of measurements including absolute units such as
 Inches
 Centimetres
 Points
• CSS supports relative measures such as
 percentages
 Em
• You need these values while specifying various measurements in your Style rules
• Example
 border="1px solid red".
Measurement Units
Unit Description Example
% Defines a measurement as a percentage relative to
another value, typically an enclosing element.
p {font-size: 16pt; line-height:
125%;}
cm Defines a measurement in centimeters. div {margin-bottom: 2cm;}
em A relative measurement for the height of a font in em
spaces. Because an em unit is equivalent to the size
of a given font, if you assign a font to 12pt, each
"em" unit would be 12pt; thus, 2em would be 24pt.
p {letter-spacing: 7em;}
ex This value defines a measurement relative to a font's
x-height. The x-height is determined by the height of
the font's lowercase letter x.
p {font-size: 24pt; line-height:
3ex;}
Measurement Units
Unit Description Example
in Defines a measurement in inches. p {word-spacing: .15in;}
mm Defines a measurement in millimeters. p {word-spacing: 15mm;}
pc Defines a measurement in picas. A pica is equivalent
to 12 points; thus, there are 6 picas per inch.
p {font-size: 20pc;}
pt Defines a measurement in points. A point is defined
as 1/72nd of an inch.
body {font-size: 18pt;}
px Defines a measurement in screen pixels. p {padding: 25px;}
Colors
• CSS uses color values to specify a color.
• Typically, these are used to set a color either for the foreground of an
element(i.e., its text) or else for the background of the element.
• They can also be used to affect the color of borders and other decorative effects.
• You can specify your color values in various formats.
Colors Formats
Format Syntax Example
Hex Code #RRGGBB FF0000
Short Hex Code #RGB #6A7
RGB % rgb(rrr%,ggg%,bbb%) rgb(50%,50%,50%)
RGB Absolute rgb(rrr,ggg,bbb) rgb(0,0,255)
keyword aqua, black, etc. red/RED
Hex Codes
• A hexadecimal is a 6 digit representation of a color.
• The first two digits(RR) represent a red value, the next two are a green value(GG),
and the last are the blue value(BB).
• A hexadecimal value can be taken from any graphics software like Adobe
Photoshop, Gimp or even using Advanced Paint Brush.
• Each hexadecimal code will be preceded by a pound or hash sign #.
Hex Codes
Setting Backgrounds using CSS
Background Properties
Properties Use
background-color Set the background color of an element
background-image Set the background image of an element
background-repeat Control the repetition of an image in the
background
background-position Control the position of an image in the
background
background-attachment Control the scrolling of an image in the
background
background property Shorthand to specify a number of other
background properties
Background Color
• The background-color property is used to set the background color of an element.
• Example:
<p style="background-color:yellow;">
This text has a yellow background color.
</p>
• This will produce following result:
Background Image
• The background-image property is used to set the background image of an
element.
• Example:
<h1 style="background-image:url(https://example.jpeg);">
This table has background image set.
</h1>
• Output:
Repeat Background Image
• The background-repeat property is used to control the repetition of an image in
the background.
• We repeat the background image if image is small.
• You can use no-repeat value for background-repeat property if you don't want to
repeat an image, in this case image will display only once.
• By default background-repeat property will have repeat value.
• To repeat the background image vertically use repeat-y.
• To repeat the background image horizontally use repeat-x.
• Example:
<h1 style="background-image:url(https://example.jpeg); background-repeat: repeat;">
This table has background image set.
</h1>
• Output:
Background Image Position
• The background-position property is used to control the position of an image in
the background.
• Example:
<h1 style="background-image:url(httpsexample.jpg); background-position:100px ;">
Background image positioned 100 pixels away from the left.
</h1>
• Output:
• Example:
<h1 style="background-image:url(httpsexample.jpg); background-position:100px 200px;">
Background image positioned 100 pixels away from the left and200 pixels from the top.
</h1>
• Output:
Background Attachment
• The background-attachment property is used to control the scrolling of an image in
the background.
• Background attachment determines whether a background image is fixed or scrolls
with the rest of the page.
• Example:
<p style="background-image:url(/images/pattern1.gif);
background-attachment:fixed;">
This parapgraph has fixed background image.
</p>
• Example:
<p style="background-image:url(/images/pattern1.gif);
background-attachment:scroll;">
This parapgraph has scrolling background image.
</p>
 You can use the background property to set all the background properties at once.
Setting Fonts Using CSS
Font Properties
Properties Use
font-family Change the face of a font
font-style Make a font italic or oblique
font-variant Create a small-caps effect
font-weight Increase or decrease how bold or light a
font appears
font-size Increase or decrease the size of a font
font property Specify a number of other font properties
Font Family
• The font-family property is used to change the face of a font.
• Example to set the font family of an element.
<p style="font-family:georgia,garamond,serif;">
This text is rendered in either georgia, garamond, or the default serif font depending on
which font you have at your system.
</p>
• Possible value could be any font family name.
• Output:
This text is rendered in either georgia, garamond, or the default serif font depending on which
font you have at your system.
Font Style
• The font-style property is used to make a font italic or oblique.
• Example to set the font style of an element.
<p style="font-style:italic;">
This text will be rendered in italic style
</p>
• Possible values are normal, italic and oblique.
• Output:
This text will be rendered in italic style
Font Variant
• The font-variant property is used to create a small-caps effect.
• Example to set the font variant of an element.
<p style="font-variant:small-caps;">
This text will be rendered as small caps
</p>
• Possible values are normal and small-caps.
• Output:
THIS TEXT WILL BE RENEDERED AS SMALL CAPS
Font Weight
• The font-weight property is used to increase or decrease how bold or light a font
appears.
• The font-weight property provides the functionality to specify how bold a font is.
• Example to set the font weight of an element.
<p style="font-weight:bold;">
This font is bold. </p>
<p style="font-weight:bolder;">
This font is bolder. </p>
<p style="font-weight:900;">
This font is 900 weight. </p>
• Output:
This font is bold.
This font is bolder.
This font is 900 weight.
• Possible values could be normal, bold, bolder, lighter,
100, 200, 300, 400, 500, 600, 700, 800, 900.
Font Size
• The font-size property is used to increase or decrease the size of a font.
• The font-size property is used to control the size of fonts.
• Example to set the font size of an element.
<p style="font-size:20px;">
This font size is 20 pixels </p>
<p style="font-size:small;">
This font size is small </p>
<p style="font-size:large;">
This font size is large </p>
• Output:
• Possible values could be xx-small, x-small, small, medium, large,
x-large, xx-large, smaller, larger, size in pixels or in %
Font Size Adjust
• This font-size-adjust property used to adjust the x-height to make fonts more
legible.
• Example to set the font size adjust of an element.
<p style="font-size-adjust:0.61;">
This text is using a font-size-adjust value.
</p>
• Output:
This text is using a font-size-adjust value.
• Possible value could be any number.
Shorthand Property
• The font property is used as shorthand to specify a number of other font
properties.
• Example:
<p style="font:italic small-caps bold 15px georgia;">
Applying all the properties on the text at once.
</p>
• Output:
APPLYING ALL THE PROPERTIES ON THE TEXT AT ONCE.
Manipulating Text Using CSS
Manipulating Text
Properties Use
color Set the color of a text
direction Set the text direction
letter-spacing Add or subtract space between the letters that make up a word
word-spacing Add or subtract space between the words of a sentence
text-indent Indent the text of a paragraph
text-align Align the text of a document
text-decoration Underline, overline, and strikethrough text
text-transform Capitalize text or convert text to uppercase or lowercase letters
white-space Control the flow and formatting of text
text-shadow Set the text shadow around a text
Text Color
• The color property is used to set the color of a text.
• Example to set the text color.
<p style="color:red;">
This text will be written in red.
</p>
• Possible value could be any color name in any valid format.
• Output:
This text will be written in red.
Text Direction
• The direction property is used to set the text direction.
• Example to set the direction of a text.
<p style="direction:rtl;">
This text will be rendered from right to left
</p>
• Possible values are ltr or rtl.
• Output:
This text will be rendered from right to left
Space Between Characters
• The letter-spacing property is used to add or subtract space between the letters
that make up a word.
• Example to set the space between characters.
<p style="letter-spacing:5px;">
This text is having space between letters.
</p>
• Possible values are normal or a number specifying space.
• Output:
T h i s t e x t i s h a v i n g s p a c e b e t w e e n l e t t e r s .
Space Between Words
• The word-spacing property is used to add or subtract space between the words of
a sentence.
• Example to set the space between words.
<p style="word-spacing:5px;">
This text is having space between words.
</p>
• Possible values are normal or a number specifying space.
• Output:
This text is having space between words.
Text Indent
• The text-indent property is used to indent the text of a paragraph.
• Example which demonstrates how to indent the first line of a paragraph.
<p style="text-indent:1cm;">
This text will have first line indented by 1cm
and this line will remain at its actual position
this is done by CSS text-indent property.
</p>
• Possible values are % or a number specifying indent space.
• Output:
This text will have first line indented by 1cm and this line will remain at its actual
position this is done by CSS text-indent property.
Text Alignment
• The text-align property is used to align the text of a document.
• Example which demonstrates how to align a text.
<p style="text-align:right;">
This will be right aligned.
</p>
<p style="text-align:center;">
This will be center aligned.
</p>
<p style="text-align:left;">
This will be left aligned.
</p>
• Possible values are left, right, center, justify.
• Output:
This will be right aligned.
This will be center aligned.
This will be left aligned.
Decorating The Text
• The text-decoration property is used to underline, overline, and strikethrough text.
• Example which demonstrates how to decorate a text.
<p style="text-decoration:underline;">
This will be underlined
</p>
<p style="text-decoration:line-through;">
This will be striked through.
</p>
<p style="text-decoration:overline;">
This will have a over line.
</p>
• Possible values are none, underline, overline, line-through, blink.
• Output:
This will be underlined
This will be striked through.
This will have a over line
Text Cases
• The text-transform property is used to capitalize text or convert text to uppercase
or lowercase letters.
• Example which demonstrates how to set the cases for a text.
<p style="text-transform:capitalize;">
This will be capitalized
</p>
<p style="text-transform:uppercase;">
This will be in uppercase
</p>
<p style="text-transform:lowercase;">
This will be in lowercase
</p>
• Possible values are none, capitalize, uppercase, lowercase.
• Output:
This Will Be Capitalized
THIS WILL BE IN UPPERCASE
this will be in lowercase
White Space Between Text
• The white-space property is used to handled white space inside an element.
• Example to handled white space inside an element.
<p style="white-space:pre;">
This text has a line break
and the white-space pre setting tells the browser to honor it
just like the HTML pre tag.
</p>
• Possible values are normal, pre, nowrap.
• Output:
This text has a line break
and the white-space pre setting tells the browser to honor it
just like the HTML pre tag.
Text Shadow
• The text-shadow property is used to set the shadow around a text.
• Example to set the shadow around a text.
<p style="text-shadow:4px 4px 8px blue;">
If your browser supports the CSS text-shadow property,
this text will have a blue shadow.
</p>
• This may not be supported by all the browsers.
• Output:
If your browser supports the CSS text-shadow property, this text will have a blue shadow.
CSS – Images
CSS – Images
• Images are very important part of any Web Page.
• Though it is not recommended to include lot of images but it is still important to
use good images wherever it is required.
• CSS plays a good role to control image display.
• You can set following image properties using CSS.
Image Border
• The border property of an image is used to set the width of an image border.
• This property can have a value in length or in %.
• A width of zero pixels means no border.
• Example:
<img style="border:0px;" src=“example.jpg" />
<br />
<img style="border:3px dashed red;" src=“example.jpg" />
• Output:
Image Height
• The height property of an image is used to set the height of an image.
• This property can have a value in length or in %.
• While giving value in %, it applies it in respect of the box in which an image is
available.
• Here is the example:
<img style="border:1px solid red; height:100px;“ src=" example.jpg " />
<br />
<img style="border:1px solid red; height:50%;" src=" example.jpg " />
• Output:
Image Width
• The width property of an image is used to set the width of an image.
• This property can have a value in length or in %.
• While giving value in %, it applies it in respect of the box in which an image is
available.
• Here is the example:
<img style="border:1px solid red; width:100px;“ src=" example.jpg " />
<br />
<img style="border:1px solid red; width:20%;" src=" example.jpg " />
• Output:
CSS – Links
• How to set different properties of a hyper link using CSS.
• You can set following properties of a hyper link:
The :link Signifies unvisited hyperlinks.
The :visited Signifies visited hyperlinks.
The :hover Signifies an element that currently has the user's mouse pointer hovering over it.
The :active Signifies an element on which the user is currently clicking.
• Usually these all properties are kept in the header part of HTML document.
 Remember a:hover MUST come after a:link and a:visited in the CSS definition in
order to be effective.
 Also, a:active MUST come after a:hover in the CSS definition as follows.
<style type="text/css">
a:link {color: #000000}
a:visited {color: #006600}
a:hover {color: #FFCC00}
a:active {color: #FF00CC}
</style>
CSS – Cursors
CSS – Cursors
• The cursor property of CSS allows you to specify the type of cursor that should be
displayed to the user.
• One good usage of this property is in using images for submit buttons on forms.
• By default, when a cursor hovers over a link, the cursor changed from a pointer to
a hand.
 For a submit button on a form this does not happen.
 Therefore, using the cursor property to change the cursor to a hand whenever someone
hovers over an image that is a submit button.
 This provides a visual clue that they can click it.
CSS – Cursors
Value Description
auto Shape of the cursor depends on the context area it is over. For example
an I over text, a hand over a link, and so on...
crosshair A crosshair or plus sign
default An arrow
pointer A pointing hand (in IE 4 this value is hand)
move The I bar
text The I bar
wait An hour glass
help A question mark or balloon, ideal for use over help buttons
<url> The source of a cursor image file
CSS – Cursors
Value Description
e-resize The cursor indicates that an edge of a box is to be moved right (east)
ne-resize The cursor indicates that an edge of a box is to be moved up and right
(north/east)
nw-resize The cursor indicates that an edge of a box is to be moved up and left
(north/west)
n-resize The cursor indicates that an edge of a box is to be moved up (north)
se-resize The cursor indicates that an edge of a box is to be moved down and right
(south/east)
sw-resize The cursor indicates that an edge of a box is to be moved down and left
(south/west)
s-resize The cursor indicates that an edge of a box is to be moved down (south)
w-resize The cursor indicates that an edge of a box is to be moved left (west)
Example
<p>Move the mouse over the words to see the cursor change:</p>
<div style="cursor:auto">Auto</div>
<div style="cursor:crosshair">Crosshair</div>
<div style="cursor:default">Default</div>
<div style="cursor:pointer">Pointer</div>
<div style="cursor:move">Move</div>
<div style="cursor:e-resize">e-resize</div>
<div style="cursor:ne-resize">ne-resize</div>
<div style="cursor:nw-resize">nw-resize</div>
<div style="cursor:n-resize">n-resize</div>
<div style="cursor:se-resize">se-resize</div>
<div style="cursor:sw-resize">sw-resize</div>
<div style="cursor:s-resize">s-resize</div>
<div style="cursor:w-resize">w-resize</div>
<div style="cursor:text">text</div>
<div style="cursor:wait">wait</div>
<div style="cursor:help">help</div>
Thank You For Your Patience!
Coming Soon…!
KickStart @ CSS3 Part-2
• CSS – Tables
• CSS – Borders
• CSS – Margins
• CSS - Lists
• CSS – Paddings
Thank You!
Queries?
https://twitter.com/umesh_agarwal1
https://fosswithumesh.wordpress.com
http://www.facebook.com/umeshagarwal007
https://github.com/umeshagarwal
umesh.agarwal1@gmail.com
Irc Nick - umesh

More Related Content

What's hot (20)

Css lecture notes
Css lecture notesCss lecture notes
Css lecture notes
 
Basic-CSS-tutorial
Basic-CSS-tutorialBasic-CSS-tutorial
Basic-CSS-tutorial
 
CSS notes
CSS notesCSS notes
CSS notes
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 
CSS Basics part One
CSS Basics part OneCSS Basics part One
CSS Basics part One
 
Responsive web design with html5 and css3
Responsive web design with html5 and css3Responsive web design with html5 and css3
Responsive web design with html5 and css3
 
Cascading style sheets - CSS
Cascading style sheets - CSSCascading style sheets - CSS
Cascading style sheets - CSS
 
Web Design Course: CSS lecture 2
Web Design Course: CSS  lecture 2Web Design Course: CSS  lecture 2
Web Design Course: CSS lecture 2
 
CSS ppt
CSS pptCSS ppt
CSS ppt
 
Css
CssCss
Css
 
Web Design Course: CSS lecture 5
Web Design Course: CSS  lecture 5Web Design Course: CSS  lecture 5
Web Design Course: CSS lecture 5
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
Cascading Style Sheets - CSS
Cascading Style Sheets - CSSCascading Style Sheets - CSS
Cascading Style Sheets - CSS
 
Css types internal, external and inline (1)
Css types internal, external and inline (1)Css types internal, external and inline (1)
Css types internal, external and inline (1)
 
CSS 101
CSS 101CSS 101
CSS 101
 
CSS
CSSCSS
CSS
 
Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)Cascading Style Sheets(CSS)
Cascading Style Sheets(CSS)
 
Css
CssCss
Css
 
Web Engineering - Introduction to CSS
Web Engineering - Introduction to CSSWeb Engineering - Introduction to CSS
Web Engineering - Introduction to CSS
 
Css introduction
Css  introductionCss  introduction
Css introduction
 

Similar to Kick start @ css

Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshMukesh Kumar
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1jeweltutin
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmithaps4
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheetssmitha273566
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxkarthiksmart21
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptxMattMarino13
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptxMattMarino13
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfelayelily
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2Sónia
 
Make Css easy : easy tips for css
Make Css easy : easy tips for cssMake Css easy : easy tips for css
Make Css easy : easy tips for cssshabab shihan
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptxMarwaAnany1
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxalvindalejoyosa1
 
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-14. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1Jyoti Yadav
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptxMattMarino13
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation Salman Memon
 

Similar to Kick start @ css (20)

CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
uptu web technology unit 2 Css
uptu web technology unit 2 Cssuptu web technology unit 2 Css
uptu web technology unit 2 Css
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
WEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptxWEB TECHNOLOGY Unit-2.pptx
WEB TECHNOLOGY Unit-2.pptx
 
Css
CssCss
Css
 
BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
CSS
CSSCSS
CSS
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
 
CSS
CSSCSS
CSS
 
basic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdfbasic programming language AND HTML CSS JAVApdf
basic programming language AND HTML CSS JAVApdf
 
Ifi7174 lesson2
Ifi7174 lesson2Ifi7174 lesson2
Ifi7174 lesson2
 
Make Css easy : easy tips for css
Make Css easy : easy tips for cssMake Css easy : easy tips for css
Make Css easy : easy tips for css
 
Web Programming-css.pptx
Web Programming-css.pptxWeb Programming-css.pptx
Web Programming-css.pptx
 
Cascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptxCascading Style Sheets for web browser.pptx
Cascading Style Sheets for web browser.pptx
 
4. Web Technology CSS Basics-1
4. Web Technology CSS Basics-14. Web Technology CSS Basics-1
4. Web Technology CSS Basics-1
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
 
Complete Lecture on Css presentation
Complete Lecture on Css presentation Complete Lecture on Css presentation
Complete Lecture on Css presentation
 

Recently uploaded

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1GloryAnnCastre1
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Developmentchesterberbo7
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 

Recently uploaded (20)

Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1Reading and Writing Skills 11 quarter 4 melc 1
Reading and Writing Skills 11 quarter 4 melc 1
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Using Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea DevelopmentUsing Grammatical Signals Suitable to Patterns of Idea Development
Using Grammatical Signals Suitable to Patterns of Idea Development
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 

Kick start @ css

  • 1. KickStart @ CSS A Solution to Easy Learning And Rapid Web Development
  • 2. Overview • CSS stands for Cascading Style Sheet. • CSS is used to control the style of a web document in a simple and easy way. • CSS handles the look and feel part of a web page. • Using CSS, you 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,  As well as a variety of other effects. • CSS is easy to learn and understand but it provides powerful control over the presentation of an HTML document.
  • 3. Advantages • CSS saves time - You can write CSS once and then reuse same sheet in multiple HTML pages. • Pages load faster - you do not need to write HTML tag attributes every time. • Easy maintenance - To make a global change, simply change the style, and all elements in all the web pages will be updated automatically. • Superior styles to HTML - CSS has a much wider array of attributes than HTML. • Multiple Device Compatibility - Style sheets allow content to be optimized for more than one type of device • Global web standards - Now HTML attributes are being deprecated and it is being recommended to use CSS.
  • 4. Syntax • A CSS comprises of style rules that are interpreted by the browser and then applied to the corresponding elements in your document. A style rule is made of three parts:  Selector: A selector is an HTML tag at which style will be applied. This could be any tag like <h1> or <table> etc.  Property: A property is a type of attribute of HTML tag. Put simply, all the HTML attributes are converted into CSS properties. They could be color or border etc.  Value: Values are assigned to properties. For example color property can have value either red or #F1F1F1 etc. • You can put CSS Style Rule Syntax as follows:  selector { property: value }  table{ border :1px solid #C00; }
  • 5. Selectors Type • The Type Selectors: h1 { color: #36CFFF; } • The Universal Selectors: * { color: #000000; } The Descendant Selectors: ul em { color: #000000; } The Class Selectors: .black { color: #000000; }
  • 6. Selectors Type • The ID Selectors: #black { color: #000000; } • The Child Selectors: body > p { color: #000000; } • The Attribute Selectors: input[type="text"]{ color: #000000; }
  • 7. Grouping Selectors • This define style rule will be applicable to h1, h2 and h3 element as well. The order of the list is irrelevant. h1, h2, h3 { color: #36C; font-weight: normal; letter-spacing: .4em; margin-bottom: 1em; text-transform: lowercase; } • You can combine various class selectors together #content, #footer, #supplement { position: absolute; left: 510px; width: 200px; }
  • 8. Multiple Style Rules • You can define these rules to combine multiple properties and corresponding values into a single block as defined in the following example: h1 { color: #36C; font-weight: normal; letter-spacing: .4em; margin-bottom: 1em; text-transform: lowercase; }  Here all the property and value pairs are separated by a semi colon (;).
  • 9. Associating Styles • There are four ways to associate styles with your HTML document. – Embedded CSS – Inline CSS – External CSS – Imported CSS • Most commonly used methods are Inline CSS and External CSS.
  • 10. Embedded CSS • You can put your CSS rules into an HTML document using the <style> element. This tag is placed inside <head>...</head> tags. • Rules defined using this syntax will be applied to all the elements available in the document. <head> <style type="text/css" media="..."> Style Rules ............ </style> </head> • Following is the example of embed CSS based on above syntax: <head> <style type="text/css" media="all"> h1{ color: #36C; } </style> </head>
  • 11. Inline CSS • You can use style attribute of any HTML element to define style rules. • These rules will be applied to that element only. • The value of style attribute is a combination of style declarations separated by semicolon (;). • Here is the generic syntax: <element style="...style rules...."> <h1 style ="color:#36C;"> This is inline CSS </h1> • This will produce following result: This is inline CSS
  • 12. External CSS • The <link> element can be used to include an external stylesheet file in your HTML document. • An external style sheet is a separate text file with .css extension. • Here is the generic syntax of including external CSS file: <head> <link type="text/css" href="..." media="..." /> </head> • Consider a simple style sheet file with a name mystyle.css <head> <link type="text/css" href="mystyle.css" media="all" /> </head>
  • 13. Imported CSS • Here @import is used to import an external style sheet in a manner similar to the <link> element. • Here is the generic syntax of @import rule. <head> <@import "URL"; </head>  Here URL is the URL of the style sheet file having style rules. • You can use another syntax as well: <head> <@import url("URL"); </head> • Example: <head> @import "mystyle.css"; </head>
  • 14. CSS Rules Overriding • Here is the rule to override any Style Sheet Rule. • Any inline style sheet takes highest priority. So it will override any rule defined in <style>...</style> tags or rules defined in any external style sheet file. • Any rule defined in <style>...</style> tags will override rules defined in any external style sheet file. • Any rule defined in external style sheet file takes lowest priority and rules defined in this file will be applied only when above two rules are not applicable.
  • 15. Measurement Units • CSS supports a number of measurements including absolute units such as  Inches  Centimetres  Points • CSS supports relative measures such as  percentages  Em • You need these values while specifying various measurements in your Style rules • Example  border="1px solid red".
  • 16. Measurement Units Unit Description Example % Defines a measurement as a percentage relative to another value, typically an enclosing element. p {font-size: 16pt; line-height: 125%;} cm Defines a measurement in centimeters. div {margin-bottom: 2cm;} em A relative measurement for the height of a font in em spaces. Because an em unit is equivalent to the size of a given font, if you assign a font to 12pt, each "em" unit would be 12pt; thus, 2em would be 24pt. p {letter-spacing: 7em;} ex This value defines a measurement relative to a font's x-height. The x-height is determined by the height of the font's lowercase letter x. p {font-size: 24pt; line-height: 3ex;}
  • 17. Measurement Units Unit Description Example in Defines a measurement in inches. p {word-spacing: .15in;} mm Defines a measurement in millimeters. p {word-spacing: 15mm;} pc Defines a measurement in picas. A pica is equivalent to 12 points; thus, there are 6 picas per inch. p {font-size: 20pc;} pt Defines a measurement in points. A point is defined as 1/72nd of an inch. body {font-size: 18pt;} px Defines a measurement in screen pixels. p {padding: 25px;}
  • 18. Colors • CSS uses color values to specify a color. • Typically, these are used to set a color either for the foreground of an element(i.e., its text) or else for the background of the element. • They can also be used to affect the color of borders and other decorative effects. • You can specify your color values in various formats.
  • 19. Colors Formats Format Syntax Example Hex Code #RRGGBB FF0000 Short Hex Code #RGB #6A7 RGB % rgb(rrr%,ggg%,bbb%) rgb(50%,50%,50%) RGB Absolute rgb(rrr,ggg,bbb) rgb(0,0,255) keyword aqua, black, etc. red/RED
  • 20. Hex Codes • A hexadecimal is a 6 digit representation of a color. • The first two digits(RR) represent a red value, the next two are a green value(GG), and the last are the blue value(BB). • A hexadecimal value can be taken from any graphics software like Adobe Photoshop, Gimp or even using Advanced Paint Brush. • Each hexadecimal code will be preceded by a pound or hash sign #.
  • 23. Background Properties Properties Use background-color Set the background color of an element background-image Set the background image of an element background-repeat Control the repetition of an image in the background background-position Control the position of an image in the background background-attachment Control the scrolling of an image in the background background property Shorthand to specify a number of other background properties
  • 24. Background Color • The background-color property is used to set the background color of an element. • Example: <p style="background-color:yellow;"> This text has a yellow background color. </p> • This will produce following result:
  • 25. Background Image • The background-image property is used to set the background image of an element. • Example: <h1 style="background-image:url(https://example.jpeg);"> This table has background image set. </h1> • Output:
  • 26. Repeat Background Image • The background-repeat property is used to control the repetition of an image in the background. • We repeat the background image if image is small. • You can use no-repeat value for background-repeat property if you don't want to repeat an image, in this case image will display only once. • By default background-repeat property will have repeat value. • To repeat the background image vertically use repeat-y. • To repeat the background image horizontally use repeat-x. • Example: <h1 style="background-image:url(https://example.jpeg); background-repeat: repeat;"> This table has background image set. </h1> • Output:
  • 27. Background Image Position • The background-position property is used to control the position of an image in the background. • Example: <h1 style="background-image:url(httpsexample.jpg); background-position:100px ;"> Background image positioned 100 pixels away from the left. </h1> • Output: • Example: <h1 style="background-image:url(httpsexample.jpg); background-position:100px 200px;"> Background image positioned 100 pixels away from the left and200 pixels from the top. </h1> • Output:
  • 28. Background Attachment • The background-attachment property is used to control the scrolling of an image in the background. • Background attachment determines whether a background image is fixed or scrolls with the rest of the page. • Example: <p style="background-image:url(/images/pattern1.gif); background-attachment:fixed;"> This parapgraph has fixed background image. </p> • Example: <p style="background-image:url(/images/pattern1.gif); background-attachment:scroll;"> This parapgraph has scrolling background image. </p>  You can use the background property to set all the background properties at once.
  • 30. Font Properties Properties Use font-family Change the face of a font font-style Make a font italic or oblique font-variant Create a small-caps effect font-weight Increase or decrease how bold or light a font appears font-size Increase or decrease the size of a font font property Specify a number of other font properties
  • 31. Font Family • The font-family property is used to change the face of a font. • Example to set the font family of an element. <p style="font-family:georgia,garamond,serif;"> This text is rendered in either georgia, garamond, or the default serif font depending on which font you have at your system. </p> • Possible value could be any font family name. • Output: This text is rendered in either georgia, garamond, or the default serif font depending on which font you have at your system.
  • 32. Font Style • The font-style property is used to make a font italic or oblique. • Example to set the font style of an element. <p style="font-style:italic;"> This text will be rendered in italic style </p> • Possible values are normal, italic and oblique. • Output: This text will be rendered in italic style
  • 33. Font Variant • The font-variant property is used to create a small-caps effect. • Example to set the font variant of an element. <p style="font-variant:small-caps;"> This text will be rendered as small caps </p> • Possible values are normal and small-caps. • Output: THIS TEXT WILL BE RENEDERED AS SMALL CAPS
  • 34. Font Weight • The font-weight property is used to increase or decrease how bold or light a font appears. • The font-weight property provides the functionality to specify how bold a font is. • Example to set the font weight of an element. <p style="font-weight:bold;"> This font is bold. </p> <p style="font-weight:bolder;"> This font is bolder. </p> <p style="font-weight:900;"> This font is 900 weight. </p> • Output: This font is bold. This font is bolder. This font is 900 weight. • Possible values could be normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900.
  • 35. Font Size • The font-size property is used to increase or decrease the size of a font. • The font-size property is used to control the size of fonts. • Example to set the font size of an element. <p style="font-size:20px;"> This font size is 20 pixels </p> <p style="font-size:small;"> This font size is small </p> <p style="font-size:large;"> This font size is large </p> • Output: • Possible values could be xx-small, x-small, small, medium, large, x-large, xx-large, smaller, larger, size in pixels or in %
  • 36. Font Size Adjust • This font-size-adjust property used to adjust the x-height to make fonts more legible. • Example to set the font size adjust of an element. <p style="font-size-adjust:0.61;"> This text is using a font-size-adjust value. </p> • Output: This text is using a font-size-adjust value. • Possible value could be any number.
  • 37. Shorthand Property • The font property is used as shorthand to specify a number of other font properties. • Example: <p style="font:italic small-caps bold 15px georgia;"> Applying all the properties on the text at once. </p> • Output: APPLYING ALL THE PROPERTIES ON THE TEXT AT ONCE.
  • 39. Manipulating Text Properties Use color Set the color of a text direction Set the text direction letter-spacing Add or subtract space between the letters that make up a word word-spacing Add or subtract space between the words of a sentence text-indent Indent the text of a paragraph text-align Align the text of a document text-decoration Underline, overline, and strikethrough text text-transform Capitalize text or convert text to uppercase or lowercase letters white-space Control the flow and formatting of text text-shadow Set the text shadow around a text
  • 40. Text Color • The color property is used to set the color of a text. • Example to set the text color. <p style="color:red;"> This text will be written in red. </p> • Possible value could be any color name in any valid format. • Output: This text will be written in red.
  • 41. Text Direction • The direction property is used to set the text direction. • Example to set the direction of a text. <p style="direction:rtl;"> This text will be rendered from right to left </p> • Possible values are ltr or rtl. • Output: This text will be rendered from right to left
  • 42. Space Between Characters • The letter-spacing property is used to add or subtract space between the letters that make up a word. • Example to set the space between characters. <p style="letter-spacing:5px;"> This text is having space between letters. </p> • Possible values are normal or a number specifying space. • Output: T h i s t e x t i s h a v i n g s p a c e b e t w e e n l e t t e r s .
  • 43. Space Between Words • The word-spacing property is used to add or subtract space between the words of a sentence. • Example to set the space between words. <p style="word-spacing:5px;"> This text is having space between words. </p> • Possible values are normal or a number specifying space. • Output: This text is having space between words.
  • 44. Text Indent • The text-indent property is used to indent the text of a paragraph. • Example which demonstrates how to indent the first line of a paragraph. <p style="text-indent:1cm;"> This text will have first line indented by 1cm and this line will remain at its actual position this is done by CSS text-indent property. </p> • Possible values are % or a number specifying indent space. • Output: This text will have first line indented by 1cm and this line will remain at its actual position this is done by CSS text-indent property.
  • 45. Text Alignment • The text-align property is used to align the text of a document. • Example which demonstrates how to align a text. <p style="text-align:right;"> This will be right aligned. </p> <p style="text-align:center;"> This will be center aligned. </p> <p style="text-align:left;"> This will be left aligned. </p> • Possible values are left, right, center, justify. • Output: This will be right aligned. This will be center aligned. This will be left aligned.
  • 46. Decorating The Text • The text-decoration property is used to underline, overline, and strikethrough text. • Example which demonstrates how to decorate a text. <p style="text-decoration:underline;"> This will be underlined </p> <p style="text-decoration:line-through;"> This will be striked through. </p> <p style="text-decoration:overline;"> This will have a over line. </p> • Possible values are none, underline, overline, line-through, blink. • Output: This will be underlined This will be striked through. This will have a over line
  • 47. Text Cases • The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters. • Example which demonstrates how to set the cases for a text. <p style="text-transform:capitalize;"> This will be capitalized </p> <p style="text-transform:uppercase;"> This will be in uppercase </p> <p style="text-transform:lowercase;"> This will be in lowercase </p> • Possible values are none, capitalize, uppercase, lowercase. • Output: This Will Be Capitalized THIS WILL BE IN UPPERCASE this will be in lowercase
  • 48. White Space Between Text • The white-space property is used to handled white space inside an element. • Example to handled white space inside an element. <p style="white-space:pre;"> This text has a line break and the white-space pre setting tells the browser to honor it just like the HTML pre tag. </p> • Possible values are normal, pre, nowrap. • Output: This text has a line break and the white-space pre setting tells the browser to honor it just like the HTML pre tag.
  • 49. Text Shadow • The text-shadow property is used to set the shadow around a text. • Example to set the shadow around a text. <p style="text-shadow:4px 4px 8px blue;"> If your browser supports the CSS text-shadow property, this text will have a blue shadow. </p> • This may not be supported by all the browsers. • Output: If your browser supports the CSS text-shadow property, this text will have a blue shadow.
  • 51. CSS – Images • Images are very important part of any Web Page. • Though it is not recommended to include lot of images but it is still important to use good images wherever it is required. • CSS plays a good role to control image display. • You can set following image properties using CSS.
  • 52. Image Border • The border property of an image is used to set the width of an image border. • This property can have a value in length or in %. • A width of zero pixels means no border. • Example: <img style="border:0px;" src=“example.jpg" /> <br /> <img style="border:3px dashed red;" src=“example.jpg" /> • Output:
  • 53. Image Height • The height property of an image is used to set the height of an image. • This property can have a value in length or in %. • While giving value in %, it applies it in respect of the box in which an image is available. • Here is the example: <img style="border:1px solid red; height:100px;“ src=" example.jpg " /> <br /> <img style="border:1px solid red; height:50%;" src=" example.jpg " /> • Output:
  • 54. Image Width • The width property of an image is used to set the width of an image. • This property can have a value in length or in %. • While giving value in %, it applies it in respect of the box in which an image is available. • Here is the example: <img style="border:1px solid red; width:100px;“ src=" example.jpg " /> <br /> <img style="border:1px solid red; width:20%;" src=" example.jpg " /> • Output:
  • 55. CSS – Links • How to set different properties of a hyper link using CSS. • You can set following properties of a hyper link: The :link Signifies unvisited hyperlinks. The :visited Signifies visited hyperlinks. The :hover Signifies an element that currently has the user's mouse pointer hovering over it. The :active Signifies an element on which the user is currently clicking. • Usually these all properties are kept in the header part of HTML document.  Remember a:hover MUST come after a:link and a:visited in the CSS definition in order to be effective.  Also, a:active MUST come after a:hover in the CSS definition as follows. <style type="text/css"> a:link {color: #000000} a:visited {color: #006600} a:hover {color: #FFCC00} a:active {color: #FF00CC} </style>
  • 57. CSS – Cursors • The cursor property of CSS allows you to specify the type of cursor that should be displayed to the user. • One good usage of this property is in using images for submit buttons on forms. • By default, when a cursor hovers over a link, the cursor changed from a pointer to a hand.  For a submit button on a form this does not happen.  Therefore, using the cursor property to change the cursor to a hand whenever someone hovers over an image that is a submit button.  This provides a visual clue that they can click it.
  • 58. CSS – Cursors Value Description auto Shape of the cursor depends on the context area it is over. For example an I over text, a hand over a link, and so on... crosshair A crosshair or plus sign default An arrow pointer A pointing hand (in IE 4 this value is hand) move The I bar text The I bar wait An hour glass help A question mark or balloon, ideal for use over help buttons <url> The source of a cursor image file
  • 59. CSS – Cursors Value Description e-resize The cursor indicates that an edge of a box is to be moved right (east) ne-resize The cursor indicates that an edge of a box is to be moved up and right (north/east) nw-resize The cursor indicates that an edge of a box is to be moved up and left (north/west) n-resize The cursor indicates that an edge of a box is to be moved up (north) se-resize The cursor indicates that an edge of a box is to be moved down and right (south/east) sw-resize The cursor indicates that an edge of a box is to be moved down and left (south/west) s-resize The cursor indicates that an edge of a box is to be moved down (south) w-resize The cursor indicates that an edge of a box is to be moved left (west)
  • 60. Example <p>Move the mouse over the words to see the cursor change:</p> <div style="cursor:auto">Auto</div> <div style="cursor:crosshair">Crosshair</div> <div style="cursor:default">Default</div> <div style="cursor:pointer">Pointer</div> <div style="cursor:move">Move</div> <div style="cursor:e-resize">e-resize</div> <div style="cursor:ne-resize">ne-resize</div> <div style="cursor:nw-resize">nw-resize</div> <div style="cursor:n-resize">n-resize</div> <div style="cursor:se-resize">se-resize</div> <div style="cursor:sw-resize">sw-resize</div> <div style="cursor:s-resize">s-resize</div> <div style="cursor:w-resize">w-resize</div> <div style="cursor:text">text</div> <div style="cursor:wait">wait</div> <div style="cursor:help">help</div>
  • 61. Thank You For Your Patience!
  • 63. KickStart @ CSS3 Part-2 • CSS – Tables • CSS – Borders • CSS – Margins • CSS - Lists • CSS – Paddings