CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.

Slides:



Advertisements
Similar presentations
Web Development & Design Foundations with XHTML Chapter 3 Key Concepts.
Advertisements

Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 4 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
กระบวนวิชา 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.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
CSS Color & Text Cascading Style Sheets. Advantages of CSS Typography and page layout can be better controlled Style is separate from structure Documents.
Web Development & Design Foundations with XHTML Chapter 3 Key Concepts.
XP Introducing Cascading Style Sheets With Cascading Style Sheets (CSS), you can create one or more documents that control the appearance of some or all.
Chapter 6 Web Typography
Web Development & Design Foundations with HTML5
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
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.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Cascading Style Sheet (CSS) Instructor: Dr. Fang (Daisy) Tang
4.01 Cascading Style Sheets
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Stylin’ with CSS. 2 Topics What is CSS? Why CSS? CSS Examples.
Chapter 5 Web Graphics Styling Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
1 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Cascaded Style Sheets Implementing web pages using only html/xhtml is tedious and awkward With CSS, you can design a component to be used in a web page.
HTML - Quiz #2 Attendance CODE:
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Today’s objectives  Complete web page  Using xhtml & CSS  Adding CSS to documents Embed url(File);  CSS.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 6 Web Typography. 2 Principles of Web Design Chapter 5 Objectives Understand principles for type design on a Web site Use the element Understand.
Today’s objectives  Presentational | Inline | Block | Validate  CSS | Rules | Declarations.
Cascading Style Sheets Class 1, Lecture 1 Rachel A Ober
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Cascading Style Sheets
HTML, Third Edition--Illustrated Introductory 1 HTML, Third Edition Illustrated Introductory Unit E Formatting with Cascading Style Sheets.
 This presentation introduces the following: › 3 types of CSS › CSS syntax › CSS comments › CSS and color › The box model.
CIS67 Foundations for Creating Web Pages Professor Al Fichera Rev. September 14, 2010—All HTML code brought to XHTML standards. Reference for CIS127 and.
CSS My favourite ICT lesson By Federico Boschi Cascading Style Sheets.
Just A Few More Fun Objectives 1 Having Some Fun With Java Script 2 Using Style Sheets.
CO1552 – Web Application Development Cascading Style Sheets.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Cascading Style Sheets Class 2, Lecture 2 Rachel A Ober
Stylin’ with CSS Monday October 8 th and Tuesday October 9 th.
CSS Tutorial 1 Introduction Syntax How to use style specifications. Styles.
Cascading Style Sheets
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
XHTML Formatting font with a style declaration. Formatting Font HTML uses the font tag to change size and family of font But… the font tag is being deprecated.
OV Copyright © 2008 Element K Content LLC. All rights reserved.  Format Text  Format Lists  Format Images  Modify Page Background Applying Styles.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
Cascading Style Sheets Primary readings Presentations Explain & review projects with class mates.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Basic Webpage Design Cascading Style Sheet (CSS).
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
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.
Web Development & Design Foundations with XHTML
CSS Cascading Style Sheets.
4.01 Cascading Style Sheets
Web Development & Design Foundations with HTML5 8th Edition
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Web Development & Design Foundations with HTML5
Web Developer & Design Foundations with XHTML
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Web Development & Design Foundations with HTML5
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with H T M L 5
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2016 Terry Ann Morris, Ed.D.
4.01 Cascading Style Sheets
Presentation transcript:

CSS Cascading Style Sheets

CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate document and linked to from the web page Potentially smaller documents Easier site maintenance 2

CSS Syntax Sample Configure a Web page to display blue text and yellow background. body { color: blue; background-color: yellow; } This could also be written using hexadecimal color values as shown below. body { color: #0000FF; background-color: #FFFF00; } 3

Web Color Palette A collection of 216 colors Display the most similar on the Mac and PC platforms Hex values: 00, 33, 66, 99, CC, FF Color Chart 4

The font-family Property Not everyone has the same fonts installed in their computer Configure a list of fonts and include a generic family name p {font-family: Arial,Verdana, sans-serif;}

External Style Sheets - 1 CSS style rules are contained in a text file separate from the XHTML documents. The External Style Sheet text file: –extension ".css" –contains only style rules –does not contain any XHTML tags 6

body {background-color:#E6E6FA; color:#000000; font-family:Arial, sans-serif; font-size:90%; } h2 { color: #003366; }.nav { font-size: 16px; font-weight: bold; } body {background-color:#E6E6FA; color:#000000; font-family:Arial, sans-serif; font-size:90%; } h2 { color: #003366; }.nav { font-size: 16px; font-weight: bold; } External Style Sheets - 2 –Multiple web pages can associate with the same external style sheet file. 7 site.css index.htm clients.htm about.htm Etc…

The Element A self-contained tag Placed in the header section Purpose: associates the external style sheet file with the web page. Example: 8

Embedded Styles Example body { background-color: #E6E6FA; color: #191970; font-family: Arial, Verdana, sans-serif; } h1 { background-color: #191970; color: #E6E6FA; line-height: 200%; font-family: Georgia, "Times New Roman", serif; } h2 { background-color: #AEAED4; color: #191970; font-family: Georgia, "Times New Roman", serif; } p {font-size:.90em; } ul {font-weight: bold; }

Using CSS with “class” class Selector – Apply a CSS rule to a certain "class" of elements on a Web page – Does not associate the style to a particular XHTML element Configure with.classname The sample creates a class called “new” with red italic text. To use the class, code the following XHTML: This is text is red and in italics 10.new { color: #FF0000; font-style: italic; }

Using CSS with “id” id Selector – Apply a CSS rule to ONE element on a Web page. Configure with #idname The sample creates an id called “new” with red, large, italic text. To use the id, code the following XHTML: This is text is red, large, and in italics 11 #new { color: #FF0000; font-size:2em; font-style: italic; }

Using CSS with “id” id Selector – Apply a CSS rule to ONE element on a Web page. Configure with #idname The sample creates an id called “new” with red, large, italic text. To use the id, code the following XHTML: This is text is red, large, and in italics 12 #new { color: #FF0000; font-size:2em; font-style: italic; }

Centering Page Content with CSS #container { margin-left: auto; margin-right: auto; width:80%; }

Trillium Media Design … Copyright © 2011 Your Name Here

The CSS padding Property Configures empty space between the content of the XHTML element and the border Set to 0px by default h2 { border: 2px solid #ff0000; padding: 5px; } No padding configured:

XHTML Image Element Configures graphics on a Web page src Attribute ◦ File name of the graphic alt Attribute ◦ Configures alternate text content (description) height Attribute ◦ Height of the graphic in pixels width Attribute ◦ Width of the graphic in pixels 16

Image Links To create an image link use an anchor element to contain an image element Browsers automatically add a border to image links. Configure CSS to eliminate the border img {border:0 } 17 Home

CSS background-image Property Configures a background-image By default, background images tile (repeat) body { background-image: url(background1.gif); }

Thumbnail Image A small image configured to link to a larger version of that image. 19

Favorites Icon - favicon A square image associated with a Web page Usually named: favicon.ico May display in the browser address bar, tab, or favorites/bookmarks list Configure with a link tag: