CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.

Slides:



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

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.
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.
Tutorial 3 Introducing Cascading Style Sheets. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Learn about Cascading Style Sheets Write.
Introduction to Cascading Style Sheets (CSS) Module 2: HTML Basics LESSON 4.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 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.
Beginning Web Site Creation: Dreamweaver CS4. XHTMLCSS  Describes the structure  Content  Collection of styles  Formatting body { background-color:
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
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.
Selectors thru Borders. CSS – Cascading Style Sheets – is a way to style HTML HTML is the content base of a web page CSS provides the presentation qualities.
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 Web Developer Foundations: Using XHTML Chapter 9 Cascading Style Sheet Concepts.
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
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.
Cascading style sheets (CSS)
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
INTRODUCTION TO HTML5 Styling Text. Change the Font Size  You can use the font-size property to change the font size for a document’s text.  Instead.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
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.
Cascading Style Sheets
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
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.
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.
Cascading Style Sheets Chapter Four. What are they? A set of style rules that tell the web browser how to present a web page or document. Cascading Style.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
ALBERT WAVERING BOBBY SENG. Week 2: HTML + CSS  Quiz  Announcements/questions/etc  Some functional HTML elements.
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
Jozef Goetz, © Pearson Education Copyright (c) 2007 Prentice-Hall. All rights reserved. expanded by J. Goetz, 2015 Credits:
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
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.
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.
Web Design (12) CSS Introduction. Cascading Style Sheets - Defined CSS is the W3C standard for defining the presentation of documents written in HTML.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
CSS: Cascading Style Sheets Part II. Style Syntax.
CSS Cascading Style Sheets *referenced from
Basic Webpage Design Cascading Style Sheet (CSS).
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 3 Introducing Cascading Style Sheets.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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.
CSS.
Web Development & Design Foundations with XHTML
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.
( Cascading style sheet )
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
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
CSS Style Sheets: Intro
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:

CONFIGURING COLOR AND TEXT WITH CSS Chapter 3

Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed by W3C CSS Zen Garden Web Page Ex

Advantages of CSS More options for typography and page layout Style is separate from structure Styles can be stored Documents are smaller Site maintenance is easier

Configuring Cascading Style Sheets 1.Inline Styles – coded in the body. 2.Embedded Styles – defined within a style element in the head section. 3.External Styles – coded in a separate text file. 4.Imported Styles – similar to external, importing into sheet directive.

CSS Selectors and Declarations Selector – can be an HTML element name, a class name, or an id name. Declaration – indicates the CSS property you are setting and the value you are assigning to the property.

Background- Color Property Configures the background color of an element. body { background-color: yellow }

Color Property Configures the color of an element. body { color: blue }

Configure Background and Text Color body { color: blue; background-color: yellow; } Can configure more than one property for a selector Use semicolon (;) to separate

Spaces Optional body { color: blue; background-color; yellow; } body{color:blue;background-color:yellow} body { color: blue; background-color; yellow; }

Hexadecimal Color Values Uses RGB color (red, green, blue) Values of red, green, blue vary from 0 to 255 # is used to indicate a hexadecimal value Hex value pairs range from 00 to FF

CSS Color Syntax CSS SyntaxColor Type p { color: red; } Color name p { color: #FF0000; } Hexadecimal color value p { color: #F00; } Shorthand hexadecimal p { color: rgb (255, 0, 0; } Decimal color value p { color: hsl (0, 100%, 50%; } HSL color values

Inline CSS Inline styles are coded with a style attribute Heading text is red This is displayed as a red heading on a gray background

Hands-On Practice 3.1 1) Open to page 88 2) Open template.html from Ch 2 3) Modify with blue text from the book 4) Save first as inline2.html and second as inline3.html 5) Test page

Solution 3.1

