ECA 228 Internet/Intranet Design I Cascading Style Sheets.

Slides:



Advertisements
Similar presentations
CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Advertisements

Today CSS HTML A project.
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.
CSS CSS Precise Aesthetic Control. Cascading Style Sheets Though they can be put in HTML header, usually a separate page that the HTML links to Contains.
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.
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.
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.
CSW131 Steven Battilana 1 CSW 131 – Chapter 5 (More) Advanced CSS Prepared by Prof. B. for use with Teach Yourself Visually Web Design by Ron Huddleston,
กระบวนวิชา 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.
AD Intermediate Computer Graphics | spring 2008 | Daria Tsoupikova | School of Art and Design | UIC CSS Cascading Style Sheets.
Cascading Style Sheets. Slide 2 Lecture Overview Overview of Cascading Style Sheets (CSS) Ways to declare a CSS CSS formatting capabilities New features.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic CSS: Cascading Style Sheets.
Cascading Style Sheets Scripting with Style. CSS versus HTML  Ways to format in HTML –HTML Tag extensions –Converting Text to images –Page Layout with.
Cascading Style Sheets Controlling the Display Of Web Content.
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.
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.
Cascading Style Sheets (CSS) Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
CSS Dvijesh Bhatt.
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.
Cascading Style Sheet (CSS)
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
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.
Cascading Style Sheets by Pavlovic Nenad by. Presentation Contents  What is CSS?  Why CSS?  Types of Style Sheets  Style Sheets Syntax  Box Formatting.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
Website Development & Management Working with Style Rules Instructor: John Seydel, Ph.D. CIT Fall
Part 1: CSS - Why? - How it works - Writing rules - Examples.
Today’s objectives  Review  CSS | Rules | Declarations  HTML Structure document  Class asignment.
WRT235: Writing in Electronic Environments Basic CSS.
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.
Cascading Style Sheets Part 1. CSS vs HTML HTML: Originally intended to markup structure of a document (,...,,,,,...) CSS Developing technology, CSS1,
Css. Definition Cascading style sheet (CSS)  It is a simple mechanism for adding style (e.g. fonts, colors, spacing) to Web documents.
Project 4: Yosemite CSS Layout
HTML - Quiz #2 Attendance CODE:
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
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.
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 Level 2. Course Objectives, Session 1 Level 1 Quick Review Chapter 8: Adding Graphics to Web Pages Chapter 9: Sprucing Up Your.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheets (CSS). A style sheet is a document which describes the presentation semantics of a document written in a mark-up language such.
CS 174: Web Programming September 9 Class Meeting Department of Computer Science San Jose State University Fall 2015 Instructor: Ron Mak
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,
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
CSS – 1h. Without stylesheets proprietary HTML extensions making text into images proliferate use of "spacer" GIF images deprecated HTML elements and/or.
CSS Cascading Style Sheets A very brief introduction CSS, Cascading Style Sheets1.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
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.
CSS FOUNDATIONS IN-DEPTH The nitty-gritty of css...
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.
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…
CASCADING STYLE SHEET CSS. CSS stands for Cascading Style Sheets Styles define how to display HTML elements Styles were added to HTML 4.0 to solve a problem.
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
Internet & World Wide Web How to Program, 5/e 1. 2.
CSS: Cascading Style Sheets
Cascading Style Sheets
Introduction to web design discussing which languages is used for website designing
CASCADING STYLE SHEET CSS.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Presentation transcript:

ECA 228 Internet/Intranet Design I Cascading Style Sheets

ECA 228 Internet/Intranet Design I CSS rules RULE h1 { color: red; } Declaration SelectorPropertyValue

ECA 228 Internet/Intranet Design I CSS rules cont … each rule has 2 parts – selector: determines to which element a rule is applied – declaration: the rules to apply to the selector property: the name of the CSS property that describes the formatting being applied value: an allowable option to set or describe the property a rule may have more than one declaration – semicolon must end declarations – semicolon is optional for the last pair

ECA 228 Internet/Intranet Design I Applying CSS can be applied three ways: 1. Internal 2. External 3. Inline Internal – rules are placed inside tags in section h1 { color: red; }

ECA 228 Internet/Intranet Design I CSS Internal Example CSS Example h1 { color: red; }...

ECA 228 Internet/Intranet Design I Selectors element type to apply a rule to more than one element, separate them with a comma h1 { color: red; } h1, h2 { color: red; } This will be red> So will this

ECA 228 Internet/Intranet Design I Selectors cont … class – can be used more than once in HTML – case sensitive – prefixed with dot.redText { color: red; } This will be red

ECA 228 Internet/Intranet Design I Selectors cont … class cont … – can be used alone or contextually with elements h1.redText { color: red; } This will be red This will not

ECA 228 Internet/Intranet Design I Selectors cont … id – unique identifier – can only be used once in HTML – prefixed with hash or pound sign # #redText { color: red; } This will be red This will be red ILLEGAL

ECA 228 Internet/Intranet Design I Selectors cont … context – nested elements can be considered as parent/child – nested relationship is indicated without use of comma h1 em { color: red; } This word is red

ECA 228 Internet/Intranet Design I Selectors cont … context cont … – many properties are inherited ie, if a property belongs to the parent, it also applies to the child #div1{ color: red; } This is my header

ECA 228 Internet/Intranet Design I Selectors cont … context cont … – other properties, such as borders, are not inherited #border1{ border-style: double; border-width: thin; } This is my header This is my paragraph

ECA 228 Internet/Intranet Design I Selectors cont … context cont … – classes or ids can be nested inside one another #contentArea.green{ color: green; } This is green

ECA 228 Internet/Intranet Design I Selectors cont … pseudo-class – special type of class that allows formatting based on a state or condition if a link has been visited or not if the mouse passes over the link when the link is clicked a:link{ color: blue; text-decoration: none; } a:visited{ color: pink; text-decoration: none; } a:hover{ color: purple; text-decoration: underline; } a:active{ color: red; text-decoration: underline; }

ECA 228 Internet/Intranet Design I Selectors cont … pseudo-class – special type of class that allows formatting based on a state or condition first letter of every paragraph first line of every paragraph p:first-line{ font-size: 120%; } p:first-letter{ font-size: 150%; font-weight: bold; }

ECA 228 Internet/Intranet Design I Applying CSS can be applied three ways: 1. Internal 2. External 3. Inline External – external stylesheet is a separate document – to apply the same stylesheet to more than one page of a website – provides consistent look – to modify look of site, make changes in one place

ECA 228 Internet/Intranet Design I Applying CSS External cont … – no HTML in external stylesheet – no tags in external stylesheet – save as text file, with.css extension – to apply external stylesheet to an HTML document, link the document from inside the section

ECA 228 Internet/Intranet Design I Applying CSS External cont … – an HTML document can link to more than one external stylesheet at a time, as well as an internal sheet – if a conflict occurs, precedence is given to the rule defined last – URLs in an external stylesheet are relative to the location of the stylesheet, not the document linking to it

ECA 228 Internet/Intranet Design I Applying CSS Inline – used to apply style locally – within an HTML tag use style as an attribute, the rule as the value – separate definitions with a semicolon This word is red.

ECA 228 Internet/Intranet Design I Comments CSS comments /* This is a comment */ – using comments is a good way to debug a stylesheet which is not working – do not confuse /* */ with

ECA 228 Internet/Intranet Design I Box Model OUR CONTENT margin border padding