SlideShare a Scribd company logo
1 of 67
Web Technology
The Women University Multan
Cascading style sheet
• Cascading Style Sheets (CSS) is a simple mechanism for
adding style
1. Fonts
2. Colors
3. Spacing
to Web documents
Developed By
Håkon Wium Lie
Syntax
 A CSS rule-set consists of a selector and a declaration block:
 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 CSS property name and a value,
separated by a colon.
 A CSS declaration always ends with a semicolon, and
declaration blocks are surrounded by curly braces.
 In the following example all <p> elements will be center-
aligned, with a red text color:
Syntax
Sources of Style
 External
 Internal
 Inline
Inline style sheet
• Inline styles are CSS styles that are applied to one
element, directly in the page's HTML, using the style
attribute
• The inline style uses the HTML "style" attribute. This
allows CSS properties on a "per tag" basis.
How to Write an Inline Style
 You write your style property similar to
how you would in a style sheet, but it
needs to be all one line.
 Separate multiple properties with a
semi-colon just as you would in a style
sheet
Advantages of Inline Styles
1. Inline styles are easy and quick to add you
2. Do not need to worry about writing the
proper CSS
3. You don't need to create a whole new
document
4. just add the style attribute that is valid on
nearly every HTML element.
Disadvantages of Inline Styles
• They can over-ride things you didn't intend
them to
• They cause problems and make the
pages a lot more work to maintain
Inline Styles Are Not Best Practice
Inline styles don't separate content
from design
Inline styles cause more maintenance
headaches
inline styles make your pages bigger
Inline styles are not as accessible
Inline Style Sheet
• An inline CSS is used to apply a unique style to a
single HTML element.
• An inline CSS uses the style attribute of an HTML
element.
• Example
<h1 style="color:blue;">This is a Blue Heading</h1>
Syntax use to create an inline style
<element-name style="property: value;">
In the above: element-name refers to the targetted HTML element
• property refers to a CSS property
• value refers to an associated CSS value
• Multiple CSS property/value pairs can be used in the same style attribute.
This is demonstrated by the following syntax:
<element-name style="property: value; property: value; property:
value;">
Here's a few things to remember about inline CSS
syntax:
• The property and its associated value are separated by
a colon (:)
• Each property/value pair ends with a semi-colon (;)
• When using multiple word values, the multiple word
string must be enclosed in single quotation marks to
avoid prematurely ending the style attribute
Heading
<h1 style="color:blue;">This is a Blue
Heading</h1>
This is a Blue Heading
Background color
This value sets the background color for the current element.
A 'background-color' can be specified either alone or in
conjunction with a 'background-image'. When used with a
background image, it can still serve several purposes:
• 1) to fill transparent regions of the background image
• 2) for display while the background image is loading
• 3) the browser has image loading capability turned off
• 4) if the background image display settings will not cover all
of the browser display area.
Format
<body STYLE="background-color:
blue">text</body>
Background Image
• This value indicates the URL source for the graphic. If this
property is present
• 'background-repeat‘
• 'background-attachment'
• 'background-position'
Background Image
<body STYLE="background-image:
url(image.gif)">text</body>
Background repeat
• If a 'background-image' is specified, this value
specifies how the image is repeated if the
image is not large enough to cover the entire
element. All image rendering covers the
content and padding areas of the element's
box.
Allowed Values
• Repeat
Image is repeated (tiled) both vertically and
horizontally.
• repeat-x
Image is repeated (tiled) horizontally only (to
the left and right) of the originating position.
Allowed Values
• repeat-y
Image is repeated (tiled) vertically only
(upwards and downwards) of the originating
position.
• no-repeat
Image is not repeated. Only a single
occurrence of the background image behind
the current element is used, at the specified
position.
Format
<body STYLE="background-image:
url(http://www.foo.com/image.gif);
background-repeat: repeat-y">text</body>
Background Attachment
• if a 'background-image' is specified, this value
indicates whether or not the background image will
move when the browser window is scrolled to view
text outside the current display area.
• Fixed
• Scroll
Background Attachment
<body STYLE="background-image:
url(http://www.foo.com/image.gif);
background-attachment:
fixed">text</body>
Background Position
• The values for this property translate to space separated X/Y
coordinates of the browser window. Minimum values are at
the upper-left corner of the display area and maximum values
are at the lower-right corner. These values are normally
represented as a pair, but omitting a value is legal - the
missing value is assumed to be the y-axis coordinate and is set
to the default 'center' value.
Background Position
• Allowed Values
• X% Y%
• X Y
• (left|center|right) (top|center|bottom)
Format
• <body STYLE="background-image:
url(http://www.foo.com/image.gif);
background-position: center
top">text</body>
Font color
• This property describes the color of text within an element.
Values for the property outside the specified ranges will be
clipped or truncated to create a valid value.
Description:
This is a representation of the values for Red/Green/Blue
used to determine a final display color.
• <body STYLE="color: blue">text</body>
text
Font size
This attribute is used to change font size in
pixels
percentage
points
<h1 style="font-size: 11px; >Hello</h1>
Font Style
• Attribute use to change font Style
E.g
• Italic
• Bold
• Underlin
<h1font style= Italic>Hello</p1>
Font Family
Alignment of Text
• Alignment of text include
• Right
• Left
• Center
• <h1 align=center>Hello</h1>
Decoration of text
• Decoration of text
• Blink
• Underline
• Overline
• <h1text decoration:underline>Hello</h1>
Hello
Hyperlink
• a link from a hypertext document to another
location, activated by clicking on a highlighted
word or image.
Hyperlinks
a:link - a normal, unvisited link
a:visited - a link the user has visited
a:hover - a link when the user mouses
over it
a:active - a link the moment it is clicked
Hyperlinks
• <a href="http://www.csscreator.com/"
style="link, visited {color: red; text-
decoration: none; } hover {text-decoration:
none; color: blue; }" >Css Creator</a>
Underline/overline
• Underline/Overline
• <a href="http://www.csscreator.com/"
style="link, visited {color: red; text-
decoration: none; } hover {text-decoration:
underline; color: blue; }" >Css Creator</a>
Size changing links
<a href=http://www.google.com/”style=A:link {text-
decoration: none}A:visited {text-decoration: none}A:active
{text-decoration: none}A:hover {font-size:24; font-
weight:bold; color: red;}>google</a>
Background colored links
<a href=“www.google.com”style =A:link {background:
#FFCC00; text-decoration: none}A:visited {background:
#FFCC00; text-decoration: none}A:active {background:
#FFCC00; text-decoration: none}A:hover {background:
#FFCC00; font-weight:bold; color: red;}>google</a>
Tables
Tables
Attributes of Tables
 Align
 Valign
 Width
 Border
 Cellpadding
 Cellspacing
 Colspan
 Rowspan
Format of Tables
• <table style=" background-repeat:no-repeat;
width:450px;margin:0;" cellpadding="0" cellspacing="0"
border="0"> <tr style="height:40px; width:450px;margin:0;">
<td style="height:40px; width:40px; margin:0;"> <img src=""
style="width=40px;height40;margin:0;display:block" </td>
<td style="height:40px; width:10px; margin:0;"> </td> <td
style="height:40px; width:400px; margin:0;"> <p style="
margin:0;"> my text </p> </td> </tr> </table>
• Border-width
• border-color
• Border-style
Css and borders
Css and border
<p style=border:3px coral solid;>hello</p>
list
• The CSS list properties allow you to:
• Set different list item markers for ordered lists
• Set different list item markers for unordered lists
• Set an image as the list item marker
• Add background colors to lists and list items
List Types
• Order list
• Unorderlist
• Image list
Format
• <ol class=“circle"> <li class="l1">Link
1</li> <li class="l2">Link 2</li> </ol>
Web technology

More Related Content

What's hot

Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
Larry King
 

What's hot (20)

Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3Web Design Course: CSS lecture 3
Web Design Course: CSS lecture 3
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Web Design Course: CSS lecture 4
Web Design Course: CSS  lecture 4Web Design Course: CSS  lecture 4
Web Design Course: CSS lecture 4
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
uptu web technology unit 2 html
uptu web technology unit 2 htmluptu web technology unit 2 html
uptu web technology unit 2 html
 
Web Engineering - Basic CSS Properties
Web Engineering - Basic CSS PropertiesWeb Engineering - Basic CSS Properties
Web Engineering - Basic CSS Properties
 
Introduction 2 css
Introduction 2 cssIntroduction 2 css
Introduction 2 css
 
Web Design Course: CSS lecture 2
Web Design Course: CSS  lecture 2Web Design Course: CSS  lecture 2
Web Design Course: CSS lecture 2
 
Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1Web Design Course: CSS lecture 1
Web Design Course: CSS lecture 1
 
Web Design Course: CSS lecture 5
Web Design Course: CSS  lecture 5Web Design Course: CSS  lecture 5
Web Design Course: CSS lecture 5
 
Cascading Style Sheets By Mukesh
Cascading Style Sheets By MukeshCascading Style Sheets By Mukesh
Cascading Style Sheets By Mukesh
 
How Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) WorksHow Cascading Style Sheets (CSS) Works
How Cascading Style Sheets (CSS) Works
 
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)
 
