CSS Handout. CS 4173 Summer about 70 more properties includes all of CSS1 includes properties for non-screen presentation

Similar documents
INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

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

Introduction to Web Design CSS Reference

Introduction to Web Design CSS Reference

Adding CSS to your HTML

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

Assignments (4) Assessment as per Schedule (2)

Web Design and Development Tutorial 03

Styles, Style Sheets, the Box Model and Liquid Layout

Chapter 3 Style Sheets: CSS

Fundamentals of Web Technologies. Agenda: CSS Layout (Box Model) CSS Layout: Box Model. All HTML elements can be considered as a box or a container

Cascading Style Sheets (CSS)

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

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

COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts

ICT IGCSE Practical Revision Presentation Web Authoring

Creating Layouts Using CSS. Lesson 9

Getting Started with CSS Sculptor 3

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

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

Client-Side Web Technologies. CSS Part II

ADDING CSS TO YOUR HTML DOCUMENT. A FEW CSS VALUES (colour, size and the box model)

Getting Started with Eric Meyer's CSS Sculptor 1.0

FLOATING AND POSITIONING

Cascading Style Sheets (Part 3): Images and Text. Mike Hamilton V.P. Product Evangelism MadCap Software

CSS: Lists, Tables and the Box Model

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

CSS: The Basics CISC 282 September 20, 2014

Deccansoft Software Services

HTML and CSS COURSE SYLLABUS

How to lay out a web page with CSS

CSS. Shan-Hung Wu CS, NTHU

Proper_Name Final Exam December 21, 2005 CS-081/Vickery Page 1 of 4

CSS.

Web Programming and Design. MPT Junior Cycle Tutor: Tamara Demonstrators: Aaron, Marion, Hugh

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

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

Web Programming and Design. MPT Senior Cycle Tutor: Tamara Week 2

CSS MOCK TEST CSS MOCK TEST III

Web Design and Implementation

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

APPLIED COMPUTING 1P01 Fluency with Technology

Reading 2.2 Cascading Style Sheets

Lab Introduction to Cascading Style Sheets

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

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

Introduction to WEB PROGRAMMING

Web Engineering CSS. By Assistant Prof Malik M Ali

Methods for configuring Cascading Style Sheets. Applying style to element name selectors. Style Rule Basics. CMPT 165: Cascading Style Sheets

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

COMS 359: Interactive Media

Final Exam Study Guide

What is the Box Model?

CSS Styles Quick Reference Guide

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

Block & Inline Elements

Cascading Style Sheets (CSS) Part 1 of 3: Introduction and overview

CSS: formatting webpages

Web Authoring and Design. Benjamin Kenwright

ICT IGCSE Practical Revision Presentation Web Authoring

Introduction to Computer Science Web Development

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

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

c122sep2214.notebook September 22, 2014

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

Ministry of Higher Education and Scientific Research

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

Adobe Dreamweaver CS6 Digital Classroom

Page Layout Using Tables

ITNP43: HTML Lecture 5

ADOBE 9A Adobe Dreamweaver CS4 ACE.

Creating and Building Websites

Positioning in CSS: There are 5 different ways we can set our position:

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

CSS Cascading Style Sheets

door to my garden Simple CSS resulting in impressive, sophisticated visual effects

COMP519 Web Programming Lecture 8: Cascading Style Sheets: Part 4 Handouts

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

Produced by. Web Development. Eamonn de Leastar Department of Computing, Maths & Physics Waterford Institute of Technology

C A S C A D I N G S T Y L E S H E E T S

