Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Syntax & Semantics Instructor: Joseph DiVerdi,

Slides:



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

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. CSS stands for Cascading Style Sheets and is a simple styling language which allows attaching style to HTML elements. CSS is a.
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.
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.
Part 3 Introduction to CSS. CSS Text Text Styles h1 {color: green} // rgb(0,255,0), #00ff00 h2{letter-spacing: 0.5cm} // 2px h3 {text-align: right} //
SM5312 week 6: basic CSS syntax1 An Introduction to Cascading Style Sheets Basic CSS Syntax Nick Foxall.
Controlling Page Style: Cascading Style Sheets (CSS) References: 1.Wang, P.S & Katila, S. (2004). A Introduction to Web Design and Programming. CA: Thomson.
Cascading Style Sheets. What is a style sheet? >A controlling document (or part of the document) >Sets the default appearance of items on the web page.
Cascading Style Sheets1. 2 n Style sheets are a means of controlling the way HTML tags are formatted n IE introduced style sheets in IE 3.0 release n.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
HIGHER COMPUTING CSS. WHAT IS CSS? CSS: Cascaded Style Sheets used to separate a web site’s content(information) from its style(how it looks).
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
Principles of Web Design 6 th Edition Chapter 4 – Cascading Style Sheets.
Chapter 11 Cascading Style Sheets: Part I The Web Warrior Guide to Web Design Technologies.
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.
Cascading Style Sheet (CSS)
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.
SE-2840 Dr. Mark L. Hornick 1 Separating Structure from Presentation: CSS.
CSS – Presentation of Information. Types of Style Sheets External Embedded h1{color:red; font-family: Arial;} Inline Text is here.
WDV 101 Intro to Website Development
Cascading Style Sheets " Provide means to control and change presentation of HTML documents. " Allow the user to impose a standard style. " Three levels.
I NTRO TO CSS IAT100 Spring I NTRO TO CSS Covered in this lesson: Overview What is CSS? Why to use CSS? CSS for Skinning your Website Structure.
Tutorial #4 Formatting Text and Links. Tutorial #3 Review - CSS CSS format Selector { property1: value1; /* Comments */ } Embedded, In-Line, and External.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 7.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Cascading Style Sheets Class 2, Lecture 2 Rachel A Ober
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
Introduction to CSS CSS Fonts - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Font Control Instructor: Joseph DiVerdi, Ph.D.,
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
XP Tutorial 7New Perspectives on HTML and XHTML, Comprehensive 1 Working with Cascading Style Sheets Tutorial 7.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
Chapter 6 Introducing Cascading Style Sheets Principles of Web Design, 4 th Edition.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
HTML – Organizing Page Content. HTML Images img tag Required attribute: src
ECA225 Applied Interactive Programming Cascading Style Sheets, pt 1 ECA 225 Applied Online Programming.
The Web Wizard’s Guide To DHTML and CSS Chapter 1 A Review of CSS1.
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.
1 Web Development CSS (Cascading Style Sheet). 2 1.Setting rules for multiple elements To decrease the amount of typing for setting rules for multiple.
1 Working with Cascading Style Sheet (CSS). 2 Cascading Style Sheets (CSS)  a style defines the appearance of a document element. o E.g., font size,
CSU - DCE Introduction to CSS CSS Colors - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Specifying Color Instructor: Joseph.
CSS (Cascading Style Sheet)
IS1825 Multimedia Development for Internet Applications Lecture 12: IDs, Classes and Internal CSS Rob Gleasure
CSS Syntax. Syntax The CSS syntax is made up of three parts: a selector, a property and a value: selector {property: value}
CSS: Cascading Style Sheets Part II. Style Syntax.
CSU - DCE Introduction to CSS CSS URLs - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Specifying URLs Instructor: Joseph.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
Tutorial 3 Designing a Web Page with CSS
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
CSS DHS Web Design. Location Between the & Start with – End with –
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 4 Formatting Text and Links.
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 Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
1 Cascading Style Sheets
WebD Introduction to CSS By Manik Rastogi.
Cascading Style Sheets
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
Cascading Style Sheets - Building a stylesheet
Cascading Style Sheets
Cascading Style Sheets - Building a stylesheet
Stylin’ with CSS.
Stylin’ with CSS.
Presentation transcript:

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Cascading Style Sheets - Syntax & Semantics Instructor: Joseph DiVerdi, Ph.D., MBA

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Rule Syntax A Style Is a Rule –Which Specifies How to Render an HTML Tag Any Valid HTML Tag Name Can Be Specified

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Rule Syntax selector { property: value; } selector - Identifies the Element Affected declaration - Combined Property & Value –Case Insensitive but Convention Dictates Tag names Are All Uppercase Properties & Values Are All Lowercase –Any Valid HTML Tag Name Can Be Selector Less Its Enclosing Characters

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Rule Syntax selector { property: value; } selector - Identifies the Element Affected declaration - Combined Property and Value BODY { background-color: aqua; }

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Multiple Properties Syntax Separate Multiple Properties by Semicolons selector { property1: value1; property2: value2; } P { background-color: aqua; color: red; } Use a Semicolon Even For One Property –Good Programming Practice

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Contextual Selectors Syntax Contextual Selectors –Define a Method to Have a Style Applied When a Tag Occurs Within a Certain Context When It Is Nested Within Other Tags bla, bla bla, bla bla, bla bla, bla bla, bla bla, bla is in Two Different Contexts

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Contextual Selectors Syntax selector1 selector2 { property: value; } –Applied When selector2 Occurs Within selector1 H1 EM{ color: red; } –H1 text will normally be bold & larger –EM text will normally italicized –With the Above Rule EM text in H1 will be bold, larger, italicized & red

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Contextual Selectors Classic Outline Numbering –Capital letters, e.g., A, B, C,... –Uppercase Roman numerals, e.g., I, II, III,... –Lowercase letters, e.g., a, b, c,... –Arabic numerals, e.g., 1, 2, 3,... OL LI { list-style: upper-alpha; } OL OL LI { list-style: upper-roman; } OL OL OL LI { list-style: lower-alpha; } OL OL OL OL LI { list-style: decimal; }

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Class Attribute Selectors Application of Style Rules Based on Special Identifying Attributes –Classify Elements by Adding CLASS Attribute: Current Statement Your account is past due. –Specify Styles for Particular Class Using: H1.important { color: red; }

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Class Attribute Selectors Same CLASS Name Used for Several Tags: Your account is past due. Pay attention! –Specify Styles for Particular Class Using: H1.important { color: red; } P.important { color: red; }

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Class Attribute Selectors Combine All CLASSes Into a General One:.important { color: red; }

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC ID Attribute Selectors Target Unique Elements by Adding ID Attribute New item added today –Specify Styles for Particular Class Using: P# { color: blue; } –Or Combine All Classes Into a Generic One: # { color: blue; } –Almost Indistinguishable With CLASS

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Pseudo-Class Definitions Replacement for Old-Style Three Pseudo-classes Defined for : A:LINK {color: blue; } A:ACTIVE {color: red; } A:VISITED {color: purple; }

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Pseudo-Class Definitions Complete Replacement for Old-Style A:LINK {color: blue; } A:ACTIVE {color: red; } A:VISITED {color: purple; } BODY {color: black; background-color: white; }

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC Alternate Values Syntax This is a Special Case for font-family Separate Alternate Values by Commas selector { font-family: value1, value2, value3,... ; } H1 { font-family: verdana, arial, helvetica; } Identify Your First Choice, Second Choice,... –More On This Later

Introduction to CSS CSS Syntax - Fort Collins, CO Copyright © XTR Systems, LLC The Cascade Defined More Than One Type of Style Definition Can Simultaneously Effect Presentation Style Is Hierarchical Highest-to-Lowest Weight HTML Tag Attributes Inline Style Document-Level Style Sheets Imported Style Sheets Linked External Style Sheet User Style Settings Browser Default Settings