1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)

Slides:



Advertisements
Similar presentations
Session Objectives Setting the font family Setting the font size Working with Web fonts Setting font faces and sizes Setting font and text appearances.
Advertisements

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.
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)
CS134 Web Design & Development Cascading Style Sheets (CSS) Mehmud Abliz.
TUTORIAL 4: CREATING PAGE LAYOUT WITH CSS Session 4.3.
Web-based Application Development Lecture 5 January 24, 2006 Anita Raja.
Using Cascading Style Sheets CSS Structure. Goals Understand how contextual, class and ID selectors work Understand how contextual, class and ID selectors.
Lecture CSS: Cascading Style Sheets. What are Styles? Cascading Style Sheets (CSS) is a style sheet language used to describe the presentation semantics.
3.1 Cascading Style Sheets. Motto Fashions fade, style is eternal. —Yves Saint Laurent.
W EB S ITE L ECTURE C ASCADING S TYLE S HEETS. Cascading Style Sheets (CSS) Introduction CSS Objectives – Provide more control over web site content presentation.
+ 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
Using Cascading Style Sheets. Introduction to Styles and Properties  Cascading Style Sheets (CSS) are a standard set by the World Wide Web Consortium.
CSS Dvijesh Bhatt.
CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity
Chapter 7 Web Typography Principles of Web Design, 4 th Edition.
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.
1 To Create an Internal Style Sheet 1. At the top of your HTML document, between the and tags type. 2. Type the name of the tag whose properties you wish.
XP New Perspectives on XML Tutorial 5 1 TUTORIAL 5 CSS Tutorial – Carey ISBN
Doman’s Sections Information in this presentation includes text and images from
(CSS) More Details Instructor: Mr. Ahmed Al Astal ITGD4104 Department Requirement for senior student University of Palestine Faculty of IT.
CASCADING STYLE SHEETS. Chapter 3 Objectives Customize HTML elements Specify Font characteristics Classes Tag style Inline and block-level elements External.
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 #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.
MySQL and PHP Review CSS. Cascading Style Sheet (CSS) Style sheets are files or forms that describe the layout and appearance of a document. Cascading.
Basics of Web Design Chapter 6 More CSS Basics Key Concepts.
 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 Robin Burke ECT 270. Outline Midterm The Layout Debate CSS properties Fonts Alignment Color CSS selection selectors pseudo-classes.
 Cascading Style Sheets (CSS) ◦ Used to specify the presentation of elements separately from the structure of the document.  Inline style ◦ declare.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
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.
CSS Presentation CSS Typography, Fonts, Spacing, Borders, Backgrounds, Opacity Svetlin Nakov Technical Trainer Software University
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:
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.
Cascading Style Sheets Web Design Fairport High School.
CSS properties Basharat Mahmood, Department of Computer Science, CIIT, Islamabad, Pakistan 1.
Web Technologies Beginning Cascading Style Sheets (CSS) 1Copyright © Texas Education Agency, All rights reserved.
Developing Web Applications with HTML and CSS “Selectors and Properties”
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
Web Design (14) CSS Formatting Text. Formatting Text In Brackets, go to your ‘externalcss’ website and find the ‘formattingtext’ page. Use the ‘main’
Web Technology (NCS-504) Prepared By Mr. Abhishek Kesharwani Assistant Professor,UCER Naini,Allahabad.
Creating Layouts with CSS. Span tag Here is some underlined text. Here is some blinking text. Here's some bold text.
ECA 228 Internet/Intranet Design I Cascading Style Sheets.
PERSPECTIVES: TUTORIAL 4 CREATING PAGE LAYOUTS WITH CSS.
03 CSS (Cascading StyleSheet) Р.Жавхлан МОНГОЛ УЛСЫН ИХ СУРГУУЛЬ Мэдээллийн технологийн сургууль Интернэт технологийн үндэс 2015 Намар.
CSCE Chapter 3 (Cascading Style Sheets) CSCE General Applications Programming Benito Mendoza 1 By Benito Mendoza Department of Computer.
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.
Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
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,
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,
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 10: Formatting Text with Styles.
Cascading Style Sheets (Formatting)
Presentation transcript:

1 CS428 Web Engineering Lecture 07 Font, Text & Background (CSS - II)

Block-Level Elements A block level element in HTML create a “block” or “box”. Browsers typically display the block-level element with a new line. Block level elements may contain inline elements and other block-level elements. The block level elements create “larger” structure than inline elements.

List of Block-Level Elements Contact information (HTML5) Figure caption Ordered list (HTML5) Article content (HTML5) Groups media content with a caption (HTML5) Form output (HTML5) Aside content (HTML5) Section or page footer Paragraph (HTML5) Audio player Input form Preformatted text Long (“block”) quotation Heading levels (HTML5) Section of the page (HTML5) Drawing canvas (HTML5) Section or page header. Table. Definition description (HTML5) Groups header information Table footer Document division Horizontal rule (dividing line) Unordered list Definition list Field set label (HTML5) Video player

Inline Elements An Inline element in HTML occupies only the space bounded by the tags that define the inline element. Generally, inline elements may contain only data and other inline elements. By default, inline elements do not begin with new line.

List of Inline Elements

The & Tags A... element defines an “inline” structure, i.e. it simply defines a stretch of text. Thus it can be used within a paragraph or table element without affecting the flow of the text. A... element defines a “block” structure. Usually the browser will place line breaks before and after this element, but otherwise it has no effect itself.