KillTest *KIJGT 3WCNKV[ $GVVGT 5GTXKEG Q&A NZZV ]]] QORRZKYZ IUS =K ULLKX LXKK [VJGZK YKX\OIK LUX UTK _KGX

Certified CSS Designer VS-1028

Internet Programming 1 ITG 212 / A

CSS WHAT IS IT? HOW DOES IT WORK? (LOOK N GOOD)

First Name Last Name CS-081 March 23, 2010 Midterm Exam

CSC309 Winter Lecture 2. Larry Zhang

COMS 359: Interactive Media

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

Module 2 (VII): CSS [Part 4]

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

CSS: Cascading Style Sheets

Cascading Style Sheets - Designing for the Web

Parashar Technologies HTML Lecture Notes-4

CSS FOUNDATIONS IN-DEPTH. The nitty-gritty of css...

INFS 2150 Introduction to Web Development

INFS 2150 Introduction to Web Development

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

Transcription:

CSS Handout CS 4173 Summer 2003 1 History CSS1 Dec 1996 about 50 properties, mostly for screen use CSS2 May 1998 about 70 more properties includes all of CSS1 includes properties for non-screen presentation 2 Cascading vs. Inheritance In inheritance rules are applied and overwritten by parent elements. In cascading all rules that apply to an element are used but some can be overwritten. Here s the order for CSS: first rules from the browser software are applied, the the user s style sheet, the the author s rules. If there is a tie then the last rule applied wins. But rules can be labeled!important to make them more win a tie. The user s!important rules overrules all others. 1

3 Selectors and Rules Examples of Some Selectors By in CSS in XHTML ID alone #abc id="abc" element type table <table>...</table> class.note class="note" element type table.note <table class="note"> & class. </table> attribute [title] <dl title="some text"> table[border] <table border="1"> [align="left"] <div align="left"> [rel = "home"] <a rel="homepage"...</a> 4 Colours Three main ways to specify colours: by name (e.g. green) by rgb value (red-green-blue) 0%, 0%, 0% is black; 100%, 100%, 100% is white; x%, x%, x% is a shade of grey specified by percentage (e.g. 100%,35.5%,10%) specified by value 0 255 (e.g. 255,91,26) specified as hexadecimal triplet (e.g. #FF5B1A) by System Name (e.g. WindowText) Browser-Safe Colours[1] 216 non-dithering colours (look flat) not exactly the same on all monitors photos, etc. use more colours and are dithered can be used for some consistency amongst browsers Page 2

5 The Box Model A block of text -- such as a paragraph -- formas a box, as shown by the dashed line you see around it. ('%) +*,! "! " $# %& ('%)! " Figure adapted from Lie & Bos [2] (especially Figure 9.2 and text on p. 180) Every element is drawn in a bounding box with three parts: margin space between the enclosing box and the border border decoration around content (can set width & style for all four sides) padding space between border and element Collapsing Margins if two elements touch then their top and bottom margins overlap padding or borders can keep the margins from touching Page 3

6 Floating Elements There are many properties for floating elements. Here are the most important ones. float clear values: left or right or none example left: move the element as far to the left as possible until the margin, padding, or border of a block-level element is touched. values: none or left or right or both where floating elements are not allowed to be example /** Example of float and clear **/ /* Make all images float left: */ img { float: left } /* H2 headings must not be next to images: */ h2 { clear: both } position values: static or relative or absolute or fixed static: normal elements, placed relative to their parents relative: placed relative to enclosing block (usually the parent) fixed: for block elements only relative to viewport, e.g. browser window, or page of paper absolute: for block elements only like fixed but not tied to the viewport visibility values: visible or hidden x-index value: integer (smallest values at the back) From Lie and Bos [2], page 203. Page 4

7 Tables There are two models for table borders: collapsing and separate. Set like this: table { border-collapse: separate } Collapsing model only 1 border is shown between cells where there are two to choose from, the largest is used borders can be set on rows, columns, cells, tables, and groups Separate model borders can only be set on cells and tables 8 See Also Eric Meyer on browser rendering models and how they affect CSS (in the readings part of the resource section) CSS examples (in the materials section) CSS lecture notes References [1] Jim Krause. color index. HOW Design Books, 2002. [2] Håkon Wium Lie and Bert Bos. Cascading Style Sheets: Designing for the Web. Addison-Wesley an imprint of Pearson Education, second edition, 1999. Page 5