Floats, Grids, and Fonts

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

CSS: The Basics CISC 282 September 20, 2014

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

Controlling Appearance the Old Way

CSS.

Chapter 12: FORMATTING TEXT

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Web Site Design and Development Lecture 6

CSS Styles Quick Reference Guide

IDM 221. Web Design I. IDM 221: Web Authoring I 1

Appendix D CSS Properties and Values

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

Introduction to Web Design CSS Reference

limelightplatform.com

Introduction to Web Design CSS Reference

The Benefits of CSS. Less work: Change look of the whole site with one edit

Zen Garden. CSS Zen Garden

CSS Selectors. element selectors. .class selectors. #id selectors

ACSC 231 Internet Technologies

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

CSS Cascading Style Sheets

CSS. Text & Font Properties. Copyright DevelopIntelligence LLC

Cascading Style Sheets. Overview and Basic use of CSS

Introduction to Web Tech and Programming

CMPT 165: More CSS Basics

CSS: Cascading Style Sheets

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Tutorial 3: Working with Cascading Style Sheets

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

Web Design and Development Tutorial 03

By Ryan Stevenson. Guidebook #3 CSS

The building block of a CSS stylesheet. A rule consists of a selector and a declaration block (one or more declarations).

5. Text CHAPTER HIGHLIGHTS 10/12/2016 CHAPTER. Text tradition. Codes for computer text. t. Font technologies. Multimedia text.

Cascading Style Sheets (CSS)

CSC309 Programming on the Web week 3: css, rwd

Admin. Midterm 1 on. Oct. 13 th (2 weeks from today) Coursework:

Adding CSS to your HTML

User-Centered Website Development: A Human- Computer Interaction Approach

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

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

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

TYPE BASICS Cartographic Design & Principles Winter 2016

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

> > > > Cascading Style Sheets basics

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

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

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

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

Graphics. HCID 520 User Interface Software & Technology

Graphics. HCID 520 User Interface Software & Technology

CSS Lecture 16 COMPSCI 111/111G SS 2018

Introduction to CSS. Part 1: Simple Text Formatting. Source Files for this Exercise are available on the Course Website DW_CSS intro

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

HTML (Hyper Text Markup Language) CSS. (Cascading Style Sheets) HTML: problems with styles. HTML: styles. CSS: specifications.

