Chapter 6 - Cascading Style Sheets™ (CSS)

Slides:



Advertisements
Similar presentations
Session 10 Dynamic HTML: Cascading Style Sheets™ (CSS), Object Model and Collections Matakuliah: M0114/Web Based Programming Tahun: 2005 Versi: 5.
Advertisements

Cascading Style Sheets
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.
Today CSS HTML A project.
CSS. Intro to CSS Cascading Style Sheets – styles and enhances appearance of webpage.css extension.
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.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
1 Pengantar Teknologi Internet W03: CSS Cascading Style Sheets.
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
1 XHTML Cascading Style Sheets™ (CSS). 2 Inline.html 1 2
Tutorial 5 Working with the Box Model. XP Objectives Understand the box model Create padding, margins, and borders Wrap text around an image Float a block-level.
 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.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
Pre-Module CSS BTM 395: Internet Programming. Cascading Style Sheets (CSS) Separation of structure from presentation CSS guide and tutorial –
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
XP Tutorial 7New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks.
Cascading style sheets (CSS)
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.
 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.
IS 360 Declaring CSS Styles. Slide 2 Introduction Learn about the three ways to declare a style Inline / embedded / external Learn about the effect of.
 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.
Lecture 2 - HTML and CSS Review SFDV3011 – Advanced Web Development 1.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
 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.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
CHAPTER 2 CSS (Cascading Style Sheet). Topics Introduction Inline Styles Embedded Style Sheets Conflicting Styles Linking External Style Sheets Positioning.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Introduction to CSS September 20, Introduction Cascading Style Sheets (CSS) –Separation of structure from presentation CSS guide and tutorial.
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Tutorial 4 Creating Page Layouts with CSS
Cascading Style Sheets (CSS)
CIS 228 The Internet 10/18/11 Grouping XHTML. CSS Selectors Rule: selector-group { property-declaration* } Selector-group: selector *, Selector: simple-selector.
Tutorial #5 Working with the Box Model. Tutorial #4 Review - CSS Create a homework page Final Project Discussion Exam on Blackboard Styling Lists (List-style-type,
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
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.
Internet & World Wide Web How to Program, 5/e 1. 2.
CSS.

Working with Cascading Style Sheets
Instructor: Sergey Goldman
Cascading Style Sheets™ (CSS)
Cascading Style Sheets Boxes
Cascading Style Sheets™ (CSS)
( Cascading style sheet )
CSS: Cascading Style Sheets
>> The “Box” Model
Chapter 6 Cascading Style Sheets™ (CSS)
CX Introduction to Web Programming
CSS3 Cascading Style Sheet
Cascading Style Sheets
CSS Applications to XML 19-Sep-18.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Creating Layouts Using CSS
Cascading Style Sheets
The Internet 10/13/11 The Box Model
CSS Borders and Margins.
Second CSS Lecture Applications to XML
Cascading Style Sheets™ (CSS)
More CSS 22-Feb-19.
Cascading Style sheet. What is CSS?  CSS stands for Cascading Style Sheets  Cascading: refers to the procedure that determines which style will apply.
CSS Applications to XML 20-May-19.
CSS Applications to XML 3-Jul-19.
Cascading Style Sheets™ (CSS)
Presentation transcript:

Chapter 6 - 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 Style Sheets 6.6 W3C CSS Validation Service 6.7 Positioning Elements 6.8 Backgrounds 6.9 Element Dimensions 6.10 Text Flow and the Box Model 6.11 User Style Sheets 6.12 Web Resources

In this lesson, you will learn: 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 specify the precise font, size, color and other properties of displayed text. To specify element backgrounds and colors. To understand the box model and how to control the margins, borders and padding. To use style sheets to separate presentation from content.

Cascading Style Sheets (CSS) 6.1  Introduction Cascading Style Sheets (CSS) Separation of structure from presentation

Declare an individual element’s format 6.2  Inline Styles Declare an individual element’s format Attribute style CSS property Followed by a colon and a value

inline.html (1 of 2)

inline.html (2 of 2)

Embed an entire CSS document in an XHTML document’s head section 6.3  Embedded Style Sheets Embed an entire CSS document in an XHTML document’s head section Multipurpose Internet Mail Extensions (MIME) type Describes a file’s content Property background-color Specifies the background color Property font-family Specifies the name of the font to use Property font-size Specifies a 14-point font

declared.html (1 of 3)

declared.html (2 of 3)

declared.html (3 of 3)

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

advance.html (1 of 3)

advance.html (2 of 3)

advance.html (3 of 3)

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

styles.css (1 of 1)

external.html (1 of 2)

external.html (2 of 2)

6.6 W3C CSS Validation Service Validates external CSS documents Ensures that style sheets are syntactically correct

6.6 W3C CSS Validation Service Fig. 6.6 Validating a CSS document. (Courtesy of World Wide Web Consortium (W3C).)

6.6 W3C CSS Validation Service Fig. 6.7 CSS validation results. (Courtesy of World Wide Web Consortium (W3C).)

6.7 Positioning Elements Absolute positioning Relative positioning z-index attribute Layer overlapping elements properly Relative positioning Elements are positioned relative to other elements

positioning.html (1 of 1)

positioning2.html (1 of 2)

positioning2.html 2 of 2

6.8 Backgrounds background-image background-position background-repeat Specifies the image URL background-position Places the image on the page background-repeat Controls the tiling of the background image background-attachment fixed scroll font-weight Specify the “boldness” of text

background.html (1 of 2)

background.html (2 of 2)

6.9  Element Dimensions CSS rules can specify the actual dimensions of each page element

width.html (1 of 2)

width.html (2 of 2)

6.10 Text Flow and the Box Model Floating Move an element to one side of the screen Box model Margins margin-top, margin-right, margin-left, margin-bottom Padding padding-top, padding-right, padding-left, and padding-bottom Border border-width thin, medium, thick border-color Sets the color border-style none, hidden, dotted, dashed, solid, double, groove, ridge, inset and outset

floating.html (1 of 3)

floating.html (2 of 3)

floating.html (3 of 3)

6.10 Text Flow and the Box Model Fig. 6.13 Box model for block-level elements.

borders.html (1 of 2)

borders.html (2 of 2)

borders2.html (1 of 2)

borders2.html (2 of 2)

6.11  User Style Sheets Format pages based on preferences

User_absolute.html (1 of 2)

User_absolute.html (2 of 2)

userstyles.css 1 of 1

6.11  User Style Sheets Fig. 6.18 User style sheet in Internet Explorer 6.

6.11  User Style Sheets Fig. 6.19 User style sheet applied with pt measurement.

User_relative.html (1 of 2)

User_relative.html (2 of 2)

6.11  User Style Sheets Fig. 6.21 User style sheet applied with em measurement.

6.12 Web Resources www.w3.org/TR/css3-roadmap www.ddj.com/webreview/style tech.irt.org/articles/css.htm