Web Development & Design Foundations with H T M L 5

Slides:



Advertisements
Similar presentations
CSS-Formatting Review Cascading Style Sheets addstyle to your HTML web pages.
Advertisements

CSS Cascading Style Sheets. Objectives Using Inline Styles Working with Selectors Using Embedded Styles Using an External Style Sheet Applying a Style.
Web Development & Design Foundations with XHTML Chapter 3 Key Concepts.
Cascading Style Sheets
/k/k 1212 Cascading Style Sheets Part one Marko Boon
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.
Introducing CSS CIS 133 mashup Javascript, jQuery and XML 1.
CSS. CSS, or Cascading Styles Sheets, is a way to style HTML. Whereas the HTML is the content, the style sheet is the presentation of that document.
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 By: Valerie Kuna. What are Cascading Style Sheets? Cascading Style Sheets (CSS) are a standard for specifying the presentation.
1 Web Developer & Design Foundations with XHTML Chapter 9 Key Concepts.
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.
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.
CSS normally control the html elements. Three Ways to Insert CSS There are three ways of inserting a style sheet: External style sheet Internal style.
CM143 Week 4 Introducing CSS. Cascading Style Sheets A definition for the style in which an element of the webpage will be displayed Border width, colour,
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
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
CSS Cascading Style Sheets. CSS Advantages Greater typography and page layout control Style is separate from structure Styles can be stored in a separate.
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.
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.
1 Cascading Style Sheets
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 FOUNDATIONS CSS Overview. Outline  What is CSS  What does it do  Where are styles stored  Why use them  What is the cascade effect  CSS Syntax.
WebD Introduction to CSS By Manik Rastogi.
Web Development & Design Foundations with XHTML
CSS Cascading Style Sheets.
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
Introduction to the Internet
Chapter 6 Cascading Style Sheets™ (CSS)
Madam Hazwani binti Rahmat
CX Introduction to Web Programming
Web Developer & Design Foundations with XHTML
Using Cascading Style Sheets Module B: CSS Structure
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D.
Copyright (c) 2007 Prentice-Hall. All rights reserved.
Web Development & Design Foundations with HTML5
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Website Design 3
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
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with H T M L 5
Web Programming– UFCFB Lecture 11
What are Cascading Stylesheets (CSS)?
Web Development & Design Foundations with H T M L 5
The Internet 10/6/11 Cascading Style Sheets
Cascading Style Sheets
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with HTML5 8th Edition
Web Development & Design Foundations with H T M L 5
Web Development & Design Foundations with H T M L 5
Tutorial 3 Working with Cascading Style Sheets
Web Design and Development
Basics of Web Design Chapter 4 Cascading Style Sheets Basics Key Concepts Copyright © 2016 Terry Ann Morris, Ed.D.
Stylin’ with CSS.
CS332A Advanced HTML Programming
Presentation transcript:

Web Development & Design Foundations with H T M L 5 Ninth Edition Chapter 3 Configuring Color and Text with C S S If this PowerPoint presentation contains mathematical equations, you may need to check that your computer has the following installed: 1) MathType Plugin 2) Math Player (free versions available) 3) NVDA Reader (free versions available) Slides in this presentation contain hyperlinks. JAWS users should be able to get a list of links by using INSERT+F7 Copyright © 2019, 2017, 2015 Pearson Education, Inc. All Rights Reserved

CSS Selectors CSS style rules can be configured for an: HTML element selector class selector id selector descendant selector

Using CSS with “class” class Selector Configure with .classname Apply a CSS rule to a certain "class" of elements on a web page Does not associate the style to a specific HTML element Configure with .classname code CSS to create a class called “new” with red italic text. Apply the class: <p class=“new”>This is text is red and in italics</p> <style> .new { color: #FF0000; font-style: italic; } </style>

Using CSS with “id” id Selector Configure with #idname Apply the id: Apply a CSS rule to ONE element on a web page. Configure with #idname Code CSS to create an id called “new” with red, large, italic text. Apply the id: <p id=“new”>This is text is red, large, and in italics</p> <style> #new { color: #FF0000; font-size:2em; font-style: italic; } </style>

CSS Descendant Selector Specify an element within the context of its container (parent) element. AKA contextual selector The example configures a green text color only for p tags located within an element assigned to the id named content Advantage of contextual selectors: Reduces the number of classes and ids you need to apply in the HTML <style> #content p { color: #00ff00; } </style>

Hands-on practice 3.5 (pages 102-3) Chapter3/3.5/index.html

span element Purpose: configure a specially formatted area displayed in- line with other elements, such as within a paragraph. There is no additional empty space above or below a span – it is inline display.

span Element Example Embedded CSS: HTML: <style> .companyname { font-weight: bold; font-family: Georgia, "Times New Roman", serif; font-size: 1.25em; } </style> HTML: <p>Your needs are important to us at <span class=“companyname">Acme Web Design</span>. We will work with you to build your Web site.</p>

Hands-on practice 3.6 (pages 104-5) Chapter3/3.6/index.html

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

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

link Element A self-contained tag Placed in the head section Purpose: associates the external style sheet file with the web page. Example: <link rel="stylesheet" href="color.css">

Using an External Style Sheet External Style Sheet color.css body { background-color: #0000FF; color: #FFFFFF; } To associate the external style sheet called color.css, the HTML code placed in the head section is: <link rel="stylesheet" href="color.css">

Hands-on practice 3.7 (pages 106-7) Chapter3/3.7/index.html

Hands-on practice 3.8 (pages 107-9) Chapter3/3.8/index.html

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

Hands-on practice 3.9 (page 111) chapter3/3.9

The “Cascade”

Hands-on practice 3.10 (page 113-4) chapter3/3.10

W3C CSS Validation http://jigsaw.w3.org/css-validator/