Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

Similar documents
HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

COSC 2206 Internet Tools. CSS Cascading Style Sheets

CSS: The Basics CISC 282 September 20, 2014

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

HTML TUTORIAL ONE. Understanding What XHTML is Not

8a. Cascading Style Sheet

CSS. Lecture 16 COMPSCI 111/111G SS 2018

3.1 Introduction. 3.2 Levels of Style Sheets. - The CSS1 specification was developed in There are three levels of style sheets

- The CSS1 specification was developed in CSS2 was released in CSS2.1 reflects browser implementations

Study Guide 2 - HTML and CSS - Chap. 6,8,10,11,12 Name - Alexia Bernardo

Chapter 3 Style Sheets: CSS

CSS Lecture 16 COMPSCI 111/111G SS 2018

HTML and CSS COURSE SYLLABUS

Introduction to CSS. Fijihosting.com Introduction to CSS page 1. What are style sheets? Lovely! How do I use them?

Html basics Course Outline

Introduction to Web Tech and Programming

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

CSS.

- The CSS1 specification was developed in CSSs provide the means to control and change presentation of HTML documents

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Basics of Web Design, 3 rd Edition Instructor Materials Chapter 2 Test Bank

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2)

ACSC 231 Internet Technologies

Page Layout Using Tables

CMPT 165: More CSS Basics

Appendix D CSS Properties and Values

CSC 121 Computers and Scientific Thinking

To link to an external stylesheet, the link element is placed within the head of the html page:

Introduction to WEB PROGRAMMING

Session 3.1 Objectives Review the history and concepts of CSS Explore inline styles, embedded styles, and external style sheets Understand style

Learning Objectives. Review html Learn to write a basic webpage in html Understand what the basic building blocks of html are

CSC Web Programming. Introduction to HTML

HTML/XML. HTML Continued Introduction to CSS

Reading 2.2 Cascading Style Sheets

Tutorial 3: Working with Cascading Style Sheets

A Brief Introduction to HTML

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

Creating and Building Websites

HTML & CSS. SWE 432, Fall 2017 Design and Implementation of Software for the Web

ITNP43: HTML Lecture 4

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

Adding CSS to your HTML

CSS مفاهیم ساختار و اصول استفاده و به کارگیری

Chapter 1 Self Test. LATIHAN BAB 1. tjetjeprb{at}gmail{dot}com. webdesign/favorites.html :// / / / that houses that information. structure?

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

- HTML is primarily concerned with content, rather than style. - However, tags have presentation properties, for which browsers have default values

ID1354 Internet Applications

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Index. CSS directive, # (octothorpe), intrapage links, 26

CS105 Course Reader Appendix A: HTML Reference

Introduction to using HTML to design webpages

Module 2 (VII): CSS [Part 4]

Web Site Design and Development Lecture 6

Fundamentals of Web Programming a

Review Question 1. Which tag is used to create a link to another page? 1. <p> 2. <li> 3. <a> 4. <em>

Announcements. Paper due this Wednesday

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

ICT IGCSE Practical Revision Presentation Web Authoring

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

Assignments (4) Assessment as per Schedule (2)

Creating A Website - Part 1: Web Design principles, HTML & CSS. CSS Color Values. Hexadecimal Colors. RGB Color

Chapter 7 Typography, Style Sheets, and Color. Mrs. Johnson

Cascade Stylesheets (CSS)

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Block & Inline Elements

Cascading Style Sheets. Overview and Basic use of CSS

Deccansoft Software Services

Indian Institute of Technology Kharagpur. HTML Part III. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

CSS: Cascading Style Sheets

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

<style type="text/css"> <!-- body {font-family: Verdana, Arial, sans-serif} ***set font family for entire Web page***

Web Design and Development Tutorial 03

CSS. Text & Font Properties. Copyright DevelopIntelligence LLC

HTML + CSS. ScottyLabs WDW. Overview HTML Tags CSS Properties Resources

CSS: Cascading Style Sheets

Chapter 12: FORMATTING TEXT

INTRODUCTION TO HTML5! HTML5 Page Structure!

A Balanced Introduction to Computer Science, 3/E

INTRODUCTION TO CSS. Mohammad Jawad Kadhim

CSS THE M\SS1NG MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLr Beijing Cambridge Farnham Köln Paris Sebastopol Taipei Tokyo

introduction to XHTML

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

CSS: formatting webpages

CASCADING STYLESHEETS

Intro to html. --- define every element, attribute, and entity along with the rules for their use

Chapter 4. Introduction to XHTML: Part 1

Programmazione Web a.a. 2017/2018 HTML5

Markup Language SGML: Standard Generalized Markup Language. HyperText Markup Language (HTML) extensible Markup Language (XML) TeX LaTeX

CSCB20 Week 7. Introduction to Database and Web Application Programming. Anna Bretscher Winter 2017

CITS3403 Agile Web Development 2019 Semester 1

CSS for Styling CS380

XHTML & CSS CASCADING STYLE SHEETS