The Box Model CSS operates on something known as the box model. When displaying documents, CSS treats each element in the document as a rectangular box. –Components of a box Content Padding Border Margins

The Box Element Content Margin Padding Border Default value for margins, borders, and padding is zero. However, width can be specified using CSS. Different widths can be given for each side of the box.

Paragraph Example: Make all paragraphs have 10 spaces indentation (hint: 6em) and make a text red. p { text-indent: 6em; color: red; } This is the first paragraph with the red text and large indent. This is the second paragraph with the red text and large indent.

CSS Font Properties You can set following font properties of an element:  The font-family property is used to change the face of a font.  The font-style property is used to make a font italic or oblique.  The font-variant property is used to create a small-caps effect.  The font-weight property is used to increase or decrease how bold or light a font appears.  The font-size property is used to increase or decrease the size of a font.

font-family This text is rendered in either georgia, garamond, or the default serif font depending on which font you have at your system. Output: This text is rendered in either georgia, garamond, or the default serif font depending on which font you have at your system.

Generic Font Family These are the generic name values for the font-family property, followed by an example of each that the browser might select from the user’s system fonts: 12 Generic font-family NamesExample serifTimes New Roman sans-serifArial cursiveZapf-Chancery fantasyWestern monospaceCourier

13 font-style This text will be rendered in italic style. Output: This text will be rendered in italic style. Possible Values: normal, italic, oblique(more slanted than normal)

14 font-size This font size is 20 pixels. Output: This font size is 20 points. Possible values: px, small, xx-small, x-small, medium, large, x- large, xx-large or in %

15 font-weight This font is bold. Output: This font is bold. Possible values: normal, bold, bolder, lighter, 100, 200, 300, 400, 500, 600, 700, 800, 900

16 font-variant This text will be rendered in small caps. Output: T HIS TEXT WILL BE RENEDERED AS SMALL CAPS. Possible values: normal, small-caps

17 line-height The line-height property is used to set the vertical distance between the baselines of adjacent lines of text. You can use only this property with block- level elements.

18 line-height The line-height property is just spaces the lines. and this is the second line. Output: The line-height property is just spaces the lines. and this is the second line. Possible Values: normal or any number with %, px or em unit

CSS Text Formatting You can set following text properties of an element:  The color property is used to set the color of a text.  The letter-spacing property is used to add or subtract space between the letters.  The word-spacing property is used to add or subtract space between the words.  The text-indent property is used to indent the text of a paragraph.  The text-align property is used to align the text of a document.

 The text-decoration property is used to underline, overline and strikethrough text.  The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters.  The text-shadow property is used to set the text shadow around a text.  The white-space property is used to control the flow and formatting of text. 20

21 color This text will be written in red. Output: This text will be written in red. Possible values: any color name in any valid format.

22 letter-spacing This text is having space between letters. Output: T h i s t e x t i s h a v i n g s p a c e b e t w e e n l e t t e r s. Possible values: normal or a number.

23 word-spacing This text is having space between words. Output: This text is having space between words. Possible values: normal or a number.

24 text-indent The text-indent property is used to indent only the first line of text within an element. The default value for this property is 0. It only applies to block-level elements.

25 text-indent This text will have first line indent by 1cm. and this line will remain at its actual position. Output: This text will have first line indent by 1cm. and this line will remain at its actual position. Possible values: % or a number.

26 text-align This will be right aligned. Output: This will be right aligned. Possible values: left, right, center, justify

27 text-decoration This will be underline. Output: This will be underline. Possible values: none, underline, overline, line-through, blink

28 text-transform This will be in uppercase. Output: THIS WILL BE IN UPPERCASE. Possible values: none, capitalize, uppercase, lowercase

29 white-space The white-space property is used to specify whether the blank space between words both horizontally and vertically is collapsed to a single character space or is retained and preserved as is. The white space property is used with block-level elements.

30 white-space This text has a line break and the white-space pre setting tells the browser. Output: This text has a line break and the white-space pre setting tells the browser. Possible values: normal, pre,

31 text-shadow If your browser supports the css text-shadow property, this text will have a blue shadow. Output: Possible values: numbers

CSS background Properties You can set background of various HTML elements:  The background-color property is used to set the background color of an element.  The background-image property is used to set the background image of an element.  The background-repeat property is used to control the repetition of an image in the background.  The background-position property is used to control the position of an image in the background.  The background-attachment property is used to control the scrolling of an image in the background.

33 background-color This text has a yellow background. Output: Possible values: any color in a valid format.

34 background-image this table has background image which repeats multiple times. Output: Possible values: any image with valid format

35 background-repeat <table style=“background-image: url(images/cat.gif); background-repeat: no-repeat; ” > by default background-repeat property have repeat value. Output: Possible values: repeat, repeat-y, repeat-x, no-repeat

36 background-size <table style=“background-image: url(images/cat.gif); background-repeat: no-repeat; background-size: 200px 200px; ” > background-size property is used to expand the background image. Output: Possible values: repeat, repeat-y, repeat-x, no-repeat

37 background-position <table style=“background-image: url(images/css.gif); background-position: 100px 200px; ” > this table has background image positioned 100 pixels away from the left and 200 pixels from the top. Output: Possible values: X% Y%, top left, Xpx Ypx left top center top left bottom center bottom right bottom

38 background-attachment <p style=“background-image:url(images/css.gif); background-attachment: fixed; ” > This paragraph has fixed background image. Output: Possible values: fixed, scroll