CIS234A Lecture 5 Instructor Greg D’Andrea. Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style:

Slides:



Advertisements
Similar presentations
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} //
Advertisements

Cascading Style Sheets Color and Background Controls Border and Margin Controls (Boxes)
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.
1 Dynamic HTML: Cascading Style Sheets™ (CSS). 2 Introduction Cascading Style Sheets (CSS) –Specify the style of your page elements –Spacing, margins,
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.
Text Properties, Line Box, CSS. Text Properties Properties related to the display of text. Text-align : left, right, center I like FSU!
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.
Web Design & Development Cascading Style Sheets (CSS)
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
Using Cascading Style Sheets CSS Basics. Goals Understand basic syntax of Cascading Style Sheets (CSS) Understand basic syntax of Cascading Style Sheets.
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.
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.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
Working with Fonts, Colors, and Graphics HTML: Tutorial 3.
Lecture 7 Cascading Style Sheets (CSS) Boriana Koleva Room: C54
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
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
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.
Cascading Style Sheets Example
Cascading style sheets (CSS)
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
Cascading Style Sheet (CSS)
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
CSS The Definitive Guide Chapter 8.  Allows one to define borders for  paragraphs  headings  divs  anchors  images  and more.
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.
 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.
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.
Tutorial #3 Cascading Style Sheets. Tutorial #2 Review - Anchors Links to Site DMACC Internal Links Go to Top Mail To me Local.
Adding Graphics to Web Pages. CSS does not have any properties specifically aimed at formatting images Use properties you have already learned, i.e.,
Introduction to CSS. What is CSS?  Cascading Style Sheets  Used for styling HTML  Also important in javascript and jquery for selectors  External.
Lesson 03 // Cascading Style Sheets. CSS Stands for Cascading Style Sheets. We’ll be using a combination of Html and CSS to create websites. CSS is a.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
Cascading Style Sheets Chapters 5-6 Color and Background Controls Border and Margin Controls.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
CHAPTER 2 CSS (Cascading Style Sheet). Topics Introduction Inline Styles Embedded Style Sheets Conflicting Styles Linking External Style Sheets Positioning.
CIS234A Lecture 8 Instructor Greg D’Andrea. Review Text Table contains only text, evenly spaced on the Web page in rows and columns uses only standard.
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.
 2008 Pearson Education, Inc. All rights reserved Cascading Style Sheets™ (CSS)
1 CS428 Web Engineering Lecture 08 Border, Margin, Padding … (CSS - III)
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.
©SoftMoore ConsultingSlide 1 Introduction to HTML: Cascading Style Sheets.
Cascading Style Sheets Web Design Fairport High School.
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 *referenced from
CIS234A Lecture 6 Instructor Greg D’Andrea. Span and Div The span and div elements are a generic means by which we can add structure to documents. The.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
Chapter 7.  Change body and link styles  Create a drop-down menu  Change color and font styles in the menu  Create a pop-up effect using CSS  Utilize.
CS 120: Introduction to Web Programming Lecture 10: Extra Features and Website Design Part 1 Tarik Booker CS 120 California State University, Los Angeles.
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)
CSS Details Cascading Style Sheets. Lesson Overview  In this lesson, you will learn:  To use CSS properties for fonts  Evaluate whether to use pts,
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,
Unit 3 - Review. Topics 1. Tag, Attribute, Value 2. CSS Rule Syntax + link 3. Categories of Selectors 4. Inline vs Block Tags 5. CSS Layout 6. CSS Box.
Internet & World Wide Web How to Program, 5/e 1. 2.
Cascading Style Sheets™ (CSS)
Cascading Style Sheets™ (CSS)
Presentation transcript:

CIS234A Lecture 5 Instructor Greg D’Andrea

Font Styles Review Font-Family: generic family, font family Font-Size: em, pt, px, %, mm, cm, in Font-Style: Italic, normal Font-Weight: bold, normal Word-Spacing: length Letter-Spacing: length Text-Indent: length, % Text-Decoration: underline,overline,blink,line- through Line-Height: length