Introduction to CSS
Introduction to CSSIntroduction to CSS
Introduction to CSS
 
Css Founder.com | Cssfounder in
Css Founder.com | Cssfounder inCss Founder.com | Cssfounder in
Css Founder.com | Cssfounder in
 
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
 
Java script and html
Java script and htmlJava script and html
Java script and html
 
Java script and html new
Java script and html newJava script and html new
Java script and html new
 
Thinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSSThinkful - Frontend Crash Course - Intro to HTML/CSS
Thinkful - Frontend Crash Course - Intro to HTML/CSS
 
Css
CssCss
Css
 

Viewers also liked

Vaibhav global limited - BUY
Vaibhav global limited - BUYVaibhav global limited - BUY
Vaibhav global limited - BUY
Arunmozhi_Gopalan
 
Font sheet
Font sheetFont sheet
Font sheet
b_jones4
 
Microsoft Word - Paging, Headers, Footers
Microsoft Word - Paging, Headers, FootersMicrosoft Word - Paging, Headers, Footers
Microsoft Word - Paging, Headers, Footers
Lisa Hartman
 
Colors esl-powerpoint
Colors esl-powerpointColors esl-powerpoint
Colors esl-powerpoint
egonzalezlara
 
Color wheel powerpoint
Color wheel powerpointColor wheel powerpoint
Color wheel powerpoint
Ana
 