CSS. (Cascading Style Sheets) HTML (Hyper Text Markup Language) HTML: styles. 07/07/2011(mar'09) A.Lioy - Politecnico di Torino ( ) F.

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

Html basics Course Outline

CASCADING STYLESHEETS

CSS. (Cascading Style Sheets)

WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5

Lab Introduction to Cascading Style Sheets

Cascade Stylesheets (CSS)

How to use character and paragraph styles

Back in the good old days type was set by hand using printing presses.

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

CSc 337 LECTURE 3: CSS

8a. Cascading Style Sheet

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

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

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

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

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

Lab 2: Movie Review. overview.png background.png rottenbig.png rbg.png fresh.gif rotten.gif critic.gif

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

COMSC-031 Web We S ite Site Development Development- Part 2 Part-Time Instructor: Joenil Mistal November 7, 2013

EECS1012. Net-centric Introduction to Computing. Lecture 3: CSS for Styling

.hedgehog { background-image: url(backyard.jpg); color: #ffff99; height: 6in; width: 12in; } .tube {

Web Development & Design Foundations with HTML5

escuela técnica superior de ingeniería informática

Web Development & Design Foundations with HTML5

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

CSS for Styling CS380

CSS Cascading Style Sheets

ASMP Website Design Specifications

CSS3 Basics. From & CSS Visual Dictionary Learning Curve Books, LLC

Multimedia for the Web: Creating Digital Excitement. Multimedia Element Text

HTML TUTORIAL ONE. Understanding What XHTML is Not

Note: The screenshots in this document were taken on Windows in Firefox, which may differ from your system.

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

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

2. Write style rules for how you d like certain elements to look.

Tutorial 02: Getting Started with CSS

HTML/XML. HTML Continued Introduction to CSS

Font, Typeface, Typeface Family. Selected Typographical Variables

ITNP43: HTML Lecture 4

ID1354 Internet Applications

CSC 443: Web Programming

Transcription:

Floats, Grids, and Fonts Computer Science and Engineering College of Engineering The Ohio State University Lecture 17

Recall: Blocks, Inline, and Flow flow body inline paragraph heading horz rule blocks

Floating: Remove From Flow width

Floating: Overlays Block.fancy { float: left } codepen.io/cse3901/pen/blydlz

Problem: Blocks Below Floating element may be taller than containing element May be undesirable, eg for footer that should be below everything including floats problem

Solution: clear Styling for block element after float #footer { clear: left; } Requires that side to be clear of floats id="footer"

CSS: Grid Layout Display property for arranging elements in a 2D grid Parent element is the grid container Style with CSS property (display: grid) Set number/size of rows/columns Set gap between rows/columns Direct children are the grid items Set alignment, justification, placement One item can be sized/placed to a grid area (ie a rectangular subgrid)

Grid Layout: Example.wrapper { display: grid; grid-template-columns: 1fr 2fr 2fr; grid-template-rows: repeat(4,20px); grid-gap: 20px; } <div class="wrapper"> <div>1</div> <div>2</div> </div> codepen.io/cse3901/pen/aqvnjn

Grid Areas.top { grid-area: tp; }.sidebar { grid-area: sd; } #footer { grid-area: ft; }.wrapper { display: grid; grid-template-columns: 1fr 2fr 2fr; grid-template-areas: "tp tp tp" "sd.." "sd.." "sd ft ft"; } codepen.io/cse3901/pen/oeokxv

CSS Units for Size Absolute units (but browsers cheat) in, cm, mm pt (point) = 1/72 inch, pc (pica) = 12 pts Absolute (for a given resolution) px (pixels) Relative to current element s font em = width of 'm' in element s font ex = height of 'x' in element s font Relative to parent (or ancestor) size %, rem (like em, but with root s font) Standard advice for fonts: Prefer relative units

Aside: The Problem with Pixels Historically, pixel size determined by hardware (ie screen resolution) ppi: "pixels per inch" Problems using px unit: Different resolutions = different size of px Different devices = different view distances Solution: W3C's "reference pixel" (optics) 0.0213 degrees

Fonts: Concepts Fonts are a key part of visual design Serious, technical, whimsical, friendly Font family (should be typeface ) Arial, Helvetica, Times, Courier, Palatino, Garamond, Verdana, Tahoma, Lucida, Font = typeface + weight, slant, etc Normal, bold, light (CSS: font-style) Normal, oblique, italic (CSS: font-weight)

Properties and Metrics Serif vs sans-serif Kerning: proportional vs monospace Size = ascent + descent (usually) m-width, x-height

Whitespace Critical for aesthetics, readability Margins around body text, headings Leading Space from baseline to baseline CSS: line-height Larger x-height = easier to read But larger x-height also requires more line spacing Music is the silence between the notes

Font Families De gustibus non est disputandum Nevertheless, some common opinions Less is more: Use fewer fonts/sizes Cohesive appearance Helvetica/Arial: clean but ubiquitous They are identical / completely different Times is hard to read (on a monitor) Better for print Comic Sans is for 12-year-olds and owners of NBA basketball teams

Identical & Completely Different

Fallback Fonts Not sure what fonts host OS will have CSS font-family: List alternatives in decreasing order of preference font-family: Helvetica, Arial, "Liberation Sans", sans-serif; Always end with one of 5 generic fonts: sans-serif (Arial?) serif (Times New Roman?) monospace (Courier New?) cursive (Comic Sans?) fantasy (Impact?) example example example example example OS (and browser) determine which font family each generic actually maps to

CSS3: Web Fonts @font-face Looks like a selector, but is a directive @font-face { font-family: HandWriting; src: url('pagscapture.ttf'); } Font family then available in rest of CSS p { font-family: HandWriting; } User agent dynamically downloads font Different syntaxes for font files.ttf,.otf,.eot,.woff,.svg, Beware: copyright issues! See fonts.google.com

Summary Colors: RGB vs HSL Images Formats jpeg, png, gif, svg Tradeoffs of size, quality, features Floating elements Removed from flow, layered on top Fonts Fallback fonts to account for uncertainty Web fonts for dynamic loading