SlideShare a Scribd company logo
1 of 44
Css Founder.com | Cssfounder
Company
http://cssfounder.com
Outline
Development of Business Applications on the Internet
Fall
Instructor: Dr. Boris Jukic
CSS: Cascading Style
Sheets
Css Founder.com
Objectives
 Topics covered:
– using a style sheet to give all the pages of a Web site the
same look and feel.
– style sheet types and cascade precedence
– CSS syntax for assigning style properties
– Class selector and using the class attribute to apply
styles.
– using style sheets to separate presentation from content.
Css Founder.com
Introduction
 Cascading Style Sheets (CSS)
– Separation of structure from presentation
– Relationship between the style formatting and the
structure/content is no longer 1:1
 multiple style sheets can be applied to the same Web
page
 Same style sheet can be applied to the multiple Web
page
Css Founder.com
Multiple Levels of Style Definition
 Cascade Precedence: resolves conflicting
style rules
– Inline style sheets
– Embedded sheets
– External style sheets
 Author vs. User
Css Founder.com
Inline Styles
 style information is directly attached to the
HTML elements they affect
 higher cascade precedence than the other
specification methods
 declaring an individual element’s format:
– Attribute style
– CSS (style) property
 Followed by a colon and a value
Css Founder.com
Outline
inline.html
(1 of 2)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig. 6.1: inline.html -->
6 <!-- Using inline styles -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>Inline Styles</title>
11 </head>
12
13 <body>
14
15 <p>This text does not have any style applied to it.</p>
16
17 <!-- The style attribute allows you to declare -->
18 <!-- inline styles. Separate multiple styles -->
19 <!-- with a semicolon. -->
20 <p style = "font-size: 20pt">This text has the
21 <em>font-size</em> style applied to it, making it 20pt.
22 </p>
23
Css Founder.com
Outline
24 <p style = "font-size: 20pt; color: #0000ff">
25 This text has the <em>font-size</em> and
26 <em>color</em> styles applied to it, making it
27 20pt. and blue.</p>
28
29 </body>
30 </html>
Css Founder.com
Embedded Style Sheets
 this method can only specify style information for the
current document:
– 1:1 relationship
– However, the same document may have other style definitions
applied to it
 1:M relationship
 embedded style sheet rule will have higher precedence
than external style sheet rule, if there is a conflict between
styles
 embedded style sheet rule will have lower precedence
than an inline style sheet rule
Css Founder.com
Embedded Style Sheets
 Embed an entire CSS document in an XHTML document’s
head section inside a style element
– Attribute type
 Multipurpose Internet Mail Extensions (MIME) type
– describes the type of the document’s content
– text/css is the type for CSS document
– Style properties are defined for:
 Existing defined elements, such as p (paragraph), h3 (header),
li (Iist) or any other
 Style class that can be applied to either:
– Any existing type of element in the body of the document or
– One specific element in the document
Css Founder.com
CSS Syntax for Assigning Style
Properties
– The CSS syntax is made up of three parts: a selector, a property and a value:
 selector {property: value}
– A selector can be:
 the HTML element/tag you wish to define. In this example:
– body {color: black} , element body is the selector
 The class selector, which can be tied to a specific element, such as:
– p.right {text-align: right}
 The class selector applicable to any element, such as:
– .loud {font-family: fantasy; font-size: xx-large}
– If a class selector is used, it has to be invoked in the body of the
XHTML document:
– <p class="right"> or
– <table class=“loud”>
Css Founder.com
CSS Syntax for Assigning Style
Properties: additional issues
– Group selectors are possible for a group of HTML elements. For example:
– h1,h2,h3,h4,h5,h6 {color: green} will make all header elements
text green
– When a class selector is defined for a particular element, it can not
be invoked on other elements. Using example from the previous slide
which of these uses of class styles in the XHTML document is
correct?
– <ul class = “loud”>
– <ul class = “right”>
– Pseudo-class selectors define the style for the parts of a document
based on some characteristics other than tag name, attributes or
content. They may be defined by a user action such as:
– Mouseover (hover pseudoclass)
– Clicking (active pseudoclass)
Css Founder.com
CSS syntax: continue
 Invoking a style class to a block of text not
defined by a particular element
– span element
– div element (block level element)
Css Founder.com
Style Inheritance and Conflict
Resolution
 Inheritance
– An element that is present within another element
(child) inherits all style properties from its “parent”
element
– However, if such child (or descendant) element
has properties that conflict with defined properties
of its parent element, conflict is resolved in favors
of properties of a child element
 Child element properties have greater specificity than
ancestor’s properties
Css Founder.com
Outline
declared.html
(1 of 3)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig. 6.2: declared.html -->
6 <!-- Declaring a style sheet in the header section. -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>Style Sheets</title>
11
12 <!-- this begins the style sheet section -->
13 <style type = "text/css">
14
15 em { background-color: #8000ff;
16 color: white }
17
18 h1 { font-family: arial, sans-serif }
19
20 p { font-size: 14pt }
21
22 .special { color: blue }
23
24 </style>
25 </head>
 Style Class selector:
applicable to any element in
this document
Css Founder.com
Outline
declared.html
(2 of 3)
26
27 <body>
28
29 <!-- this class attribute applies the .special style -->
30 <h1 class = "special">Deitel & Associates, Inc.</h1>
31
32 <p>Deitel &amp; Associates, Inc. is an internationally
33 recognized corporate training and publishing organization
34 specializing in programming languages, Internet/World
35 Wide Web technology and object technology education.
36 Deitel &amp; Associates, Inc. is a member of the World Wide
37 Web Consortium. The company provides courses on Java,
38 C++, Visual Basic, C, Internet and World Wide Web
39 programming, and Object Technology.</p>
40
41 <h1>Clients</h1>
42 <p class = "special"> The company's clients include many
43 <em>Fortune 1000 companies</em>, government agencies,
44 branches of the military and business organizations.
45 Through its publishing partnership with Prentice Hall,
46 Deitel &amp; Associates, Inc. publishes leading-edge
47 programming textbooks, professional books, interactive
48 CD-ROM-based multimedia Cyber Classrooms, satellite
49 courses and World Wide Web courses.</p>
50
 Style Class “special”
invoked for p element
 Style Class “special”
invoked for h1 element
Css Founder.com
Outline
51 </body>
52 </html>
 color Conflict resolution