Color Theory
Color TheoryColor Theory
Color Theory
slhallman
 

Viewers also liked (20)

Word Spell check, page no, page break, bookmarks,pictues, bullets, date and time
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and timeWord Spell check, page no, page break, bookmarks,pictues, bullets, date and time
Word Spell check, page no, page break, bookmarks,pictues, bullets, date and time
 
Arabic spell checking approaches
Arabic spell checking approachesArabic spell checking approaches
Arabic spell checking approaches
 
Vaibhav global limited - BUY
Vaibhav global limited - BUYVaibhav global limited - BUY
Vaibhav global limited - BUY
 
Font sheet
Font sheetFont sheet
Font sheet
 
Microsoft Word - Paging, Headers, Footers
Microsoft Word - Paging, Headers, FootersMicrosoft Word - Paging, Headers, Footers
Microsoft Word - Paging, Headers, Footers
 
Microsoft Excel - Macros
Microsoft Excel - MacrosMicrosoft Excel - Macros
Microsoft Excel - Macros
 
Microsoft office
Microsoft officeMicrosoft office
Microsoft office
 
CSS Font & Text style
CSS Font & Text style CSS Font & Text style
CSS Font & Text style
 
Microsoft Office 2003 Creating Macros
Microsoft Office 2003 Creating MacrosMicrosoft Office 2003 Creating Macros
Microsoft Office 2003 Creating Macros
 
