1 Cascading Style Sheets™ (CSS) Outline 5.1 Introduction 5.2 Inline Styles 5.3 Embedded Style Sheets 5.4 Conflicting Styles 5.5 Linking External Style.

Slides:



Advertisements
Similar presentations
Copyright © 2003 Pearson Education, Inc. Slide 3-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
Advertisements

Cascading Style Sheets
1 © Netskills Quality Internet Training, University of Newcastle Introducing Cascading Style Sheets © Netskills, Quality Internet.
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Learn about Cascading Style Sheets LACUNY Web Management Roundtable October 21, 2005
Cascading Style Sheets
CSS Digital Media: Communication and design 2007.
Today CSS HTML A project.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
Making Things Look Nice: Visual Appearance and CSS CMPT 281.
Lecture 5 Use Cases and Style Sheets
Adding styles. Three alternatives HIT151 Web 'n' Net Web Page Basics /*stylesheet*/ h1,h2,h3 { font-family: verdana, arial, 'sans serif'; } p,table,li.
Introduction to CSS.
Cascading Style Sheets. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
Links.  Styling Links  Links can be styled with any CSS property (e.g. color, font-family, background-color).  Special for links are that they can.
Cascading Style Sheets By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
CSS BASICS. CSS Rules Components of a CSS Rule  Selector: Part of the rule that targets an element to be styled  Declaration: Two or more parts: a.
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
Recognizing the Benefits of Using CSS 1. The Evolution of CSS CSS was developed to standardize display information CSS was slow to be supported by browsers.
“Cascading Style Sheets” for styling WWW information DSC340 Mike Pangburn.
กระบวนวิชา CSS. What is CSS? CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to.
© 2010, Robert K. Moniot Chapter 5 CSS : Cascading Style Sheets 1.
Unit 20 - Client Side Customisation of Web Pages
 2002 Prentice Hall, Inc. All rights reserved. Chapter 4 – Cascading Style Sheets (CSS) Objectives –To take control of the appearance of a Web site by.
1 Dynamic HTML: Cascading Style Sheets™ (CSS). 2 Introduction Cascading Style Sheets (CSS) –Specify the style of your page elements –Spacing, margins,
1 XHTML Cascading Style Sheets™ (CSS). 2 Inline.html 1 2
 2003 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
 2002 Prentice Hall, Inc. All rights reserved. Chapter 4 – Cascading Style Sheets (CSS) Outline 4.1Introduction 4.2Inline Styles 4.3Creating Style Sheets.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Lecture 5. CSS 2 What style will be used when there is more than one style specified for an HTML element? Generally speaking we can say that all the styles.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
1 Dynamic HTML -Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style Sheets 6.4 Conflicting Styles 6.5 Linking External.
Pre-Module CSS BTM 395: Internet Programming. Cascading Style Sheets (CSS) Separation of structure from presentation CSS guide and tutorial –
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 14 – Dynamic HTML: Cascading Style Sheets (CSS) Outline 14.1Introduction 14.2Inline Styles.
Dreamweaver -- CSS. Dreamweaver -- MX New icons are added in MX Most of the features commonly used in web design, and are same as FrontPage. New feature.
Tutorial 6 By Sam INE 1020 Introduction to Internet Engineering 1 DHTML & CSS Tutorial 6.
1 WDMD 170 – UW Stevens Point WDMD 170 Internet Languages eLesson: CSS Introduction to Style Sheets (NON-audio version) © Dr. David C. Gibbs
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
DYNAMIC HTML What is Dynamic HTML: HTML code that allow you to change/ specify the style of your web pages. Example: specify style sheet, object model.
Introduction to CSS September 20, Introduction Cascading Style Sheets (CSS) –Separation of structure from presentation CSS guide and tutorial.
Cascading Style Sheets (CSS)
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
CSS Introductions. Objectives To take control of the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of.
Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g., fonts, colors, spacing) to Web documents Dr. Irwan Sembiring,ST.,M.Kom.
Internet & World Wide Web How to Program, 5/e 1. 2.
WebD Introduction to CSS By Manik Rastogi.
Chapter 6 - Cascading Style Sheets™ (CSS)
CSS: Cascading Style Sheets
Styling with Cascading Stylesheets Very Quick Introduction
Introduction to CSS.
Cascading Style Sheets
Chapter 6 Cascading Style Sheets™ (CSS)
Cascading Style Sheets
IS 360 Declaring CSS Styles
CX Introduction to Web Programming
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Introduction to CSS.
Introduction to Cascading Style Sheets (CSS)
The Internet 10/6/11 Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Web Development & Design Foundations with H T M L 5
Introduction to CSS.
Introduction to Cascading Style Sheets (CSS)
Cascading Style Sheets™ (CSS)
Presentation transcript:

