design, formatting, css, & colors

29
Design, Formatting, CSS, & Colors September 9, 2010

Upload: gibson

Post on 22-Feb-2016

28 views

Category:

Documents


0 download

DESCRIPTION

Design, Formatting, CSS, & Colors . September 9, 2010. Design. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Design, Formatting, CSS, & Colors

Design, Formatting, CSS, & Colors

September 9, 2010

Page 2: Design, Formatting, CSS, & Colors

Design

“Design is the method of putting form and content together. Design, just as art, has multiple definitions; there is no single definition. Design can be art. Design can be aesthetics. Design is so simple. That’s why it’s so complicated” --Paul Rand

Page 3: Design, Formatting, CSS, & Colors

Bad Design...

Bad Design

blinking

moving

ugly colors

pages too big for a normal screen

What’s a normal screen?

browser shots

Page 4: Design, Formatting, CSS, & Colors

Examples

A few examples, for fun:

not sure what sort of business this is...

news site

Mr. Bottles...

Page 5: Design, Formatting, CSS, & Colors

Good Design...

Mr. Jobs

Mozilla

Charity:Water

Page 6: Design, Formatting, CSS, & Colors

Colors -- Paint(Subtractive Color Model)

Primaries: magenta, yellow, and cyan

This color system is called subtractive because:

each primary color absorbs (subtracts) a certain part of the color spectrum.

every time a color is added, less light is reflected.

When you mix all three primaries together, the entire spectrum of color is absorbed, and we’re left with black.

Page 7: Design, Formatting, CSS, & Colors

Colors -- Computer ScreenAdditive Color System

Primaries: Red, Blue, Green

Additive color systems start without light (black).

Light sources combine to make a color.

As colors are added, the resulting color is brighter.

Page 8: Design, Formatting, CSS, & Colors

Colors

We’ll be working with the additive color system

Mix various amounts of red, green, and blue to create a color.

Colors can be represented by

name

an rgb (dec, dec, dec) value

hexadecimal (# hx hx hx) value.

Page 9: Design, Formatting, CSS, & Colors

Colors (ctd)

For RGB, each color is indicated by a number from 0-255

(0,0,0) = black

#000000 = black

(255,255,255) = white

#FFFFFF = white

These RGB values can be translated into hexadecimal.

Page 10: Design, Formatting, CSS, & Colors

What is Hex Anyway?

(15, 100, 128)

RGB to Hex Example...

Page 11: Design, Formatting, CSS, & Colors

Hex...

Some tips:

each hex letter/number represents 4 digits in binary

these 4 digits in binary represent some number in decimal

Each two letters/numbers represent red, green, or blue in that order.

Remember your color number!

#0F6480

Page 12: Design, Formatting, CSS, & Colors

Helpful Color Links & Advice

Remember your color number!

A list of color names

colorpicker.com

Page 13: Design, Formatting, CSS, & Colors

CSS...

CSS is for giving style to your content

HTML: content

CSS: style

CSS Zen Garden

Page 14: Design, Formatting, CSS, & Colors

Adding CSS to your HTML

The best (only way for this class!) way to insert CSS to your HTML is by using an External Style Sheet

Define all your styles in one place

Easily change the look of your site

Use the following <link> tag within the <head> tag

Save your external style sheet as a .css file.

Page 15: Design, Formatting, CSS, & Colors

What can CSS do?

Style for individual elementsI want tableA to look like this...I want table B to look like that....

Style for every element of a certain typeI want all tables to look like this...I want all menus to look like that...

Style for subclasses of an elementI want theseTables to look like this...I want thoseTables to look like that...I want theseMenus to look like this...I want thoseMenus to look like that...

Page 16: Design, Formatting, CSS, & Colors

Syntax

Selector specifies the HTML element to style

Declaration:

always contains a property & value

ends with a semicolon

Property is the style element you want to change, Value is what you are changing the property to.

Page 17: Design, Formatting, CSS, & Colors

class Selector

Used to describe a style for a group of elements

Useful for when multiple elements have same style.

Defined with “.”

Allows you to give your styles helpful, memorable names.

Page 18: Design, Formatting, CSS, & Colors

class Selector

can also define a class selector for specific HTML elements

Good for clarifying what the style will effect, but not necessary.

Page 19: Design, Formatting, CSS, & Colors

id SelectorUsed to describe a style for a single, unique element

Defined with a “#”

Can be applied to more than one element, but this is bad practice!

You don’t really have to use this, because you can always use class selector.

Page 20: Design, Formatting, CSS, & Colors

Formatting your CSS

Formatting Practices:some flexibility, but you must be consistent.always comment your code!

/* someCommentHere */curly bracestab alignment

Bad practices:multiple attributes on the same line

What does Komodo help you with?drop downsformatssyntax errors

.menu li == li.menu

Page 21: Design, Formatting, CSS, & Colors

Commonly Used Tags & Properties

full reference sheet

Page 22: Design, Formatting, CSS, & Colors

Background

Page 23: Design, Formatting, CSS, & Colors

Text

Can be used with any text based html element. [body, div, p, h1, h2, etc.]

Page 24: Design, Formatting, CSS, & Colors

Font

Like text styles, this property can be used with any text based element.

If no font is defined, you’ll get the default font.

Don’t forget Browser Shots.

A nice list of fonts & font families

Page 25: Design, Formatting, CSS, & Colors

Links

Quick refresher on html links:

<a href = “url”> someLinkText </a>

Page 26: Design, Formatting, CSS, & Colors

LinksLink states

a:link -- a normal, unvisited linka:visited -- a link the user has visiteda:hover -- a link when the user mouses over ita:active -- a link the moment it is clicked

Note: hover must come after link & visited. active must come after hover.Styles

can use all text and font styles, plus background color

Page 27: Design, Formatting, CSS, & Colors

Tables

Can apply styles to every aspect of a table

the table itselfheaders (th)rows (tr)cells (td)table body (tbody)

Page 28: Design, Formatting, CSS, & Colors

Table Example

Table Example...

Page 29: Design, Formatting, CSS, & Colors

Tables

go into komodo to show them:

collapsable borders

simple borders

line changes

check out last semesters calendar for some examples [black line on two sides, white line on two sides]

headers having different backgrounds, etc. etc.