CSC309 Programming on the Web week 3: css, rwd

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

CSS.

CSS: The Basics CISC 282 September 20, 2014

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

Appendix D CSS Properties and Values

CSS Cascading Style Sheets

Zen Garden. CSS Zen Garden

Controlling Appearance the Old Way

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

BIM222 Internet Programming

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

CSS Styles Quick Reference Guide

CSS: Cascading Style Sheets

COSC 2206 Internet Tools. CSS Cascading Style Sheets

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

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

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

Cascading Style Sheets CSCI 311

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

the missing manual0 O'REILLY Third Edition David Sawyer McFarland Beijing Cambridge The book that should have been in the box Farnham

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

CSS. Shan-Hung Wu CS, NTHU

Web Engineering CSS. By Assistant Prof Malik M Ali

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

CSS: Layout Part 2. clear. CSS for layout and formatting: clear

CSS: Cascading Style Sheets

Parashar Technologies HTML Lecture Notes-4

Cascade Stylesheets (CSS)

Adding CSS to your HTML

COMS 359: Interactive Media

CSS Box Model. Cascading Style Sheets

Web Design and Development Tutorial 03

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

Building Page Layouts

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

CSS. Lecture 16 COMPSCI 111/111G SS 2018

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

today what is this course about? what is this course about? Welcome to CSC309! Programming on the Web APRIL 05

Cascading Style Sheet Quick Reference

Client-Side Web Technologies. CSS Part II

Chapter 3 Style Sheets: CSS

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

Unit 10 - Client Side Customisation of Web Pages. Week 5 Lesson 1 CSS - Selectors

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

CSS Lecture 16 COMPSCI 111/111G SS 2018

HTML/XML. HTML Continued Introduction to CSS

Cascading Style Sheets

Responsive web design (RWD) CSS3 Media queries. Mobile vs desktop web sites. Web Development 1 CS1115/CS5002

Class 9 / Instructor: Ira Epstein

CSS 1: Introduction. Chapter 3

Internet Programming 1 ITG 212 / A

Cascading Style Sheets (CSS)

Creating Layouts Using CSS. Lesson 9

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

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

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

Anatomy of a Style. Cascaded Style Sheets - CSS. CSS Presentation Description Language. Measurement Specification


Creating and Building Websites

Chapter 4 CSS basics

Unit 20 - Client Side Customisation of Web Pages. Week 2 Lesson 4 The Box Model

INTERNATIONAL UNIVERSITY OF JAPAN Public Management and Policy Analysis Program Graduate School of International Relations

Cascading Style Sheets Level 2

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

Reading 2.2 Cascading Style Sheets

Assignments (4) Assessment as per Schedule (2)

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

Networks and Web for Health Informatics (HINF 6220) Tutorial 8 : CSS. 8 Oct 2015

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

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

Media Types & Media Features

ID1354 Internet Applications

8a. Cascading Style Sheet

CSS. Selectors & Measurments. Copyright DevelopIntelligence LLC

CASCADING STYLESHEETS

Client-Side Web Technologies. CSS Part I

Module 2 (VII): CSS [Part 4]

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

Introduction to Computer Science Web Development

Web Design and Implementation

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

Deccansoft Software Services

YouTube Break.

Web Site Design and Development Lecture 6

CMPT 165: More CSS Basics

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

INTRODUCTION TO CSS. Topics MODULE 5

By Ryan Stevenson. Guidebook #3 CSS

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

HTML & CSS Cheat Sheet

Responsive Web Design (RWD)

Lab Introduction to Cascading Style Sheets

Introduction to WEB PROGRAMMING

COMS 359: Interactive Media

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

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

Transcription:

CSC309 Programming on the Web week 3: css, rwd Amir H. Chinaei, Spring 2017 Office Hours: M 3:45-5:45 BA4222 ahchinaei@cs.toronto.edu http://www.cs.toronto.edu/~ahchinaei/

survey 1 in survey 1, you provide us with: your UTorID, your GitHub username, and your familiarity with technologies related to this course before completing the survey make sure you have a GitHub username, if you don t, sign up here: https://github.com/join and, get a student developer pack here: https://education.github.com/pack if you have the GitHub username and UTorID complete the survey here: https://goo.gl/forms/1sovpcfa1dleo1k42 (deadline: Jan 09) css 3-2