between parent element p
and child element em
Css Founder.com
Outline
advance.html
(1 of 3)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig 6.3: advanced.html -->
6 <!-- More advanced style sheets -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>More Styles</title>
11
12 <style type = "text/css">
13
14 a.nodec { text-decoration: none }
15
16 a:hover { text-decoration: underline;
17 color: red;
18 background-color: #ccffcc }
19
20 li em { color: red;
21 font-weight: bold }
22
23 ul { margin-left: 75px }
24
 Style Class: applicable only to
element a in this document
 Pseudoclass: applicable only to
element a in this document. (note
different syntax)
 This is NOT a group selector. It declares that this
specific style is applicable to em elements inside an
li element
Css Founder.com
Outline
advance.html
(2 of 3)
25 ul ul { text-decoration: underline;
26 margin-left: 15px }
27
28 </style>
29 </head>
30
31 <body>
32
33 <h1>Shopping list for <em>Monday</em>:</h1>
34
35 <ul>
36 <li>Milk</li>
37 <li>Bread
38 <ul>
39 <li>White bread</li>
40 <li>Rye bread</li>
41 <li>Whole wheat bread</li>
42 </ul>
43 </li>
44 <li>Rice</li>
45 <li>Potatoes</li>
46 <li>Pizza <em>with mushrooms</em></li>
47 </ul>
48
Css Founder.com
Outline
49 <p><a class = "nodec" href = "http://www.food.com">
50 Go to the Grocery store</a></p>
51
52 </body>
53 </html>
Css Founder.com
External Style Sheets
 External style sheets
– Applicable to more than document
– Documents can have more than one source for style
specification
M:M relationship
 Can provide uniform look and feel to entire site
 Same CSS syntax rules for assigning and invoking style
properties apply
Css Founder.com
External Style Sheets
 Location (href) and type (type) of the external style sheet are
specified as attributes of a link element in the head portion of an
XHTML document
 In addition, the rel attribute specifies the nature of the relationship
between the stylesheet and the document that is referencing it
– Persistent stylesheets must be applied to the document
– Preferred style sheet should be applied the unless the user has
selected a different alternate
– Alternate style sheets may be selected by users depending on
their preferences
Css Founder.com
Linking External Style Sheets
– To make a style sheet persistent, set the rel attribute to
"stylesheet".
– To make a style sheet preferred, set the rel attribute to
"stylesheet" and name the style sheet with the additional
title attribute.
– To specify an alternate style sheet, set the rel attribute to
"alternate stylesheet" and name the style sheet with the title
attribute.
Css Founder.com
Outline
styles.css
(1 of 1)
1 /* Fig. 6.4: styles.css */
2 /* An external stylesheet */
3
4 a { text-decoration: none }
5
6 a:hover { text-decoration: underline;
7 color: red;
8 background-color: #ccffcc }
9
10 li em { color: red;
11 font-weight: bold;
12 background-color: #ffffff }
13
14 ul { margin-left: 2cm }
15
16 ul ul { text-decoration: underline;
17 margin-left: .5cm }
Css Founder.com
Outline
external.html
(1 of 2)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig. 6.5: external.html -->
6 <!-- Linking external style sheets -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>Linking External Style Sheets</title>
11 <link rel = "stylesheet" type = "text/css"
12 href = "styles.css" />
13 </head>
14
15 <body>
16
17 <h1>Shopping list for <em>Monday</em>:</h1>
18 <ul>
19 <li>Milk</li>
20 <li>Bread
21 <ul>
22 <li>White bread</li>
23 <li>Rye bread</li>
24 <li>Whole wheat bread</li>
25 </ul>
Css Founder.com
Outline
26 </li>
27 <li>Rice</li>
28 <li>Potatoes</li>
29 <li>Pizza <em>with mushrooms</em></li>
30 </ul>
31
32 <p>
33 <a href = "http://www.food.com">Go to the Grocery store</a>
34 </p>
35
36 </body>
37 </html>
Css Founder.com
W3C CSS Validation Service
 Validates external CSS documents
 Ensures that style sheets are syntactically
correct
 http://jigsaw.w3.org/css-validator/
Css Founder.com
6.10 Text Flow and the Box Model
 Floating
– Move an element to one side of the screen
 Box model
– Margins
– Padding
– Border
Css Founder.com
Outline
floating.html
(1 of 3)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig. 6.12: floating.html -->
6 <!-- Floating elements and element boxes -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>Flowing Text Around Floating Elements</title>
11
12 <style type = "text/css">
13
14 div { background-color: #ffccff;
15 margin-bottom: .5em;
16 font-size: 1.5em;
17 width: 50% }
18
19 p { text-align: justify }
20
21 </style>
22
23 </head>
24
Css Founder.com
Outline
floating.html
(2 of 3)
25 <body>
26
27 <div style = "text-align: center">
28 Deitel &amp; Associates, Inc.</div>
29
30 <div style = "float: right; margin: .5em;
31 text-align: right">
32 Corporate Training and Publishing</div>
33
34 <p>Deitel &amp; Associates, Inc. is an internationally
35 recognized corporate training and publishing organization
36 specializing in programming languages, Internet/World
37 Wide Web technology and object technology education.
38 The company provides courses on Java, C++, Visual Basic, C,
39 Internet and World Wide Web programming, and Object Technology.</p>
40
41 <div style = "float: right; padding: .5em;
42 text-align: right">
43 Leading-Edge Programming Textbooks</div>
44
45 <p>The company's clients include many Fortune 1000
46 companies, government agencies, branches of the military
47 and business organizations.</p>
48
Css Founder.com
Outline
49 <p style = "clear: right">Through its publishing
50 partnership with Prentice Hall, Deitel &amp; Associates,
51 Inc. publishes leading-edge programming textbooks,
52 professional books, interactive CD-ROM-based multimedia
53 Cyber Classrooms, satellite courses and World Wide Web
54 courses.</p>
55
56 </body>
57 </html>
Css Founder.com
Text Flow and the Box Model
Content
Margin
Border
Padding
Css Founder.com
Outline
borders.html
(1 of 2)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig. 6.14: borders.html -->
6 <!-- Setting borders of an element -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>Borders</title>
11
12 <style type = "text/css">
13
14 body { background-color: #ccffcc }
15
16 div { text-align: center;
17 margin-bottom: 1em;
18 padding: .5em }
19
20 .thick { border-width: thick }
21
22 .medium { border-width: medium }
23
24 .thin { border-width: thin }
25
Css Founder.com
Outline
borders.html
(2 of 2)
26 .groove { border-style: groove }
27
28 .inset { border-style: inset }
29
30 .outset { border-style: outset }
31
32 .red { border-color: red }
33
34 .blue { border-color: blue }
35
36 </style>
37 </head>
38
39 <body>
40
41 <div class = "thick groove">This text has a border</div>
42 <div class = "medium groove">This text has a border</div>
43 <div class = "thin groove">This text has a border</div>
44
45 <p class = "thin red inset">A thin red line...</p>
46 <p class = "medium blue outset">
47 And a thicker blue line</p>
48
49 </body>
50 </html>
Css Founder.com
Css Founder.com
User Style Sheets
 Format pages based on user preferences
 User style sheets are not linked in the
document
– They are set in browser's options
Css Founder.com
Outline
User_absolute.html
(1 of 2)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig. 6.16: user_absolute.html -->
6 <!-- User styles -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>User Styles</title>
11
12 <style type = "text/css">
13
14 .note { font-size: 9pt }
15
16 </style>
17 </head>
18
19 <body>
20
21 <p>Thanks for visiting my Web site. I hope you enjoy it.
22 </p><p class = "note">Please Note: This site will be
23 moving soon. Please check periodically for updates.</p>
Css Founder.com
Outline24
25 </body>
26 </html>
Css Founder.com
Outline
1 /* Fig. 6.17: userstyles.css */
2 /* A user stylesheet */
3
4 body { font-size: 20pt;
5 color: yellow;
6 background-color: #000080 }
Css Founder.com
User Style Sheets
Fig. 6.18 User style sheet in Internet Explorer 6.
Css Founder.com
User Style Sheets
Css Founder.com
Outline
User_relative.html
(1 of 2)
1 <?xml version = "1.0"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4
5 <!-- Fig. 6.20: user_relative.html -->
6 <!-- User styles -->
7
8 <html xmlns = "http://www.w3.org/1999/xhtml">
9 <head>
10 <title>User Styles</title>
11
12 <style type = "text/css">
13
14 .note { font-size: .75em }
15
16 </style>
17 </head>
18
19 <body>
20
21 <p>Thanks for visiting my Web site. I hope you enjoy it.
22 </p><p class = "note">Please Note: This site will be
23 moving soon. Please check periodically for updates.</p>
Css Founder.com
Outline
24
25 </body>
26 </html>
Css Founder.com
User Style Sheets
Fig. 6.21 User style sheet applied with em measurement.
Css Founder.com

More Related Content

What's hot

What's hot (6)

Cascading Style Sheet | CSS
Cascading Style Sheet | CSSCascading Style Sheet | CSS
Cascading Style Sheet | CSS
 
Css tutorial 2012
Css tutorial 2012Css tutorial 2012
Css tutorial 2012
 
CLIENT SIDE PROGRAMMING
CLIENT SIDE PROGRAMMINGCLIENT SIDE PROGRAMMING
CLIENT SIDE PROGRAMMING
 
Css presentation lecture 3
Css presentation lecture 3Css presentation lecture 3
Css presentation lecture 3
 
Cascading Style Sheet
Cascading Style SheetCascading Style Sheet
Cascading Style Sheet
 
Css
CssCss
Css
 

Viewers also liked

Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiCss Founder
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbaiCss Founder
 
Website development company in delhi ncr
Website development company in delhi ncrWebsite development company in delhi ncr
Website development company in delhi ncrCss Founder
 
Website designing company in faridabad
Website designing company in faridabadWebsite designing company in faridabad
Website designing company in faridabadCss Founder
 
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiCss Founder
 
Cssfounder.com | website designing company in delhi
Cssfounder.com | website designing company in delhiCssfounder.com | website designing company in delhi
Cssfounder.com | website designing company in delhiCss Founder
 
√ Website designing company in delhi
√ Website designing company in delhi√ Website designing company in delhi
√ Website designing company in delhiCss Founder
 
Css Founder.com | Cssfounder in
Css Founder.com | Cssfounder inCss Founder.com | Cssfounder in
Css Founder.com | Cssfounder inCss Founder
 
Css Founder.com | Cssfounder net
Css Founder.com | Cssfounder netCss Founder.com | Cssfounder net
Css Founder.com | Cssfounder netCss Founder
 
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder
 
Resiliency jenna-2013
Resiliency jenna-2013Resiliency jenna-2013
Resiliency jenna-2013Jenna Martin
 
การฟื้นฟูศิลปวิทยาการ (Renaissance)
การฟื้นฟูศิลปวิทยาการ (Renaissance)การฟื้นฟูศิลปวิทยาการ (Renaissance)
การฟื้นฟูศิลปวิทยาการ (Renaissance)sudoooooo
 

Viewers also liked (13)

Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbai
 
Website development company in delhi ncr
Website development company in delhi ncrWebsite development company in delhi ncr
Website development company in delhi ncr
 
Website designing company in faridabad
Website designing company in faridabadWebsite designing company in faridabad
Website designing company in faridabad
 
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder.com | Cssfounder Company
Css Founder.com | Cssfounder Company
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Cssfounder.com | website designing company in delhi
Cssfounder.com | website designing company in delhiCssfounder.com | website designing company in delhi
Cssfounder.com | website designing company in delhi
 
√ Website designing company in delhi
√ Website designing company in delhi√ Website designing company in delhi
√ Website designing company in delhi
 
Css Founder.com | Cssfounder in
Css Founder.com | Cssfounder inCss Founder.com | Cssfounder in
Css Founder.com | Cssfounder in
 
Css Founder.com | Cssfounder net
Css Founder.com | Cssfounder netCss Founder.com | Cssfounder net
Css Founder.com | Cssfounder net
 
Css Founder.com | Cssfounder Company
Css Founder.com | Cssfounder CompanyCss Founder.com | Cssfounder Company
Css Founder.com | Cssfounder Company
 
Resiliency jenna-2013
Resiliency jenna-2013Resiliency jenna-2013
Resiliency jenna-2013
 
การฟื้นฟูศิลปวิทยาการ (Renaissance)
การฟื้นฟูศิลปวิทยาการ (Renaissance)การฟื้นฟูศิลปวิทยาการ (Renaissance)
การฟื้นฟูศิลปวิทยาการ (Renaissance)
 

Similar to Css Founder.com | Cssfounder Company

Similar to Css Founder.com | Cssfounder Company (20)

CSS.pptx
CSS.pptxCSS.pptx
CSS.pptx
 
ch04-css-basics_final.ppt
ch04-css-basics_final.pptch04-css-basics_final.ppt
ch04-css-basics_final.ppt
 
CSS Part I
CSS Part ICSS Part I
CSS Part I
 
Unit 2.1
Unit 2.1Unit 2.1
Unit 2.1
 
Unit 2.1
Unit 2.1Unit 2.1
Unit 2.1
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
3 css essentials
3 css essentials3 css essentials
3 css essentials
 
lecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptxlecture CSS 1-2_2022_2023.pptx
lecture CSS 1-2_2022_2023.pptx
 
Internet tech &amp; web prog. p4,5
Internet tech &amp; web prog.  p4,5Internet tech &amp; web prog.  p4,5
Internet tech &amp; web prog. p4,5
 
Html css
Html cssHtml css
Html css
 
03html Css
03html Css03html Css
03html Css
 
Css introduction
Css introductionCss introduction
Css introduction
 
3-CSS_essentials.ppt
3-CSS_essentials.ppt3-CSS_essentials.ppt
3-CSS_essentials.ppt
 
3-CSS_essentials_developers_begineers.ppt
3-CSS_essentials_developers_begineers.ppt3-CSS_essentials_developers_begineers.ppt
3-CSS_essentials_developers_begineers.ppt
 
3-CSS_essentials.ppt
3-CSS_essentials.ppt3-CSS_essentials.ppt
3-CSS_essentials.ppt
 
Week3 css
Week3 cssWeek3 css
Week3 css
 
Css inclusion
Css   inclusionCss   inclusion
Css inclusion
 
Css basics
Css basicsCss basics
Css basics
 
Html Css
Html CssHtml Css
Html Css
 

More from Css Founder

Cssfounder.com website designing company in delhi
Cssfounder.com website designing company in delhiCssfounder.com website designing company in delhi
Cssfounder.com website designing company in delhiCss Founder
 
Internet technology and web designing
Internet technology and web designingInternet technology and web designing
Internet technology and web designingCss Founder
 
Web page design-cssfounder
Web page design-cssfounderWeb page design-cssfounder
Web page design-cssfounderCss Founder
 
Tech dev cssfounder.com
Tech dev cssfounder.comTech dev cssfounder.com
Tech dev cssfounder.comCss Founder
 
Digital india-cssfounder.com
Digital india-cssfounder.comDigital india-cssfounder.com
Digital india-cssfounder.comCss Founder
 
Poverty inindia CssFounder.com
Poverty inindia CssFounder.comPoverty inindia CssFounder.com
Poverty inindia CssFounder.comCss Founder
 
Poverty in india Cssfounder.com
Poverty in india Cssfounder.comPoverty in india Cssfounder.com
Poverty in india Cssfounder.comCss Founder
 
Website designing company in delhi e commerce
Website designing company in delhi e commerceWebsite designing company in delhi e commerce
Website designing company in delhi e commerceCss Founder
 
Website designing company_in_delhi blogging
Website designing company_in_delhi bloggingWebsite designing company_in_delhi blogging
Website designing company_in_delhi bloggingCss Founder
 
Website designing company in delhi blog powerpoint
Website designing company in delhi blog powerpointWebsite designing company in delhi blog powerpoint
Website designing company in delhi blog powerpointCss Founder
 
Website designing company_in_delhi e-business
Website designing company_in_delhi e-businessWebsite designing company_in_delhi e-business
Website designing company_in_delhi e-businessCss Founder
 
Website designing company_in_mumbai_digital india
Website designing company_in_mumbai_digital indiaWebsite designing company_in_mumbai_digital india
Website designing company_in_mumbai_digital indiaCss Founder
 
Website designing company_in_delhi_digitization practices
Website designing company_in_delhi_digitization practicesWebsite designing company_in_delhi_digitization practices
Website designing company_in_delhi_digitization practicesCss Founder
 
Website designing company_in_delhi_education
Website designing company_in_delhi_educationWebsite designing company_in_delhi_education
Website designing company_in_delhi_educationCss Founder
 
Website designing company_in_delhi_education system
Website designing company_in_delhi_education systemWebsite designing company_in_delhi_education system
Website designing company_in_delhi_education systemCss Founder
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentCss Founder
 
Website development process
Website development processWebsite development process
Website development processCss Founder
 
Webdesign website development_company_surat
Webdesign website development_company_suratWebdesign website development_company_surat
Webdesign website development_company_suratCss Founder
 
Internet website designing_company_in_delhi
Internet website designing_company_in_delhiInternet website designing_company_in_delhi
Internet website designing_company_in_delhiCss Founder
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiCss Founder
 

More from Css Founder (20)

Cssfounder.com website designing company in delhi
Cssfounder.com website designing company in delhiCssfounder.com website designing company in delhi
Cssfounder.com website designing company in delhi
 
Internet technology and web designing
Internet technology and web designingInternet technology and web designing
Internet technology and web designing
 
Web page design-cssfounder
Web page design-cssfounderWeb page design-cssfounder
Web page design-cssfounder
 
Tech dev cssfounder.com
Tech dev cssfounder.comTech dev cssfounder.com
Tech dev cssfounder.com
 
Digital india-cssfounder.com
Digital india-cssfounder.comDigital india-cssfounder.com
Digital india-cssfounder.com
 
Poverty inindia CssFounder.com
Poverty inindia CssFounder.comPoverty inindia CssFounder.com
Poverty inindia CssFounder.com
 
Poverty in india Cssfounder.com
Poverty in india Cssfounder.comPoverty in india Cssfounder.com
Poverty in india Cssfounder.com
 
Website designing company in delhi e commerce
Website designing company in delhi e commerceWebsite designing company in delhi e commerce
Website designing company in delhi e commerce
 
Website designing company_in_delhi blogging
Website designing company_in_delhi bloggingWebsite designing company_in_delhi blogging
Website designing company_in_delhi blogging
 
Website designing company in delhi blog powerpoint
Website designing company in delhi blog powerpointWebsite designing company in delhi blog powerpoint
Website designing company in delhi blog powerpoint
 
Website designing company_in_delhi e-business
Website designing company_in_delhi e-businessWebsite designing company_in_delhi e-business
Website designing company_in_delhi e-business
 
Website designing company_in_mumbai_digital india
Website designing company_in_mumbai_digital indiaWebsite designing company_in_mumbai_digital india
Website designing company_in_mumbai_digital india
 
Website designing company_in_delhi_digitization practices
Website designing company_in_delhi_digitization practicesWebsite designing company_in_delhi_digitization practices
Website designing company_in_delhi_digitization practices
 
Website designing company_in_delhi_education
Website designing company_in_delhi_educationWebsite designing company_in_delhi_education
Website designing company_in_delhi_education
 
Website designing company_in_delhi_education system
Website designing company_in_delhi_education systemWebsite designing company_in_delhi_education system
Website designing company_in_delhi_education system
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopment
 
Website development process
Website development processWebsite development process
Website development process
 
Webdesign website development_company_surat
Webdesign website development_company_suratWebdesign website development_company_surat
Webdesign website development_company_surat
 
Internet website designing_company_in_delhi
Internet website designing_company_in_delhiInternet website designing_company_in_delhi
Internet website designing_company_in_delhi
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 

Recently uploaded

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

Css Founder.com | Cssfounder Company

  • 1. Css Founder.com | Cssfounder Company http://cssfounder.com
  • 2. Outline Development of Business Applications on the Internet Fall Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets Css Founder.com
  • 3. Objectives  Topics covered: – using a style sheet to give all the pages of a Web site the same look and feel. – style sheet types and cascade precedence – CSS syntax for assigning style properties – Class selector and using the class attribute to apply styles. – using style sheets to separate presentation from content. Css Founder.com
  • 4. Introduction  Cascading Style Sheets (CSS) – Separation of structure from presentation – Relationship between the style formatting and the structure/content is no longer 1:1  multiple style sheets can be applied to the same Web page  Same style sheet can be applied to the multiple Web page Css Founder.com
  • 5. Multiple Levels of Style Definition  Cascade Precedence: resolves conflicting style rules – Inline style sheets – Embedded sheets – External style sheets  Author vs. User Css Founder.com
  • 6. Inline Styles  style information is directly attached to the HTML elements they affect  higher cascade precedence than the other specification methods  declaring an individual element’s format: – Attribute style – CSS (style) property  Followed by a colon and a value Css Founder.com
  • 7. Outline inline.html (1 of 2) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig. 6.1: inline.html --> 6 <!-- Using inline styles --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>Inline Styles</title> 11 </head> 12 13 <body> 14 15 <p>This text does not have any style applied to it.</p> 16 17 <!-- The style attribute allows you to declare --> 18 <!-- inline styles. Separate multiple styles --> 19 <!-- with a semicolon. --> 20 <p style = "font-size: 20pt">This text has the 21 <em>font-size</em> style applied to it, making it 20pt. 22 </p> 23 Css Founder.com
  • 8. Outline 24 <p style = "font-size: 20pt; color: #0000ff"> 25 This text has the <em>font-size</em> and 26 <em>color</em> styles applied to it, making it 27 20pt. and blue.</p> 28 29 </body> 30 </html> Css Founder.com
  • 9. Embedded Style Sheets  this method can only specify style information for the current document: – 1:1 relationship – However, the same document may have other style definitions applied to it  1:M relationship  embedded style sheet rule will have higher precedence than external style sheet rule, if there is a conflict between styles  embedded style sheet rule will have lower precedence than an inline style sheet rule Css Founder.com
  • 10. Embedded Style Sheets  Embed an entire CSS document in an XHTML document’s head section inside a style element – Attribute type  Multipurpose Internet Mail Extensions (MIME) type – describes the type of the document’s content – text/css is the type for CSS document – Style properties are defined for:  Existing defined elements, such as p (paragraph), h3 (header), li (Iist) or any other  Style class that can be applied to either: – Any existing type of element in the body of the document or – One specific element in the document Css Founder.com
  • 11. CSS Syntax for Assigning Style Properties – The CSS syntax is made up of three parts: a selector, a property and a value:  selector {property: value} – A selector can be:  the HTML element/tag you wish to define. In this example: – body {color: black} , element body is the selector  The class selector, which can be tied to a specific element, such as: – p.right {text-align: right}  The class selector applicable to any element, such as: – .loud {font-family: fantasy; font-size: xx-large} – If a class selector is used, it has to be invoked in the body of the XHTML document: – <p class="right"> or – <table class=“loud”> Css Founder.com
  • 12. CSS Syntax for Assigning Style Properties: additional issues – Group selectors are possible for a group of HTML elements. For example: – h1,h2,h3,h4,h5,h6 {color: green} will make all header elements text green – When a class selector is defined for a particular element, it can not be invoked on other elements. Using example from the previous slide which of these uses of class styles in the XHTML document is correct? – <ul class = “loud”> – <ul class = “right”> – Pseudo-class selectors define the style for the parts of a document based on some characteristics other than tag name, attributes or content. They may be defined by a user action such as: – Mouseover (hover pseudoclass) – Clicking (active pseudoclass) Css Founder.com
  • 13. CSS syntax: continue  Invoking a style class to a block of text not defined by a particular element – span element – div element (block level element) Css Founder.com
  • 14. Style Inheritance and Conflict Resolution  Inheritance – An element that is present within another element (child) inherits all style properties from its “parent” element – However, if such child (or descendant) element has properties that conflict with defined properties of its parent element, conflict is resolved in favors of properties of a child element  Child element properties have greater specificity than ancestor’s properties Css Founder.com
  • 15. Outline declared.html (1 of 3) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig. 6.2: declared.html --> 6 <!-- Declaring a style sheet in the header section. --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>Style Sheets</title> 11 12 <!-- this begins the style sheet section --> 13 <style type = "text/css"> 14 15 em { background-color: #8000ff; 16 color: white } 17 18 h1 { font-family: arial, sans-serif } 19 20 p { font-size: 14pt } 21 22 .special { color: blue } 23 24 </style> 25 </head>  Style Class selector: applicable to any element in this document Css Founder.com
  • 16. Outline declared.html (2 of 3) 26 27 <body> 28 29 <!-- this class attribute applies the .special style --> 30 <h1 class = "special">Deitel & Associates, Inc.</h1> 31 32 <p>Deitel &amp; Associates, Inc. is an internationally 33 recognized corporate training and publishing organization 34 specializing in programming languages, Internet/World 35 Wide Web technology and object technology education. 36 Deitel &amp; Associates, Inc. is a member of the World Wide 37 Web Consortium. The company provides courses on Java, 38 C++, Visual Basic, C, Internet and World Wide Web 39 programming, and Object Technology.</p> 40 41 <h1>Clients</h1> 42 <p class = "special"> The company's clients include many 43 <em>Fortune 1000 companies</em>, government agencies, 44 branches of the military and business organizations. 45 Through its publishing partnership with Prentice Hall, 46 Deitel &amp; Associates, Inc. publishes leading-edge 47 programming textbooks, professional books, interactive 48 CD-ROM-based multimedia Cyber Classrooms, satellite 49 courses and World Wide Web courses.</p> 50  Style Class “special” invoked for p element  Style Class “special” invoked for h1 element Css Founder.com
  • 17. Outline 51 </body> 52 </html>  color Conflict resolution between parent element p and child element em Css Founder.com
  • 18. Outline advance.html (1 of 3) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig 6.3: advanced.html --> 6 <!-- More advanced style sheets --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>More Styles</title> 11 12 <style type = "text/css"> 13 14 a.nodec { text-decoration: none } 15 16 a:hover { text-decoration: underline; 17 color: red; 18 background-color: #ccffcc } 19 20 li em { color: red; 21 font-weight: bold } 22 23 ul { margin-left: 75px } 24  Style Class: applicable only to element a in this document  Pseudoclass: applicable only to element a in this document. (note different syntax)  This is NOT a group selector. It declares that this specific style is applicable to em elements inside an li element Css Founder.com
  • 19. Outline advance.html (2 of 3) 25 ul ul { text-decoration: underline; 26 margin-left: 15px } 27 28 </style> 29 </head> 30 31 <body> 32 33 <h1>Shopping list for <em>Monday</em>:</h1> 34 35 <ul> 36 <li>Milk</li> 37 <li>Bread 38 <ul> 39 <li>White bread</li> 40 <li>Rye bread</li> 41 <li>Whole wheat bread</li> 42 </ul> 43 </li> 44 <li>Rice</li> 45 <li>Potatoes</li> 46 <li>Pizza <em>with mushrooms</em></li> 47 </ul> 48 Css Founder.com
  • 20. Outline 49 <p><a class = "nodec" href = "http://www.food.com"> 50 Go to the Grocery store</a></p> 51 52 </body> 53 </html> Css Founder.com
  • 21. External Style Sheets  External style sheets – Applicable to more than document – Documents can have more than one source for style specification M:M relationship  Can provide uniform look and feel to entire site  Same CSS syntax rules for assigning and invoking style properties apply Css Founder.com
  • 22. External Style Sheets  Location (href) and type (type) of the external style sheet are specified as attributes of a link element in the head portion of an XHTML document  In addition, the rel attribute specifies the nature of the relationship between the stylesheet and the document that is referencing it – Persistent stylesheets must be applied to the document – Preferred style sheet should be applied the unless the user has selected a different alternate – Alternate style sheets may be selected by users depending on their preferences Css Founder.com
  • 23. Linking External Style Sheets – To make a style sheet persistent, set the rel attribute to "stylesheet". – To make a style sheet preferred, set the rel attribute to "stylesheet" and name the style sheet with the additional title attribute. – To specify an alternate style sheet, set the rel attribute to "alternate stylesheet" and name the style sheet with the title attribute. Css Founder.com
  • 24. Outline styles.css (1 of 1) 1 /* Fig. 6.4: styles.css */ 2 /* An external stylesheet */ 3 4 a { text-decoration: none } 5 6 a:hover { text-decoration: underline; 7 color: red; 8 background-color: #ccffcc } 9 10 li em { color: red; 11 font-weight: bold; 12 background-color: #ffffff } 13 14 ul { margin-left: 2cm } 15 16 ul ul { text-decoration: underline; 17 margin-left: .5cm } Css Founder.com
  • 25. Outline external.html (1 of 2) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig. 6.5: external.html --> 6 <!-- Linking external style sheets --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>Linking External Style Sheets</title> 11 <link rel = "stylesheet" type = "text/css" 12 href = "styles.css" /> 13 </head> 14 15 <body> 16 17 <h1>Shopping list for <em>Monday</em>:</h1> 18 <ul> 19 <li>Milk</li> 20 <li>Bread 21 <ul> 22 <li>White bread</li> 23 <li>Rye bread</li> 24 <li>Whole wheat bread</li> 25 </ul> Css Founder.com
  • 26. Outline 26 </li> 27 <li>Rice</li> 28 <li>Potatoes</li> 29 <li>Pizza <em>with mushrooms</em></li> 30 </ul> 31 32 <p> 33 <a href = "http://www.food.com">Go to the Grocery store</a> 34 </p> 35 36 </body> 37 </html> Css Founder.com
  • 27. W3C CSS Validation Service  Validates external CSS documents  Ensures that style sheets are syntactically correct  http://jigsaw.w3.org/css-validator/ Css Founder.com
  • 28. 6.10 Text Flow and the Box Model  Floating – Move an element to one side of the screen  Box model – Margins – Padding – Border Css Founder.com
  • 29. Outline floating.html (1 of 3) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig. 6.12: floating.html --> 6 <!-- Floating elements and element boxes --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>Flowing Text Around Floating Elements</title> 11 12 <style type = "text/css"> 13 14 div { background-color: #ffccff; 15 margin-bottom: .5em; 16 font-size: 1.5em; 17 width: 50% } 18 19 p { text-align: justify } 20 21 </style> 22 23 </head> 24 Css Founder.com
  • 30. Outline floating.html (2 of 3) 25 <body> 26 27 <div style = "text-align: center"> 28 Deitel &amp; Associates, Inc.</div> 29 30 <div style = "float: right; margin: .5em; 31 text-align: right"> 32 Corporate Training and Publishing</div> 33 34 <p>Deitel &amp; Associates, Inc. is an internationally 35 recognized corporate training and publishing organization 36 specializing in programming languages, Internet/World 37 Wide Web technology and object technology education. 38 The company provides courses on Java, C++, Visual Basic, C, 39 Internet and World Wide Web programming, and Object Technology.</p> 40 41 <div style = "float: right; padding: .5em; 42 text-align: right"> 43 Leading-Edge Programming Textbooks</div> 44 45 <p>The company's clients include many Fortune 1000 46 companies, government agencies, branches of the military 47 and business organizations.</p> 48 Css Founder.com
  • 31. Outline 49 <p style = "clear: right">Through its publishing 50 partnership with Prentice Hall, Deitel &amp; Associates, 51 Inc. publishes leading-edge programming textbooks, 52 professional books, interactive CD-ROM-based multimedia 53 Cyber Classrooms, satellite courses and World Wide Web 54 courses.</p> 55 56 </body> 57 </html> Css Founder.com
  • 32. Text Flow and the Box Model Content Margin Border Padding Css Founder.com
  • 33. Outline borders.html (1 of 2) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig. 6.14: borders.html --> 6 <!-- Setting borders of an element --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>Borders</title> 11 12 <style type = "text/css"> 13 14 body { background-color: #ccffcc } 15 16 div { text-align: center; 17 margin-bottom: 1em; 18 padding: .5em } 19 20 .thick { border-width: thick } 21 22 .medium { border-width: medium } 23 24 .thin { border-width: thin } 25 Css Founder.com
  • 34. Outline borders.html (2 of 2) 26 .groove { border-style: groove } 27 28 .inset { border-style: inset } 29 30 .outset { border-style: outset } 31 32 .red { border-color: red } 33 34 .blue { border-color: blue } 35 36 </style> 37 </head> 38 39 <body> 40 41 <div class = "thick groove">This text has a border</div> 42 <div class = "medium groove">This text has a border</div> 43 <div class = "thin groove">This text has a border</div> 44 45 <p class = "thin red inset">A thin red line...</p> 46 <p class = "medium blue outset"> 47 And a thicker blue line</p> 48 49 </body> 50 </html> Css Founder.com
  • 36. User Style Sheets  Format pages based on user preferences  User style sheets are not linked in the document – They are set in browser's options Css Founder.com
  • 37. Outline User_absolute.html (1 of 2) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig. 6.16: user_absolute.html --> 6 <!-- User styles --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>User Styles</title> 11 12 <style type = "text/css"> 13 14 .note { font-size: 9pt } 15 16 </style> 17 </head> 18 19 <body> 20 21 <p>Thanks for visiting my Web site. I hope you enjoy it. 22 </p><p class = "note">Please Note: This site will be 23 moving soon. Please check periodically for updates.</p> Css Founder.com
  • 39. Outline 1 /* Fig. 6.17: userstyles.css */ 2 /* A user stylesheet */ 3 4 body { font-size: 20pt; 5 color: yellow; 6 background-color: #000080 } Css Founder.com
  • 40. User Style Sheets Fig. 6.18 User style sheet in Internet Explorer 6. Css Founder.com
  • 41. User Style Sheets Css Founder.com
  • 42. Outline User_relative.html (1 of 2) 1 <?xml version = "1.0"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 4 5 <!-- Fig. 6.20: user_relative.html --> 6 <!-- User styles --> 7 8 <html xmlns = "http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>User Styles</title> 11 12 <style type = "text/css"> 13 14 .note { font-size: .75em } 15 16 </style> 17 </head> 18 19 <body> 20 21 <p>Thanks for visiting my Web site. I hope you enjoy it. 22 </p><p class = "note">Please Note: This site will be 23 moving soon. Please check periodically for updates.</p> Css Founder.com
  • 44. User Style Sheets Fig. 6.21 User style sheet applied with em measurement. Css Founder.com