Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.

Slides:



Advertisements
Similar presentations
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.
Advertisements

 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,
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
1 XHTML Cascading Style Sheets™ (CSS). 2 Inline.html 1 2
Working with Cascading Style Sheets
 2002 Prentice Hall, Inc. All rights reserved. Chapter 4 – Cascading Style Sheets (CSS) Outline 4.1Introduction 4.2Inline Styles 4.3Creating Style Sheets.
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
Tutorial 3 Working with Cascading Style Sheets. XP Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external.
Streamlining Website Development in Dreamweaver Roger L. Runquist Western Illinois University Roger L. Runquist Western Illinois University.
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.
CSS: Cascading Style Sheets. 2 History HTML tags were originally designed to define the content of a document. The layout of the document was supposed.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Cascading Style Sheets Billy Toy Cascading Style Sheets Syntax review How to Implement style sheets Background properties Text properties.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 14 – Dynamic HTML: Cascading Style Sheets (CSS) Outline 14.1Introduction 14.2Inline Styles.
CSS Dvijesh Bhatt.
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.
CS105 INTRODUCTION TO COMPUTER CONCEPTS CASCADING STYLE SHEETS (CSS) Instructor: Cuong (Charlie) Pham.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WORKING WITH CASCADING
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
CSS Introduction Cascading Style Sheets Provides a great deal of control over the presentation of the document HTML indicates both semantics of a document.
WDV 101 Intro to Website Development
Tutorial 3 Working with Cascading Style Sheets (CSS)
Doman’s Sections Information in this presentation includes text and images from
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.
CIS 1315 – Web Development for Educators CIS 1315 HTML Tutorials 3 & 4: Working With CSS.
 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.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Lecture # 33 Cascade Style Sheets (CSS). Cascade Style Sheets (CSS): Preserving a consistent “look and feel” of a website across multiple pages.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Cascading Style Sheet Bayu Priyambadha, S.Kom. Definition Cascading Style Sheets (CSS) form the presentation layer of the user interface. –Structure (HTML)
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
 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.
CSS Class 2 -Add margins to elements on a page. -Set width and height of elements. - CSS shorthand properties for box model. -Style links. -Style tables.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
1 Introduction to Web Application Introduction to Cascading Style Sheet.
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
CSS – Cascading Style Sheets
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
JavaScript and CSS
CSS: Cascading Style Sheets Part II. Style Syntax.
Cascading Style Sheet (CSS) SAMPLE IT133 Pengembangan Web.
Introduction To CSS. History of CSS ► ► CSS was proposed in 1994 as a web styling language. To helps solve some of the problems HTML 4. ► ► There were.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
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,
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 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
Welcome To Website Design, Hosting And Management Prepared By Webdev Solution ip ,223,96.
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
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.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Presentation transcript:

Cascading Style Sheets CS3505

What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order of priority- local, author style sheet, user style sheet, user browser New tag Ref: Deitel chapter 6, Greenlaw tutorial.html

CSS Types Inline Imbedded External User global definition for tags in this document applies here … global definition for tags in this document

Inline Styles Html tag’s can have style attributes Format style applies here Example: This text has the font- size and color styles applied to it, making it 20pt. and blue. Inline Page Example

Embedded Style Sheets Requires style rules in to add styles to html tags appearing in Format: tag {property: value;…property: value} … tag tag {property: value;…property: value}.classname {property: value;…property: value} #IdName {property: value;…property: value}

Definition in application in tag {property: value;…property: value} … tag1 tag2 {property: value;…property: value}.classname {property: value;…property: value} tag style applies here nested applies here doesn’t class definition applies here

Embedded Style Sheets Example Example a.nodec { text-decoration: none } a:hover { text-decoration: underline; color: red; background-color: #ccffcc }.special { color: green} 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

Style Rules Comments a.nodec defines a class applied to tags only a:hover syntax for styles applied to hover pseudo-class.special defines a class li em applies rule to nested tag occurrences (see Monday vs with mushrooms) Li,emcomma applies rule to both tags

Pseudo Classes and Elements Anchor Pseudo-classes –a:link{color:#ff0000} –a:visited{color:#00ff00} –a:hover{color:#0000ff} –a:active{color:#00ffff} Pseudo Elements –p:first-letter {font-size: 24pt} –p:first-line {color: #00ffff}

and *often used in Front page to organize HTML Span is an inline element like or Format … applies here Div is a block element and applies to a region of html which may contain and tags Format … …applies to HTML blocks and paragraphs here

and ID divisions Identify a specific DIV or SPAN segment by using the ID mechanism (see more_embedded.html) Define #IDname { Attributes} Use … applies here Example #svp94O { color: red; font-weight: bold}… Text using ID to identify this Red bold H4 line

External style sheets Define rules in one file and link them into one or many files Maintains a consistent style over complex webs that are easy to maintain and reuse. Example of external reference: Style definition file Html fileStyle definition file Html file

User Style Sheet Define styles you want the browser to use locally Tell your browser to use a local style sheet click tools->internet options->accessibility enter user style sheet path name Allows a local user to define colors, fonts, and sizes more easily readable

Style Properties How to find a list of properties which can be modified and the values associated with them Defining document –Cascading Style Sheets, level 1 W3C Recommendation 17 Dec 1996 – –Table of contents has a good list –A Good site for properties definitions

Sample Properties List 4 Formatting model 4.1 Block-level elements Vertical formatting Horizontal formatting List-item elements Floating elements 4.2 Inline elements 4.3 Replaced elements 4.4 The height of lines 4.5 The canvas 4.6 'BR' elements 5 CSS1 properties 5.1 Notation for property values 5.2 Font properties Font matching 'font-family' 'font-style' 'font-variant' 'font-weight' 'font-size' 'font' 5.3 Color and background properties 'color' 'background-color' 'background-image' 'background-repeat' 'background-attachment' 'background-position' 'background' 5.4 Text properties 'word-spacing' 'letter-spacing' 'text-decoration' 'vertical-align' 'text-transform' 'text-align' 'text-indent' 'line-height' 5.5 Box properties 'margin-top' 'margin-right' 'margin-bottom' 'margin-left' 'margin' 'padding-top' 'padding-right' 'padding-bottom' 'padding-left' 'padding' 'border-top-width' 'border-right-width' 'border-bottom-width' 'border-left-width' 'border-width' 'border-color' 'border-style' 'border-top' 'border-right' 'border-bottom' 'border-left' 'border' 'width' 'height' 'float' 'clear' 5.6 Classification properties 'display' 'white-space' 'list-style-type' 'list-style-image' 'list-style-position' 'list-style'