Embedded CSS Placed within a element Style element nested in element Embedded Styles body { background-color: #ccffff; color: #000033; } Embedded CSS This page uses embedded styles.

Hands-On Practice 3.2 1) Open to page 90 2) Open starter.html from Ch 3 3) Modify with text from the book 4) Save as embedded.html 5) Test page

Solution 3.2

Font- Family Property Configures type fontface. p { font-family: Arial, Helvetica, sans-serif; }

Font- Size Property Sets the size of the font body { font-size: 1em; }

Font-weight Property Configures the boldness of the text body { font-weight: bold; }

Font-style Property Configures text displayed in italics. body { font-style: italic; }

Line-height Property Configures the height of the line of text (use the value 200% to appear double-spaced) body { line-height: 200%; }

Text-align Property Configures alignment of text within a block display element body { text-align: center; }

Text-indent Property Configures the indentation of the first line of text body { text-indent: 5em; }

Text- decoration Property Modifies the appearance of text with an underline, overline, or line-through body { text-decoration: none; }

Text- transform Property Configures the capitalization of text body { text-transform: uppercase; }

White-space Property Specifies the way the whitespace is displayed by the browser body { white-space: nowrap; }

Text-shadow Property Configures a drop shadow on text body { text-shadow: 3px 3px 5px #666; } Horizontal Offset Vertical Offset +# shadow on right -# shadow on left Blur Radius (optional) Color Value +# shadow below -# shadow above Higher value = more blur

Hands-On Practice 3.3 1) Open to page 97 2) Open embedded.html from Ch 3 3) Modify with text from the book 4) Save as embedded1.html 5) Test page

Solution 3.3

CSS Selectors CSS style rules can be configured for an: –HTML element selector –Class selector –Id selector –Descendant selector

Using CSS with Class Apply a CSS rule to a certain "class" of elements on a web page Does not associate the style to a specific HTML element Use.classname Placed in the tags:.feature { color: #c70000; } Placed within the tags: Usability Studies

Using CSS with ID Apply a CSS rule to ONE element on a web page. Use #idname Placed in the tags: #main { color: #333333; } Placed in the tags: This sentence will be displayed using styles configured in the main id.

Hands-On Practice 3.4 1) Open to page 101 2) Open embedded2.html from Ch 3 3) Modify with text from the book 4) Save as embedded3.html 5) Test page

Solution 3.4

Descendant Selector Used to specify an element within the context of its container (parent) element. main p { color: #00ff00; }

Span Element Defines a section on a web page that is not physically separated from other areas. Use if you need to format an area that is contained within another,,, or tag Trillium Media Design will bring…

Hands-On Practice 3.5 1) Open to page 103 2) Open embedded3.html from Ch 3 3) Modify with text from the book 4) Save as embedded4.html 5) Test page

Solution 3.5

Using External Style Sheets Link Element - associates an external style sheet with a web page. Goes in the tags:

Hands-On Practice 3.6 Part 1: 1)Open to page ) Open a NEW text editor page 3) Modify with text from the book 4) Save as color.css Part 2: 1)Open template.html from Ch 2 2)Modify with text from the book 3)Save as external.html 4) Test page

Solution 3.6

Hands-On Practice 3.7 1)Open to page 106 2)Follow directions in book 3)Test web page

Solution 3.7

ID Wrapper Centers the entire web page Configure a div element that “wraps” the entire page content …page content here… #wrapper { width: 700px; margin-left: auto; margin-right: auto; }

Hands-On Practice 3.8 1) Open to page 109 2)Create a NEW folder called Trillium2 3) Copy index.html, services.html, and trillium.css into folder 4)Follow directions in book

Solution 3.8

The “CASCADE” Rules of precedence Styles can be overridden when needed

Hands-On Practice 3.9 1) Open to page 119 2)Create a NEW folder named mycascade 3)Follow directions from the book

Solution 3.9

CSS Validation W3C has a free Markup Validation Service that checks your CSS code for any syntax errors.

Hands-On Practice ) Open to page 113 2) Open color.css from Ch 3 3) Follow directions from the book