1 Cascading Style Sheets™ (CSS) Outline 5.1 Introduction 5.2 Inline Styles 5.3 Embedded Style Sheets 5.4 Conflicting Styles 5.5 Linking External Style Sheets 5.6 Web Resources

2 Objectives In this lesson, you will learn: To control the appearance of a Web site by creating style sheets. To use a style sheet to give all the pages of a Web site the same look and feel. To use the class attribute to apply styles. To use style sheets to separate presentation from content.

3 5.1 Introduction Cascading Style Sheets (CSS) Separation of structure from presentation Three methods of CSS: Inline Styles Embedded Style Sheets Conflicting Styles Linking External Style Sheets

4 5.2 Inline Styles Declare an individual element’s format Attribute style CSS property followed by a colon and a value i.e: style = “font-size:20pt”

5 Example1: Inline styles: inline.html This text does not have any style applied to it. This text has the font-size style applied to it, making it 20pt. This text has the font-size and color styles applied to it, making it 20pt. and blue. The style attribute allows you to declare inline styles. Separate multiple styles with a semicolon.

6 5.3 Embedded Style Sheets Embed an entire CSS document in an XHTML document’s head section AttributesDescription MIME type type = “text/css” Multipurpose Internet Mail Extensions (MIME) type Describes a file’s content PropertyDescription background-color Specifies the background color font-family Specifies the name of the font to use font-size Specifies a 14-point font

7 Example2: Embedded style sheets: declared.html em { background-color: #8000ff; color: white } h1 { font-family: arial, sans-serif } p { font-size: 14pt }.special { color: blue } Deitel & Associates, Inc. Deitel & Associates, Inc... programming, and Object Technology. Clients The company's clients include many Fortune 1000 companies, government agencies, branches …. and World Wide Web courses. this begins the style sheet section

8 5.4 Conflicting Styles Inheritance Descendant’s properties have greater specificity than ancestor’s properties

9 Example3: Inheritance in style sheets: advanced.html a.nodec { text-decoration: none } a:hover { text-decoration: underline;color: red;background-color: #ccffcc } li em { color: red;font-weight: bold } ul { margin-left: 75px } ul ul { text-decoration: underline; margin-left: 15px } Shopping list for Monday : Milk Bread White bread Rye bread Whole wheat bread Rice Potatoes Pizza with mushrooms Go to the Grocery store

10 Example3: Inheritance in style sheets: advanced.html a.nodec { text-decoration: none } a:hover { text-decoration: underline;color: red;background-color: #ccffcc } li em { color: red;font-weight: bold } ul { margin-left: 75px } ul ul { text-decoration: underline; margin-left: 15px } Shopping list for Monday : Milk Bread White bread Rye bread Whole wheat bread Rice Potatoes Pizza with mushrooms Go to the Grocery store

Linking External Style Sheets External style sheets Can provide uniform look and feel to entire site

12 Example4: External style sheets: styles.css a { text-decoration: none } a:hover { text-decoration: underline; color: red; background-color: #ccffcc } li em { color: red; font-weight: bold; background-color: #ffffff } ul { margin-left: 2cm } ul ul { text-decoration: underline; margin-left:.5cm }

13 Example4: Linking external style sheets: external.html Shopping list for Monday : Milk Bread White bread Rye bread Whole wheat bread Rice Potatoes Pizza with mushrooms Go to the Grocery store

14

Web Resources tech.irt.org/articles/css.htm