Cascading Style Sheets. Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving.

Slides:



Advertisements
Similar presentations
Table, List, Blocks, Inline Style
Advertisements

Intro To Cascading Style Sheets By Mario Yannakakis.
Cascading Style Sheets (CSS). Cascading Style Sheets With the explosive growth of the World Wide Web, designers and programmers quickly explored and reached.
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Cascading Style Sheets (CSS) “Styles” for short. Pg. 418.
Cascading Style Sheets
HTML Overview - Cascading Style Sheets (CSS). Before We Begin Make a copy of one of your HTML file you have previously created Make a copy of one of your.
CHAPTER 7 STYLING CONTENT WITH CASCADING STYLE SHEETS.
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
It’s All About Style The Basics of Style Sheets Presented by Barry Diehl.
CHAPTER 8 ADVANCED CSS. LEARNING OBJECTIVES Assign formatting styles to a CSS class definition Use a tag’s class attribute to apply the styles defined.
Cascading Style Sheets Basics. Why use Cascading Style Sheets? Allows you to set up a series of rules for all pages in a site. The series may be changed.
© 2004, Robert K. Moniot Chapter 6 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.
© 2010, Robert K. Moniot Chapter 5 CSS : Cascading Style Sheets 1.
Cascading Style Sheets SP.772 May 6, CSS Useful for creating one unified look for an entire web site. Helps to seperate style from content. Can.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
XP 1 Working with Cascading Style Sheets Creating a Style for Online Scrapbooks Tutorial 7.
Working with Cascading Style Sheets. 2 Objectives Introducing Cascading Style Sheets Using Inline Styles Using Embedded Styles Using an External Style.
© 2007 D. J. Foreman CSS-1 Cascading Style Sheets Styles.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Cascading Style Sheets Dreamweaver. Styles Determine how the HTML code will display Determine how the HTML code will display Gives designers much more.
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.
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.
Cascading Style Sheets (CSS) 1.  What is CSS?  Why CSS?  How to write a CSS? 2.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
CSS: Cascading Style Sheets. 2 What are Style Sheets A style sheet is a mechanism that allows to specify how HTML (/XHTML/XML) pages should look The style.
Css. Definition Cascading style sheet (CSS) Cascading Style Sheets (CSS) is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
COP 3813 Intro to Internet Computing Prof. Roy Levow Lecture 3.
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.
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
CNIT 132 – Week 4 Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of.
Microsoft Expression Web 3 – Illustrated Unit D: Structuring and Styling Text.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
How to… Cascading Style Sheets. How to Insert a Style Sheet When a browser reads a style sheet, it will format the document according to it. There are.
CSS: Cascading Style Sheets Part II. Style Syntax.
- WE’LL LOOK AT THE POSITION PROPERTY AND HOW CSS RESOLVES CONFLICTS BETWEEN STYLING INSTRUCTIONS The position property; CSS specificity hierarchy.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
1 Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size, font color etc…
Internet & World Wide Web How to Program, 5/e 1. 2.
Working with Cascading Style Sheets
Cascading Style Sheets
IS 360 Declaring CSS Styles
Madam Hazwani binti Rahmat
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
DynamicHTML Cascading Style Sheet Internet Technology.
Cascading Style Sheets
DynamicHTML Cascading Style Sheet Internet Technology.
Web Design and Development
Chapter 6 Introducing Cascading Style Sheets
Cascading Style Sheets
Cascading Style Sheets - Building a stylesheet
Cascading Style Sheets
CS332A Advanced HTML Programming
Cascading Style Sheets™ (CSS)
Presentation transcript:

Cascading Style Sheets

Defines the presentation of one or more web pages Similar to a template Can control the appearance of an entire web site giving a consistent look Allow mass changes to entire site by changing the style

Cascading Style Sheets Multiple sheets can influence a single page Sheets can cascade effects to other sheets, each adding new features Complete specification can be downloaded at:

Types of Styles Inline Styles –Styles are added directly to the HTML tag Global Styles –Style is applied to the entire HTML document External Style Sheet –Styles are kept in a separate document with the.CSS extension –Multiple pages can share the style sheet

Inline Styles A style can be specified directly on an HTML tag without referring to a separate style sheet this approach allows use of the expanded parameters of a style not usually associated with an HTML tag

Global Style Definition To hide from older browsers that don’t support, enclose in a comment tag: <! - - style sheet rules here - - >

Style Rules Style is a collection of rules Rules have the syntax: selector { styles } Selector is the tag to be modified –example Styles are the properties that are being specified –example COLOR

Example Change all paragraphs to be blue and be italicized P { color: blue; font-style: italic } This is a demo of a style. All paragraphs will now have blue, italics It affects the entire document

Selectors Type Selectors –Identify the entire class of HTML tags to be modified Id Selectors –Identify a name that can be used to specify selectively which HTML tags are modified

Selectors Context Selectors –Identifies HTML tags to be modified within the context of other HTML tags Class Selectors –Creates a class that various HTML tags can belong to based on the CLASS parameter

Type Selector Example: Change Ordered and Unordered List Items to use italics and bold UL, OL { font-style: italic; font-weight: bold}

ID Selector #MyParaA { font-style: italic; font- weight: bold} #MyParaB { color: red}

Context Selector UL LI { color: red} OL LI { color: blue } Line items in an unordered list will be red Line items in an ordered list will be blue

Class Selector.MyClass { font-style: italic; font-weight: bold}.MyRedClass { color: red}...

Combination Selector LI.MyRedClass { color: red} this will only affect the LI tags that use this class this won’t be part of the class Other type tags using the class won’t be affected

and Create an area on the HTML page that can cover multiple tags A is separated from adjacent areas by a line break A can be in the middle of text Both can be modified by styles

span { color: red} this is before the span this is inside the span other tags can be inside a span this is still inside the span this is after the span

div { color: red} this is before the div this is inside the div other tags can be inside a div this is still in the div this is after the span and will be separated by a line break

Parent Styles are Inherited by Children Children’s styles will override their parents

Styles In Separate Documents Allows multiple HTML pages to share Place inside tags URL should refer to a file with an extension of.CSS

Styles In Separate Documents CSS document contains only the definitions of the style rules ( i.e. no tags) P { color:red }

Linking Alternative method to reference external style sheet Microsoft Extension CSS can include styles from another url(stylesheet.css) additional styles

Style Precedence Inline Style Overrides Global Style Global Style Overrides External Style Sheet Style Sheets that Reference Other Style Sheets Override the Referenced Sheets Anything Not Specified Defaults to the Browser Settings

Absolute Positioning Styles can be used to positioning an element on a page in an exact position, instead of the normal “flow” of HTML POSITION: absolute TOP: top of element LEFT: left edge of element Z-INDEX: Layer effect -- higher indexes appear in front lower indexes

Absolute Positioning style="POSITION: absolute; LEFT: 127px; TOP: 253px; Z-INDEX: 100” This style would place the element’s upper left corner 252pixels from the top, and 127 pixels from the left edge of the window. It would appear on top of any other element in the same location with an index < 100