review design tip separate semantics from appearance in developing html documents: focus on structural semantics not on appearance advantages faster development maintainability due to modularity use semantics elements in html5 Use html validator css 3-3

cascading style sheets general syntax: selector {properties; } example: h2, p { color: blue; } cascading term? h2 { font-size: 1.5em; background-color: yellow} css 3-4

css it s the w3c standard to describe the appearance of information in a document (web page) defined by html elements appearance? colors, backgrounds, fonts, layouts, borders, etc. history css (1996), css2.1 (2004), css3 (2012) responsive web design design features that keep appearance appealing on different devices css 3-5

units absolute length good for print not recommended for screen common examples: cm, mm, px, pt, in (=2.54cm =96px =72pt) relative length recommended for screen (rwd) common examples: em, rem, %, vw, vh, vmin, vmax css 3-6

designer styles external style embedded style inline style css 3-7

selectors wild card * single group class.main { font-style: italic; color: red;} id #123 { font-style: italic; color: red;} attribute a[target] {background-color: yellow;} css 3-8

selectors pseudo classes a:hover {color: pink;} pseudo elements p::first-letter { color: #ff0000; font-size: xx-large; } combinators descendant selector (space) child selector (>) adjacent sibling selector (+) general sibling selector (~) css 3-9

cascading principles 1. inheritance font, color, list, and text are inherited border, layout, margin, padding are not, unless specified 2. specificity external style embedded style element class id inline style css 3-10

the box model all html elements can be considered as boxes background css 3-11

box border border border-style solid, dotted, dashed, double, groove, ridge, inset, outset border-width border-color border-top-color: red border-right-color: blue border-radius border-image css 3-12

box background background background-attachment: scroll fixed background-color background-image background-position background-repeat: repeat repeat-x repeat-y no-repeat background-size: css 3-13

design tips for rwd: use relative length for width and height use max-width and min-width use border-box for box-sizing Use float css 3-14

design tips browser dev tools firefox: right-click inspect element css validator w3c jigsaw css validator https://jigsaw.w3.org/css-validator/ css 3-15

styling the text font styling font-style, font-weight, font-variant font-stretch, font-size paragraph styling font-family p {font-family: Calibri, Arial, Sans-Serif;} generic font families Serif, Sans-Serif, Monospace, Cursive, Fantasy @font-face @font-face { font-family: myfirstfont; src: url(sansation_light.woff);} css 3-16

layout normal block elements inline elements note: the display property can change this ul {display: inline;} css 3-17

layout position property absolute relative fixed static figure { ; position: relative; top:10px; left:20px;} figcaption { ; position: absolute; top:115px; left:25px;} float property left, right, both, none figure { ; width: 150px; float: right;} css 3-18

layout fixed layout absolute size/length (px) fluid layout relative size/length (%) hybrid some elements fixed, some fluid css 3-19

rwd responsive web design 1. setting viewport <meta name="viewport" content="width=device-width, initial-scale=1.0"> 2. sizes relative to viewport (fluid elements) img {max-width: 100%;} 3. grid design what print designers do 4. media queries @media css 3-20

@media define breakpoints phone (small devices) first tablet (medium devices) next desktop (large devices) last note: this is called progressive enhancement example: { } @media only screen and (min-width: 600px) { } @media only screen and (min-width: 768px) { } css 3-21

@media examples BP1: small devices: [class*="col-"] { width: 100%;} BP2: medium devices @media only screen and (min-width: 600px) { /* for tablets*/ col-m-1 {width: 8.33%;} col-m-2 {width: 16.66%;} col-m-3 {width: 25%;} col-m-12 {width: 100%;} } css 3-22

@media examples BP3: large devices @media only screen and (min-width: 768px) { /* for desktop*/ col-1 {width: 8.33%;} col-2 {width: 16.66%;} col-3 {width: 25%;} col-12 {width: 100%;} } css 3-23

more design tips use a CSS framework such as a grid frameworks (e.g. boostrap) then customize the styles for your needs use a CSS template such as art, food, fashion, etc. then customize the styles for your needs css 3-24