Chapter 11 & 12 CSS Style Sheets: Intro. Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site.

Slides:



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

Building a Website: Cascading Style Sheets (CSS) Fall 2013.
Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
Tutorial 4 Formatting Text. XP New Perspectives on Blended HTML, XHTML, and CSS2 Objectives Create a spread heading Indent text Change the line spacing.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
Week 7 Web Typography. 2 Understanding Type Design Principles.
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Web Design & Development Cascading Style Sheets (CSS)
Cascading Style Sheets Cyndi Hageman. Applying a Style Sheet  In-line style – used within the HTML tag  Embedded Style Sheet – located in the HTML document.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 3 Key Concepts 1 Copyright © Terry Felke-Morris.
+ Text & Font Styles Unit 3 Lesson Different Font Categories Sans Serif – block style fonts Example - Rockwell Easy to read and good to use when.
CSS The Definitive Guide Chapter 6.  Text is the content, and fonts are used to display that content. By using text properties you can affect the position.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
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.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Principles of Web Design 6 th Edition Chapter 5 – Web Typography.
Week 4.  Three ways to apply CSS: Inline CSS Internal style sheets ( header style information) External style sheets.
Cascading Style Sheet (CSS)
Tutorial #3 Cascading Style Sheets. Review: Last Class Image sizing Pathnames Project Default Path Relative Path Absolute Path Blackboard Homework Submission.
Cascading Style Sheets, pt 2 ECA 225 Applied Online Programming.
Cascading Style Sheets CSS. CSS - Structure Declaration block Property: identifies what to change Value: how to change it Selector – example h1{ font-size:
WORKING WITH CASCADING
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
Chapter 3 © 2012 by Addison Wesley Longman, Inc Introduction - The CSS1 specification was developed in CSS2 was released in CSS2.1.
CSS – Cascading Style Sheets Fred Durao
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
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 5 Formatting with CSS. Objectives Session 5.1 – Evaluate why CSS styles are used – Determine where to write styles – Create an element selector.
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.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
Cascading Style Sheets Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
INTRODUCTORY Tutorial 3 Using CSS to Format Multiple Pages.
3. Cascading Style Sheets (CSS) M. Udin Harun Al Rasyid, S.Kom, Ph.D Lab Jaringan Komputer.
Cascading Style Sheets CSS.  Standard defined by the W3C  CSS1 (released 1996) 50 properties  CSS2 (released 1998) 150 properties (positioning)  CSS3.
Cascading Style Sheets Eugenia Fernandez IUPUI. CSS Purpose CSS allow you to specify the style in which your XML elements are displayed. CSS were originally.
XP Review 2 New Perspectives on JavaScript, Comprehensive1 Introducing Cascading Style Sheets Formatting Web Pages with CSS.
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.
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,
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
5 th ed: Chapter 4 4 th ed: Chapter 5 SY306 Web and Databases for Cyber Operations Slide Set #4: CSS.
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
CSS for Styling CS The good, the bad and the… ugly!  Tags such as b, i, u, and font are discouraged in strict XHTML  Why is this bad? CS380 2.
Web Design (14) CSS Formatting Text. Formatting Text In Brackets, go to your ‘externalcss’ website and find the ‘formattingtext’ page. Use the ‘main’
CSS: Cascading Style Sheets Part II. Style Syntax.
CSS Cascading Style Sheets *referenced from
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
Basic Webpage Design Cascading Style Sheet (CSS).
Tutorial 3 Designing a Web Page with CSS
CSCE Chapter 3 (Cascading Style Sheets) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer.
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)
Formatting Text with HTML and CSS. Summary block-level elements. Character-level elements Logical and physical style Special elements: hr,address, quotation.
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
Cascading Style Sheets Robin Burke ECT 270. Outline CSS properties Fonts Alignment Color CSS selection selectors.
CONFIGURING COLOR AND TEXT WITH CSS Chapter 3. Cascading Style Sheets (CSS) Used to configure text, color, and page layout. Launched in 1996 Developed.
CS3220 Web and Internet Programming CSS Basics
3.5 Property Value Forms - There are 60 different properties in 7 categories: - Fonts - Lists - Alignment of text - Margins - Colors - Backgrounds - Borders.
CSS Style Sheets: Intro
Cascading Style Sheets Color and Font Properties
Cascading Style Sheets™ (CSS)
Cascading Style Sheets
Presentation transcript:

Chapter 11 & 12 CSS Style Sheets: Intro

Why CSS? Separate presentation from content – more accessible Less work – can change appearance of whole site by changing one style sheet More precise layout control Big pushback when originally introduced

How do they work? Keep your html file the same Write style rules for how you’d like certain things to look Attach the style rules to the html document External – text file ending in.css Embedded – between tags in Inline – right inside desired tag

Format of rules Selector is an element type (h1, p, img) Each element type has different properties that may be changed List each one that needs to be changed and set its value p { font-size: small; font-family: sans-serif; } Selector { property1: value; property2: value; property3: value; }

Inheritance Some style properties get passed from parent to child, for example font-family and font-size General: Properties related to text get passed down Properties related to boxed elements (padding, border, margins) do not Benefit – don’t have to keep rewriting same rules

Conflicting Styles How to resolve style setting if specified in multiple places? Example: color set for body tag, but then color set for h1 tag Hierarchy: Browser settings User style settings (browser preferences) Linked external style sheet Imported style sheet Embedded style sheet Inline style information Any style rule marked !important by author Any style rule marked !important by user User style rules marked with !important have the highest precedence

Group work Book problems on page 223

FORMATTING TEXT

Font properties font-family font names, except generic families, are capitalized should stack fonts font-family: Futura, Univers, Geneva, sans-serif; generic families: serif, sans-serif, monospace, cursive, fantasy font-size should use em or % specification (1em = 100% = default font size) what is em? unit of measurement equal to current font size when determining other sizes, use target/context = result ex: page is using 16 pixels, you want article to be 14 pixels: 14/16 =.875

Font properties, cont’d font-weight normal, bold, lighter,… font-style normal, italic, oblique font-variant normal, small-caps font can do it all on one line order is important: style, weight, variant, size, font-family must have at least size and font-family color color value as name, rgb, hex or rgba

Selectors Element selector p { color: navy;} Grouped selectors p, h1 {color: navy;} Descendant selectors li em { color: navy;} h1 em, h2 em, h3 em { color: navy;} ID selectors #catalog123 {color: navy;} Class selectors p.special {color: navy;}

Conflicting Styles Revisited Hierarchy: Individual element selectors Contextual selectors Class selectors ID selectors ID selectors have the highest precedence

Text Line Adjustments line-height use em or % to specify minimum height of a line (visually affects distance between two lines) text-indent em or % to specify value to indent first line of paragraph may be a negative number text-align left, right, center, justify horizontal alignment

Others text-decoration none, underline, overline, line-through, blink (don’t use) text-transform none, capitalize, lowercase, uppercase letter-spacing insert space between letters word-spacing insert space between words list-style-type none, disc, circle, square, decimal, decimal-leading-zero, lower- alpha, upper-alpha, lower-latin, upper-latin, lower-roman, upper- roman, lower-greek

Shadow Text text-shadow horizontal offset, vertical offset, blur radius, color