Word 2007-Header And Footer Basics
Word 2007-Header And Footer BasicsWord 2007-Header And Footer Basics
Word 2007-Header And Footer Basics
 
Colour
ColourColour
Colour
 
HOW TO INSERT PAGE NUMBERING IN SPECIFIC PAGE?
HOW TO INSERT PAGE NUMBERING IN SPECIFIC PAGE?HOW TO INSERT PAGE NUMBERING IN SPECIFIC PAGE?
HOW TO INSERT PAGE NUMBERING IN SPECIFIC PAGE?
 
Colors esl-powerpoint
Colors esl-powerpointColors esl-powerpoint
Colors esl-powerpoint
 
The Story of the Color Wheel
The Story of the Color WheelThe Story of the Color Wheel
The Story of the Color Wheel
 
Color your life: how to spice up your life with colors.
Color your life: how to spice up your life with colors.Color your life: how to spice up your life with colors.
Color your life: how to spice up your life with colors.
 
Color wheel powerpoint
Color wheel powerpointColor wheel powerpoint
Color wheel powerpoint
 
Xml Publisher And Reporting To Excel
Xml Publisher And Reporting To ExcelXml Publisher And Reporting To Excel
Xml Publisher And Reporting To Excel
 
Color Powerpoint
Color PowerpointColor Powerpoint
Color Powerpoint
 
Color Theory Book
Color Theory BookColor Theory Book
Color Theory Book
 
Color Theory
Color TheoryColor Theory
Color Theory
 

Similar to Web technology

Similar to Web technology (20)

BITM3730 9-19.pptx
BITM3730 9-19.pptxBITM3730 9-19.pptx
BITM3730 9-19.pptx
 
BITM3730 9-20.pptx
BITM3730 9-20.pptxBITM3730 9-20.pptx
BITM3730 9-20.pptx
 
CSS tutorial chapter 1
CSS tutorial chapter 1CSS tutorial chapter 1
CSS tutorial chapter 1
 
CSS Basics part One
CSS Basics part OneCSS Basics part One
CSS Basics part One
 
Css
CssCss
Css
 
BITM3730Week4.pptx
BITM3730Week4.pptxBITM3730Week4.pptx
BITM3730Week4.pptx
 
CSS Introduction
CSS Introduction CSS Introduction
CSS Introduction
 
6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt6_CasCadingStylesSheetsCSS.ppt
6_CasCadingStylesSheetsCSS.ppt
 
Css introduction
Css  introductionCss  introduction
Css introduction
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
CSS
CSSCSS
CSS
 
Intro to html, css & sass
Intro to html, css & sassIntro to html, css & sass
Intro to html, css & sass
 
html-css
html-csshtml-css
html-css
 
Week11 Lecture: CSS
Week11 Lecture: CSSWeek11 Lecture: CSS
Week11 Lecture: CSS
 
CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)CSS (Cascading Style Sheet)
CSS (Cascading Style Sheet)
 
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
 
WT CSS
WT  CSSWT  CSS
WT CSS
 
Kick start @ css
Kick start @ cssKick start @ css
Kick start @ css
 
TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0TUTORIAL DE CSS 2.0
TUTORIAL DE CSS 2.0
 
CSS tutorial chapter 3
CSS tutorial chapter 3CSS tutorial chapter 3
CSS tutorial chapter 3
 

Recently uploaded

一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
F
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
gajnagarg
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
F
 
一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书
F
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 

Recently uploaded (20)

一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
PIC Microcontroller Structure & Assembly Language.ppsx
PIC Microcontroller Structure & Assembly Language.ppsxPIC Microcontroller Structure & Assembly Language.ppsx
PIC Microcontroller Structure & Assembly Language.ppsx
 
