Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc. 2013. All Rights Reserved.

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

© 2004, Robert K. Moniot Chapter 6 CSS : Cascading Style Sheets.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
1 Dynamic HTML: Cascading Style Sheets™ (CSS). 2 Introduction Cascading Style Sheets (CSS) –Specify the style of your page elements –Spacing, margins,
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Introduction to Web Site Development Steven Emory Department of Computer Science California State University, Los Angeles Lecture 5: Cascading Style Sheets.
Lecture 7 Cascading Style Sheets (CSS) Boriana Koleva Room: C54
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
Cascading Style Sheets 1 Color and Backgrounds. Cascading Style Sheets 2 Color and Backgrounds Computer color basics Expression of color values using.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
TECH2018 Multimedia and the Internet More about CSS and Page Layouts.
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,
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 14 – Dynamic HTML: Cascading Style Sheets (CSS) Outline 14.1Introduction 14.2Inline Styles.
HTML - Quiz #2 Attendance CODE:
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
New Perspectives on XML, 2nd Edition Tutorial 5 1 TUTORIAL 5 WORKING WITH CASCADING STYLE SHEETS.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
WRT235: Writing in Electronic Environments CSS Backgrounds, colors, fonts.
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.
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
CSS My favourite ICT lesson By Federico Boschi Cascading 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.
Class three: CSS review, backgrounds, font formatting, the box model.
Tutorial 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
 2004 Prentice Hall, Inc. All rights reserved. Chapter 6 - Cascading Style Sheets™ (CSS) Outline 6.1 Introduction 6.2 Inline Styles 6.3 Embedded Style.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
DIV, Span, CSS.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
DHTML AND JAVASCRIPT Genetic Computer School LESSON 4 CASCADING STYLE SHEET G H E F.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Introduction to CSS September 20, Introduction Cascading Style Sheets (CSS) –Separation of structure from presentation CSS guide and tutorial.
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,
3.2 Cascading Style Sheets. 2 Positioning Elements Normally, elements are laid out on the page in the order that they are defined in the XHTML document.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Introduction to Web Site Development John Hurley Department of Computer Science California State University, Los Angeles Lecture 5: Cascading Style Sheets.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CSS: Cascading Style Sheets Part II. Style Syntax.
Basic Webpage Design Cascading Style Sheet (CSS).
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Tutorial 3 Designing a Web Page with CSS
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.
Instructor: Sergey Goldman Based on Based on Internet & World Wide Web How To Program Multiple Editions.
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.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
CIS 4004: Web Based IT (CSS) Page 1 © Dr. Mark Llewellyn CIS 4004: Web Based Information Technology Fall 2012 Cascading Style Sheets (CSS) Department of.
HTML & CSS Contents: the different ways we can use to apply CSS to The HTML documents CSS Colors and Background CSS Fonts CSS Text CSS box model: padding,
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
Internet & World Wide Web How to Program, 5/e 1. 2.
Cascading Style Sheets™ (CSS)
Chapter 6 Cascading Style Sheets™ (CSS)
Using Cascading Style Sheets Module B: CSS Structure
Intro to CSS CS 1150 Fall 2016.
IS333: MULTI-TIER APPLICATION DEVELOPMENT
Cascading Style Sheets - Building a stylesheet
Intro to CSS CS 1150 Spring 2017.
Cascading Style Sheets Color and Font Properties
Cascading Style Sheets™ (CSS)
Cascading Style Sheets - Building a stylesheet
Cascading Style Sheets™ (CSS)
Presentation transcript:

Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.

 Cascading Style Sheets 3 (CSS3)  Used to specify the presentation of elements separately from the structure of the document. © by Pearson Education, Inc. All Rights Reserved.

 First technique: Inline style  declare an individual element’s format using the HTML5 attribute style.  Each CSS property is followed by a (:)and the value of the attribute  Multiple property declarations are separated by a semicolon © by Pearson Education, Inc. All Rights Reserved.

 color property sets text color © by Pearson Education, Inc. All Rights Reserved.

 A second technique :embedded style sheets,  Embed a CSS3 document in an HTML5 document’s head section. © by Pearson Education, Inc. All Rights Reserved.

The style Element  Styles that are placed in a style element  style element type attribute specifies the specific encoding format of the style sheet. Style sheets use text/css. © by Pearson Education, Inc. All Rights Reserved.

 The style sheet’s body declares the CSS rules for the style sheet.  An em element indicates that its contents should be emphasized.  Each rule body in a style sheet is enclosed in ( { and } ). © by Pearson Education, Inc. All Rights Reserved.

 font-weight property specifies the “boldness” of text. Possible values are:  bold  normal (the default)  bolder (bolder than bold text)  lighter (lighter than normal text)  Boldness also can be specified with multiples of 100, from 100 to 900 (e.g., 100, 200, …, 900). Text specified as normal is equivalent to 400, and bold text is equivalent to 700 © by Pearson Education, Inc. All Rights Reserved.

Style Classes  Style-class declarations are preceded by a period (.).  They define styles that can be applied to any element.  In this example, class special sets color to purple.  If an element in your page has an id, you can declare a selector of the form #elementId to specify that element’s style. © by Pearson Education, Inc. All Rights Reserved.

font-family Property  font-family property specifies the name of the font to use.  Font families allow to specify a type of font instead of a specific font © by Pearson Education, Inc. All Rights Reserved.

font-size Property  font-size property specifies the size used to render the font. © by Pearson Education, Inc. All Rights Reserved.

Applying a Style Class  In many cases, the styles applied to an element (the parent or ancestor element) also apply to the element’s nested elements (child or descendant elements). © by Pearson Education, Inc. All Rights Reserved.

 text-decoration property applies decorations to text in an element underline overline line-through blink © by Pearson Education, Inc. All Rights Reserved.

 In Fig. 4.3, the child em element has a color property that conflicts with (i.e., has a different value than) the color property of its parent p element.  Properties defined for child and descendant elements have a higher specificity than properties defined for parent and ancestor elements. © by Pearson Education, Inc. All Rights Reserved.

 Third: External style sheets are separate documents that contain only CSS rules. © by Pearson Education, Inc. All Rights Reserved.

 CSS comments may be placed in any type of CSS code (i.e., inline styles, embedded style sheets and external style sheets) and always start with /* and end with */. © by Pearson Education, Inc. All Rights Reserved.

 link element  Uses rel attribute to specify a relationship between two documents  rel attribute declares the linked document to be a stylesheet for the document  type attribute specifies the type of the related document  href attribute provides the URL for the document containing the style sheet © by Pearson Education, Inc. All Rights Reserved.

 CSS can control the backgrounds of block- level elements by adding:  Colors  Images © by Pearson Education, Inc. All Rights Reserved.

background-image Property  Specifies the URL of the image, in the format url(fileLocation) background-position Property  Values top, bottom, center, left and right individually or in combination for vertical and horizontal positioning. © by Pearson Education, Inc. All Rights Reserved.

background-repeat Property  Setting the tiling to no-repeat displays one copy of the background image  Setting to repeat (the default) tiles the image vertically and horizontally  Setting to repeat-x tiles the image only horizontally  Setting to repeat-y tile the image only vertically © by Pearson Education, Inc. All Rights Reserved.

background-attachment: fixed Property  Fixes the image in the position specified by background-position.  Scrolling the browser window will not move the image from its set position.  The default value, scroll, moves the image as the user scrolls the window © by Pearson Education, Inc. All Rights Reserved.

text-indent Property  Indents the first line of text in the element by the specified amount font-style Property  Allows you to set text to none, italic or oblique © by Pearson Education, Inc. All Rights Reserved.