Lab Introduction to Cascading Style Sheets

Web Development & Design Foundations with XHTML. Chapter 2 Key Concepts

Table of Contents. MySource Matrix Content Types Manual

CSS: Formatting Text. CSS for text processing: font-family. Robert A. Fulkerson

Transcription:

Text and Layout Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11 This presentation

344 345 Text in Graphics Maximum flexibility obtained by treating text as graphics and manipulating it in graphics program Ideally suited to graphic design incorporating text Posters, packaging, letterheads, book jackets, CD and DVD covers, Vector graphics with outline fonts or bitmapped images with bitmapped fonts Increasingly, combine the two approaches

345 Vector Text Text set in outline fonts can be treated as object in a vector graphics program Transform; apply colour, gradient and patterns Fill shapes with text, set text along a path Text remains editable Text in shape/along a path will accommodate transformations of the shape/path

345 346 Bitmapped Text Convert text to pixels Can apply usual effects and filters Usually keep text on separate layer, so effects can be applied to it independently Text can no longer be edited as text Can't change font, spell check, change wording, etc Must be retouched like any other image

347 Layout Most text is laid out according to conventions Words are arranged into lines, combined into paragraphs placed on the page Special formatting (e.g. italicization) may be applied to words within a paragraph inline/ character formatting Paragraphs may be set in special ways (e.g. indentation) block-level/paragraph formatting

348 Inline Formatting Apply formatting to spans of characters within a block Font characteristics and size Colour Baseline offset for superscripts and subscripts Character styles collect together a set of properties used for some purpose (e.g. emphasis) to be applied by name Ensures consistency, eases modification

348 351 Block-level Formatting Each block will have default settings for the formatting of characters (font, size, etc) Over-ridden by inline formatting Blocks may be left-aligned, centred, right-aligned or justified May hyphenate Set spacing on all four sides of block (indent etc) Use paragraph styles for consistency

351 352 Markup Instructions embedded in a document to control its formatting WYSIWYG markup consists of invisible control codes, formatting is displayed as you type Tag-based text of document is interspersed with special commands known as tags; separate rendering phase is needed to display the formatted document Tags are lexically distinguished from text

353 355 Structural Markup Tags identify logical elements of a document (headings, lists, tables, ) Contrast visual markup tags control aspects of appearance (fonts, indents, ) Formatting may be defined for each type of element (cf. paragraph and character styles) Permits separation of concerns between structure and appearance Makes it easier for programs to analyse structure of documents

355 356 Stylesheets Logical conclusion of structural markup: Complete separation of content and structure from appearance Markup tags only indicate structure Specification of the appearance is left to a separate mechanism Stylesheet provides rules describing how each type of element should be displayed

356 357 HTML Hypertext Markup Language Evolved from original version with tags suitable for marking up scientific papers; now supports variety of embedded multimedia as well as richer variety of layout features Recent versions emphasize structural markup, but there are visual markup features left over from earlier versions

357 XHTML HTML redefined using an XML DTD XHTML 1.0 adopted as W3C Recommendation Jan 2000 Almost compatible with HTML 4.0 Legal XHTML is legal HTML 4, but not vice versa XHTML is more strict than HTML 4 Can usually use HTML to mean XHTML or HTML 4

357 358 HTML Markup HTML markup divides document into elements Each type of element has a name Elements may be nested (subject to restrictions) Must be properly nested if an element starts inside another, it must end inside it too Each element is introduced by a start tag and terminated by an end tag Text in-between is the element's content

358 359 Tags Element's start tag is its name enclosed in angle brackets: <p>, <h1>, <div>, XHTML names consist of lower-case letters and numbers Element's end tag is its name preceded by a slash, enclosed in angle brackets: </p>, </h1>, </div>, Empty elements (with no content) have start and end tags run together: <img />, <hr />,

358 359 Character Entity References Need a mechanism for inserting <, > and other special characters into a document without having them interpreted as start of a tag &c Use character entity references < > for < > N.B. final ; is part of the reference Now need a way of inserting &: use & General mechanism for hard-to-type characters Also numeric character references, e.g. < Number after # is ISO10646 character value

360 Attributes Named properties of an element Values are assigned within start tag <hr size="12" width="50%" /> Values must be enclosed in "s Attribute names are all lower-case Flags are turned on by assigning their own name <hr noshade="noshade" /> Just omit flag attribute to turn it off

362 363 Document Structure <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/tr/2000/rec-xhtml1 20000126/ DTD/xhtml1-strict.dtd"> <html> <head> </head> <body> </body> </html>

360 361 CSS Cascading Style Sheets Simple stylesheet language that works well with HTML and is supported by most Web browsers Used to specify visual properties of each element CSS rules have the form selector { declarations } Can embed rules in a style element within the head of an HTML document

361, 368 Selectors Name declaration applies to all elements of the named type Name.class declaration applies to all elements of the named type whose class attribute has value class Name#id declaration applies to the unique elements of the named type whose id attribute has value id