Measurement Units Absolute Units There are five standard units of measurement: – mm (millimeters) – cm (centimeters) – in (inches) – pt (points): 72 points in an inch – pc (picas): 6 picas in an inch, 12 points in a pica

Measurement Units Relative Units px (pixel) : which represents a single dot on the output device. Depends on the screen resolution. This is the default unit. em : 1em is equal to the current font size. 2em means 2 times the size of the current font. E.g., if an element is displayed with a font of 12 pt, then '2em' is 24 pt. The 'em' is a very useful unit in CSS, since it can adapt automatically to the font that the reader uses

Measurement Units ex : one ex is the x-height of a font (x-height is usually about half the font-size) % : a percentage of an element’s default font size.

Measurement Units Descriptive words Seven descriptive words: – xx-small, x-small, small, medium, large, x- large, xx-large

Span and Div The span and div elements are a generic means by which we can add structure to documents. The span element is inline with surrounding text, that is, it does not cause a line-break (similar to a element) Syntax: content The div element is a block-level element and will place its contents on a separate line from surrounding content. (similar to a element) Syntax: content

Span and Div The span and div elements contains no semantic meaning, and should not be overused in the place of other more meaningful elements. Like using: booyaah! Instead of: jolly good yes indeed! This is okay: … … … Div has an added attribute align: – align = { “left” | “right” | “center” | “justify” }

Spacing Elements (Basic) Margin: the space between the edge of the element and the nearest adjacent element – (top, right, bottom, left) – The largest margin of two adjacent elements will be the spacing value Padding: the space between the edge of the content and the edge of the element – (top, right, bottom, left)

Spacing Elements (Basic) Properties: margin: topValue rightValue bottomValue leftValue; – Each value is specified margin: topbottom leftright – Top is mirrored on bottom, right mirrored on left margin: all – All have the same value Explicitly: – margin-top : value – margin-bottom: value – margin-right: value – margin-left: value Example: Padding is the same way: – padding: top right bottom left – padding-left: value – etc…

Background Images Inserting a background image We use the style attribute to set the background image. For example, to set a background image for the whole website: …

Background Images For example, to set a background image for a paragraph: …

Background Image Options The following style: background-repeat :type – is used to control how the browsers tile an image across an element’s background.

Background Image Options type has these four possible values: no-repeat, repeat, repeat-x, repeat-y. no-repeat: the image is not repeated at all repeat: the image is tiled both horizontally and vertically repeat-x: the image is one tiled horizontally across the width of the element repeat-y: the image is one tiled vertically across the height of the element

Background Image Options To control the position of the background image, the following style is used: – background-position: horizontal vertical horizontal’s value can be one of these: a percentage, a length or a keyword (which is one of these three: left, right, center)

Background Image Options vertical’s value can be one of these: a percentage, a length or a keyword (which is one of these three: top, bottom, center) Percentage: – For example, with a value pair of '0% 0%', the upper left corner of the image is aligned with the upper left corner of the padding box. A value pair of '100% 100%' places the lower right corner of the image in the lower right corner of the padding box. With a value pair of '14% 84%', the point 14% across and 84% down the image is to be placed at the point 14% across and 84% down the padding box.

Background Image Options Length: A length L aligns the top left corner of the image a distance L to the right of (for horizontal) or below (for vertical) the top left corner of the element's padding box. For example, with a value pair of '2cm 1cm', the upper left corner of the image is placed 2cm to the right and 1cm below the upper left corner of the padding box.

Background Image Options top :Equivalent to '0%' for the vertical position. right: Equivalent to '100%' for the horizontal position. bottom: Equivalent to '100%' for the vertical position. left: Equivalent to '0%' for the horizontal position. center: Equivalent to '50%' for the horizontal position if it is not otherwise given, or '50%' for the vertical position if it is.

Assignment 2 Create a web page that uses the tags that we’ve learned: – Heading tags – Image tag: – Paragraph tag: – Link tag: – Span tag: – Div tag: Then use the style attribute to control the colors, fonts and font styles The assignment is due 11:59pm next Friday