Cascading Style Sheets (Formatting). Slide 2 Lecture Overview (1) At this point, you have learned how and where to create styles Internal, embedded, external.

Slides:



Advertisements
Similar presentations
LIS901N: Style sheet Thomas Krichel Style sheets Style sheets are the officially sanctioned way to add style to your document We will cover.
Advertisements

Web Engineering 1 Ishaq Khan Shinwari MCS City University Peshawar.
Part 3 Introduction to CSS. CSS Text Text Styles h1 {color: green} // rgb(0,255,0), #00ff00 h2{letter-spacing: 0.5cm} // 2px h3 {text-align: right} //
Measurement Many CSS properties (values within the declaration) require that you specify a unit of measurement, such as spacing between elements, border.
Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
9-May-15 More CSS. 2 A different emphasis CSS is the same for XML as it is for HTML and XHTML, but-- XML contains no display information If you want your.
Week 9 Using the Box Properties. 9-2 The CSS Visual Formatting Model Describes how the element content boxes should be displayed by the browser –Based.
Cascading Style Sheets (Formatting. Slide 2 Lecture Overview At this point, you have learned how and where to create styles You have not learned much.
CS4370/6370 Web Development Cascading Style Sheets (CSS)
CASCADING STYLE SHEETS CSS. 2 What CSS means?  CSS is an extension to basic HTML that allows you to style your web pages.  It separates the part that.
Week 7 Web Typography. 2 Understanding Type Design Principles.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts 1.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
14-Jul-15 CSS Applications to XML. 2 A different emphasis CSS is the same for XML as it is for HTML, but-- HTML already does a pretty good job of layout.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
+ Text & Font Styles Unit 3 Lesson Different Font Categories Sans Serif – block style fonts Example - Rockwell Easy to read and good to use when.
Formatting Text (Plus More Selectors) Learning Web Design: Chapter 12.
Web Design – Sec 4-6 and 4-7 Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
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.
CSS1-1 Cascading Style Sheets (CSS) Xingquan (Hill) Zhu
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
Cascading Style Sheets CS3505. What are CSS? Method for adding style attributes consistently to HML tags Cascading because styles are applied in order.
CSS Dvijesh Bhatt.
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Principles of Web Design 6 th Edition Chapter 5 – Web Typography.
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
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.
Chapter 12 Cascading Style Sheets: Part II The Web Warrior Guide to Web Design Technologies.
CSS – Cascading Style Sheets Fred Durao
 A style sheet is a single page of formatting instructions that can control the appearance of many HTML pages at once.  If style sheets accomplished.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Creating Your Own Webpage COSC Cascading Stylesheets Think of: HTML: content of your webpage HTML has tags CSS: presentation and appearance of your.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
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 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,
Copyright © 2006, Jumail, FSKSM, UTM Slide 1 Cascading Style Sheets (CSS)
CSS Layout Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  CSS Box Model  CSS properties for border  CSS properties for.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
Cascading Style Sheets Web Design Fairport High School.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
CSS Cascading Style Sheets *referenced from
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
Tutorial 3 Designing a Web Page with 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.
1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
Microsoft Expression Web 3 – Illustrated Unit M: Advanced Typography Using CSS.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
Cascading Style Sheets (Formatting)
Cascading Style Sheets™ (CSS)
( Cascading style sheet )
Creating Your Own Webpage
Cascading Style Sheets (Formatting)
CSS – Properties & Values
The Internet 10/13/11 The Box Model
Second CSS Lecture Applications to XML
Cascading Style Sheets Color and Font Properties
Cascading Style Sheets
Cascading Style Sheets™ (CSS)
Presentation transcript:

Cascading Style Sheets (Formatting)

Slide 2 Lecture Overview (1) At this point, you have learned how and where to create styles Internal, embedded, external You have not learned much about the styles themselves Formatting text is the topic of this lecture

Slide 3 Lecture Overview (2) A typography history lesson Text and fonts Letter and word spacing Borders

Slide 4 A Typography History Lesson What we now do digitally, we once did entirely on the printed page May of the concepts and terms have persisted from print to digital

Slide 5 A Typography History Lesson Gutenberg invented movable type in 15 th century Germany replacing handwritten type Characters were made of fixed size blocks that were assembled together to form a page We could spend significant time on the subject of typefaces, fonts, and their history

Slide 6 A Typography History Lesson In 1886, Ottmar Merganthaler invented the linotype (line of type) composing machine It mechanically created lead impressions one line at a time controlled character and word spacing via spacebands o o

Slide 7 A Typography History Lesson Linotype machine illustration

Slide 8 A Typography History Lesson The monotype machine worked like the linotype but read a punched paper tape The paper tape was run through a separate casting machine

Slide 9 A Typography History Lesson To linotype machine was used until phototypesetting became feasible in 1960

Slide 10 A Typography History Lesson And all of this has been replaced by the computer and digital imaging

Slide 11 So why is this important These machines adjusted the space between characters and words to fully justify lines Tracking and kerning We could adjust the space between lines Leading We had facets (brass castings) for different fonts

Slide 12 Length Units Length units are used in styles to define the unit of measure for a font, line height, etc.. cm – centimeter mm – millimeter pc – pica (1/6 inch) (12 points) pt – point (1/72 inch) px – pixel in – inches percentage units as in 150%

Slide 13 Length Units (2) In typography, an em is a relative unit of measure Derived from the size of the letter “m” A unit of measure equal to 12 points In CSS an em is a unit of measure relative to the current font size If the current font 16 pixels, then…

Slide 14 Length Units (3) Assuming the current font size is 16 pixels You can use x.x em 1 em = 16 pixels 2 em = 32 pixels 2.5 em = 40 pixels

Slide 15 Styling (Color 1) Color is an important part of any page The color property defines the color of the text The background-color defines the color of the background CSS 3 supports some enhanced color formatting like textures and gradients

Slide 16 Styling (Color 2) There are three ways to specify a color A color name, such as red, blue, green, etc… These are called named colors and there about 255 of them A HEX value such as “#FF0000”, which is red A RGB value such as rgb(255,0,0)

Slide 17 Styling (Color) (Best Practices) Make sure that there is adequate contrast between background and foreground colors Don’t use too many colors Use bright colors only for emphasis Remember that users might be color blind Here is a nice color picker asp asp

Slide 18 Styling Fonts - Serifs CSS supports control of fonts and font characteristics Fonts are categorized as serifs and sans serifs Literature suggests serifs are more readable in print Because the better distinguish the ends of letters such as I and L Sans serif fonts are easier to read online Especially larger fonts because of limited screen resolution

Slide 19 Styling Fonts - Serifs

Slide 20 Styling (Font Families) The font-family CSS property controls the font that will be used The value contains a prioritized list of font family names Families are ordered from the most specific to the least specific (fallbacks)

Slide 21 Styling (Font Attributes) Fonts have a style as follows ( font-style ) Text is shown normally ( normal ) Text is shown in italics ( italic ) Similar to italics ( oblique ) text-transform lowercase, uppercase, capitalize

Slide 22 Styling (Font Attributes) Fonts have a weight ( font-weight ) bold, bolder, lighter Values between 100 and 900 can also be used The default weight is is the same as bold

Slide 23 Styling (Leading) Pronounced “Leding” It’s the whitespace between lines of text The term is derived from strips of lead placed between lines in linotype machines

Slide 24 Styling (Leading) Best practices Too little leading makes text appear dark and hard to read Too much leading makes text light and hard to read too On computer screens, percent line height relative to font height is a good metric Use less leading with all caps Always used relative values in CSS

Slide 25 Styling (Leading) The line-height property defines the height of a line (leading) Use to increase or decrease the spacing between lines Always used relative values because of the way CSS processes font sizes Line height is 1.4 times the font height line-height:1.4;

Slide 26 Styling (Tracking) Tracking addresses the space between letters in a word and spacing between words Reducing tracking too much makes text too dark Increasing tracking too much makes text too light Best practices Increase tracking for acronyms and other all- caps situations Reduce tracking for very large font sizes and headings

Slide 27 Styling (Tracking)

Slide 28 Styling (Tracking) The letter-spacing property controls the whitespace between letters The word-spacing property control the amount of whitespace between words

Slide 29 Styling Size A box (paragraph) has a height and width Width can be set to an absolute value or a percentage Height is typically set to an absolute value Limited use for this property as we will see when we talk about flow

Slide 30 Styling (Text 1) The text-align property controls the alignment of text inside of the box Valid values are center, justify, left, right The text-decoration property controls how text is adorned underline, overline, line-through

Slide 31 Styling (Text 2) The text-indent property controls the indentation of text along the left margin of the box Only the first line is indented Positive values indent to the right Negative values indent to the left (outdent)

Slide 32 Styling (Text 3) The white-space property controls whitespace normalization How multiple spaces between other characters are normalized

Slide 33 Whitespace Handling

Slide 34 Styling Lists (Unordered)

Slide 35 Styling Lists (Ordered)

Slide 36 Styling Lists (Example) list-style-type denotes the style of the item number or bullet list-style-image allows you to add a picture to an image ul { list-style- image:url("/images/blueball.gif"); list-style-type:square; } See TextStyles.htm

Slide 37 Styling (Borders 1) This is the border surrounding the imaginary box (remember we mentioned the box model) The border has a style, which must be set for the border to display The border-style property has the following possible values dotted, dashed, solid, double, groove, ridge, inset, outset The visual effect depends on the border-width and border-color properties

Slide 38 Styling (Borders 2) We can control each side of the border border-top border-bottom border-left border-right

Slide 39 Styling (Borders 3) The border-width property controls the thickness of the border The border-color property controls the color of the border It’s possible to control the individual border sides border-top… See IS360CSSBorders.htm in the sample project

Slide 40 Styling (Borders 4) New to CSS 3, we can easily create rounded corners Use the border-radius property to crate rounded corners border-radius is a shorthand property for border-top-left-radius, border-top- right-radius, border-bottom-left- radius and border-bottom-right-radius

Slide 41 Styling (Borders 5)

Slide 42 Styling (Transformations) These are new to CSS3 There are 2D and 3D transformations translate rotate scale skew matrix