Local Call Girls in Gomati 9332606886 HOT & SEXY Models beautiful and charmi...
Local Call Girls in Gomati  9332606886 HOT & SEXY Models beautiful and charmi...Local Call Girls in Gomati  9332606886 HOT & SEXY Models beautiful and charmi...
Local Call Girls in Gomati 9332606886 HOT & SEXY Models beautiful and charmi...
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirtsDown bad crying at the gym t shirts
Down bad crying at the gym t shirtsDown bad crying at the gym t shirts
 
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
Top profile Call Girls In Dindigul [ 7014168258 ] Call Me For Genuine Models ...
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书一比一原版贝德福特大学毕业证学位证书
一比一原版贝德福特大学毕业证学位证书
 
Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...
Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...
Sensual Call Girls in Tarn Taran Sahib { 9332606886 } VVIP NISHA Call Girls N...
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Call girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girlsCall girls Service in Ajman 0505086370 Ajman call girls
Call girls Service in Ajman 0505086370 Ajman call girls
 
Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 

Web technology

  • 2.
  • 4.
  • 5. Cascading style sheet • Cascading Style Sheets (CSS) is a simple mechanism for adding style 1. Fonts 2. Colors 3. Spacing to Web documents
  • 7.
  • 8.
  • 9. Syntax  A CSS rule-set consists of a selector and a declaration block:  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 CSS property name and a value, separated by a colon.  A CSS declaration always ends with a semicolon, and declaration blocks are surrounded by curly braces.  In the following example all <p> elements will be center- aligned, with a red text color:
  • 11. Sources of Style  External  Internal  Inline
  • 12. Inline style sheet • Inline styles are CSS styles that are applied to one element, directly in the page's HTML, using the style attribute • The inline style uses the HTML "style" attribute. This allows CSS properties on a "per tag" basis.
  • 13. How to Write an Inline Style  You write your style property similar to how you would in a style sheet, but it needs to be all one line.  Separate multiple properties with a semi-colon just as you would in a style sheet
  • 14. Advantages of Inline Styles 1. Inline styles are easy and quick to add you 2. Do not need to worry about writing the proper CSS 3. You don't need to create a whole new document 4. just add the style attribute that is valid on nearly every HTML element.
  • 15. Disadvantages of Inline Styles • They can over-ride things you didn't intend them to • They cause problems and make the pages a lot more work to maintain
  • 16. Inline Styles Are Not Best Practice Inline styles don't separate content from design Inline styles cause more maintenance headaches inline styles make your pages bigger Inline styles are not as accessible
  • 17. Inline Style Sheet • An inline CSS is used to apply a unique style to a single HTML element. • An inline CSS uses the style attribute of an HTML element. • Example <h1 style="color:blue;">This is a Blue Heading</h1>
  • 18. Syntax use to create an inline style <element-name style="property: value;"> In the above: element-name refers to the targetted HTML element • property refers to a CSS property • value refers to an associated CSS value • Multiple CSS property/value pairs can be used in the same style attribute. This is demonstrated by the following syntax: <element-name style="property: value; property: value; property: value;">
  • 19. Here's a few things to remember about inline CSS syntax: • The property and its associated value are separated by a colon (:) • Each property/value pair ends with a semi-colon (;) • When using multiple word values, the multiple word string must be enclosed in single quotation marks to avoid prematurely ending the style attribute
  • 20. Heading <h1 style="color:blue;">This is a Blue Heading</h1> This is a Blue Heading
  • 21.
  • 22.
  • 23. Background color This value sets the background color for the current element. A 'background-color' can be specified either alone or in conjunction with a 'background-image'. When used with a background image, it can still serve several purposes: • 1) to fill transparent regions of the background image • 2) for display while the background image is loading • 3) the browser has image loading capability turned off • 4) if the background image display settings will not cover all of the browser display area.
  • 25.
  • 26.
  • 27. Background Image • This value indicates the URL source for the graphic. If this property is present • 'background-repeat‘ • 'background-attachment' • 'background-position'
  • 29.
  • 30.
  • 31. Background repeat • If a 'background-image' is specified, this value specifies how the image is repeated if the image is not large enough to cover the entire element. All image rendering covers the content and padding areas of the element's box.
  • 32. Allowed Values • Repeat Image is repeated (tiled) both vertically and horizontally. • repeat-x Image is repeated (tiled) horizontally only (to the left and right) of the originating position.
  • 33. Allowed Values • repeat-y Image is repeated (tiled) vertically only (upwards and downwards) of the originating position. • no-repeat Image is not repeated. Only a single occurrence of the background image behind the current element is used, at the specified position.
  • 35. Background Attachment • if a 'background-image' is specified, this value indicates whether or not the background image will move when the browser window is scrolled to view text outside the current display area. • Fixed • Scroll
  • 37. Background Position • The values for this property translate to space separated X/Y coordinates of the browser window. Minimum values are at the upper-left corner of the display area and maximum values are at the lower-right corner. These values are normally represented as a pair, but omitting a value is legal - the missing value is assumed to be the y-axis coordinate and is set to the default 'center' value.
  • 38. Background Position • Allowed Values • X% Y% • X Y • (left|center|right) (top|center|bottom)
  • 40.
  • 41. Font color • This property describes the color of text within an element. Values for the property outside the specified ranges will be clipped or truncated to create a valid value. Description: This is a representation of the values for Red/Green/Blue used to determine a final display color. • <body STYLE="color: blue">text</body> text
  • 42. Font size This attribute is used to change font size in pixels percentage points <h1 style="font-size: 11px; >Hello</h1>
  • 43. Font Style • Attribute use to change font Style E.g • Italic • Bold • Underlin <h1font style= Italic>Hello</p1>
  • 45.
  • 46. Alignment of Text • Alignment of text include • Right • Left • Center • <h1 align=center>Hello</h1>
  • 47. Decoration of text • Decoration of text • Blink • Underline • Overline • <h1text decoration:underline>Hello</h1> Hello
  • 48. Hyperlink • a link from a hypertext document to another location, activated by clicking on a highlighted word or image.
  • 49. Hyperlinks a:link - a normal, unvisited link a:visited - a link the user has visited a:hover - a link when the user mouses over it a:active - a link the moment it is clicked
  • 50. Hyperlinks • <a href="http://www.csscreator.com/" style="link, visited {color: red; text- decoration: none; } hover {text-decoration: none; color: blue; }" >Css Creator</a>
  • 51. Underline/overline • Underline/Overline • <a href="http://www.csscreator.com/" style="link, visited {color: red; text- decoration: none; } hover {text-decoration: underline; color: blue; }" >Css Creator</a>
  • 52. Size changing links <a href=http://www.google.com/”style=A:link {text- decoration: none}A:visited {text-decoration: none}A:active {text-decoration: none}A:hover {font-size:24; font- weight:bold; color: red;}>google</a>
  • 53. Background colored links <a href=“www.google.com”style =A:link {background: #FFCC00; text-decoration: none}A:visited {background: #FFCC00; text-decoration: none}A:active {background: #FFCC00; text-decoration: none}A:hover {background: #FFCC00; font-weight:bold; color: red;}>google</a>
  • 54.
  • 57. Attributes of Tables  Align  Valign  Width  Border  Cellpadding  Cellspacing  Colspan  Rowspan
  • 58. Format of Tables • <table style=" background-repeat:no-repeat; width:450px;margin:0;" cellpadding="0" cellspacing="0" border="0"> <tr style="height:40px; width:450px;margin:0;"> <td style="height:40px; width:40px; margin:0;"> <img src="" style="width=40px;height40;margin:0;display:block" </td> <td style="height:40px; width:10px; margin:0;"> </td> <td style="height:40px; width:400px; margin:0;"> <p style=" margin:0;"> my text </p> </td> </tr> </table>
  • 59.
  • 60. • Border-width • border-color • Border-style Css and borders
  • 61. Css and border <p style=border:3px coral solid;>hello</p>
  • 62.
  • 63. list • The CSS list properties allow you to: • Set different list item markers for ordered lists • Set different list item markers for unordered lists • Set an image as the list item marker • Add background colors to lists and list items
  • 64. List Types • Order list • Unorderlist • Image list
  • 65.
  • 66. Format • <ol class=“circle"> <li class="l1">Link 1</li> <li class="l2">Link 2</li> </ol>

Editor's Notes

  1. The res thebn