361 Declarations property: value; Set of properties is defined in the CSS standard Inline and block-level formatting Absolute and relative positioning of elements

361 362 Simple Examples Indent first line of each paragraph 4pc p { text-indent: 4pc; } Except paragraphs of class noindent p.noindent { text-indent: 0pc; } Use a hanging indent on paragraphs of class hang p.hang { text-indent: -4pc; margin-left: 4pc; }

365 366 HTML Block-Level Elements p paragraphs h1, h2,,h6 level 1, 2,,6(!) headers blockquote long quotations (not indented paragraphs) pre pre-formatted text div arbitrary division use class or id attributes in conjunction with stylesheet rules

365 HTML Lists ul unordered list ol ordered list li list element Use li elements within ul and ol elements Within ol, li elements are automatically numbered; ul, bulleted by default dl definition list Use pairs of dt (term) and dd (definition) elements within dl

365 HTML Tables Relatively complex constructions providing for wide variety of tabular layout table elements contain tr (row) elements containing td (data, i.e. cell) elements Further facilities for spanning columns and rows, adding captions and headers, etc Tables are very commonly used to lay out pages Effective and reliable, but CSS positioning is officially endorsed way of doing this

367 HTML Inline Elements Elements indicating explicit inline formatting (e.g. font) deprecated conflict with structural markup More abstract inline elements OK em (emphasis), strong, etc span element identifies arbitrary spans of text Use class and id attributes in conjunction with stylesheet rules to apply inline formatting

368 369 CSS Typography Five properties control font characteristics font-family font-style font-variant font-weight font-size Used in conjunction with line-height

369 font-family Value is a list of font names in decreasing order of preference No guarantee that any specific font will actually be used (may not be available to browser) Can use generic font families browser will substitute an appropriate available font serif, sans-serif, monospace, cursive, fantasy p.elegant { font-family: "The Sans", Verdana, Helvetica, sans-serif }

370 font-style & font-variant font-style may be normal, italic or oblique (i.e. slanted) font-variant may be normal or small-caps Effect is to choose an appropriate member of the font family selected by the font-family property Slanted font may be used for italic if no real italic font is available

370 font-weight Terms used for font weight are relative Values normal and bold have expected effect Many font families have more than two weights, with no standard names font-weight may be 100, 200,, 900 As value increases, weight will not decrease may increase Values bolder and lighter increase/decrease weight relative to inherited value

371 font-size Absolute sizes may be specified in any unit Sizes relative to browser default may be chosen from xx-small, x-small, small, medium, large, x-large, xx-large Sizes may be a percentage of inherited value, or specified in em or ex units of inherited font Relative size changes specified with smaller or larger

371 Leading line-height property specifies leading normal chosen by browser, usually 1 to 1.2 times font size (i.e. too small) Use percentage (150%), ratio (1.5) or ems (1.5em) to specify leading relative to font size line-height and leading can be combined within a font declaration: 14pt/21pt

371 372 font property Combine all five font properties into a single declaration for font Can include composite size/leading Any omitted properties take on default values Order is unspecified, but browsers seem to prefer style, variant, weight, size, family p { font: italic bold 14pt/21pt "The Sans", Verdana, Helvetica, sans-serif }

372 373 Colour background-color and color properties control the colour of background and text Values specify colours in srgb colour space rgb(r%, g%, b%) rgb(r, g, b) where r, g, b are in range 0 255 #rrggbb where rr, gg, bb are hex values rgb(80%,40%,80%) rgb(204,102,204) #CC66CC

373 Alignment text-align property can take values left, right, center or justify Can only be sensibly applied to block-level elements body { text-align: left } p.display { text-align: center }

374 Layout Layout algorithm: Each element is notionally placed in a box Inline elements and text placed next to each other horizontally, then fitted into available width to form blocks Blocks are placed vertically on top of each other Stylesheet may be used to modify placement of elements

374 375 Boxes Each box may be surrounded by a border Border is separated from contents by padding Beyond border, margins separate box from its neighbours on all sides Plethora of CSS properties can be used to set border width, style and colour, padding and margins, box's height and width Text colour and background colour can be set separately for each box

375 Floating Boxes Boxes may be 'floated' to left or right margin, while text flows round them float property can take value left or right clear property can take values left, right, both or none, specifying which sides may be adjacent to a floating box If clear = left, box is forced to go below the bottom of any left-floated element, and so on

375 377 Absolute Positioning Set position to absolute, then specify values for top and left properties, setting the position of the top left corner of the box Tedious calculations, usually done by interactive manipulation in Web authoring program Can use relative units Boxes may end up on top of each other, z-order property specifies stacking order Preferred alternative to use of tables for layout

377 External Stylesheets Can put a collection of rules in a file and refer to it from within an HTML document link element with href attribute pointing to stylesheet, rel="stylesheet", type="text/css" <link href="styles.css" rel="stylesheet" type="text/css" /> Allows same set of styles to be used in all pages of a Web site, global changes made easily