web design bootcamp - day1

67
Web Design Bootcamp with Aslam Najeebdeen day 01

Upload: aslam-najeebdeen

Post on 02-Jul-2015

145 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Web Design Bootcamp - Day1

Web Design Bootcamp

with Aslam Najeebdeen

day 01

Page 2: Web Design Bootcamp - Day1

About me

Aslam Najeebdeen

@aslamnd

Page 3: Web Design Bootcamp - Day1

Why I’m here today?

Help people

Make friends

Have Fun

Page 4: Web Design Bootcamp - Day1

Agenda

• HTML 5

• CSS 3

• CSS Frameworks

• SASS & Compass

Page 5: Web Design Bootcamp - Day1

HTML 5

Page 6: Web Design Bootcamp - Day1

What is hTML 5?

Not revolution it’s an evolution

Page 7: Web Design Bootcamp - Day1

WHY HTML5?

• Backword compatibility

• Error parsing

Page 8: Web Design Bootcamp - Day1

New Features

• Semantic elements and attributes

• Support for audio and video

• Reduce the need of 3rd party plugins

• Detailed algorithms for parsing errors

• Built in APIs to help web application

Page 9: Web Design Bootcamp - Day1

“– Michael Mahemoff, Software as She Developed

HTML5 is a brand .”

Page 10: Web Design Bootcamp - Day1

what isn’t HTML5?

• Web Sockets

• Geolocations

• SVG

• CSS3 transitions

• CSS @font-face

Page 11: Web Design Bootcamp - Day1

“@whathtml5isnot

If you think something is HTML5, it probably isn't. Don't worry though, even the W3C is

confused.

Page 12: Web Design Bootcamp - Day1

Demo

<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Document</title></head><body>

</body> </html>

index.html

<h1>Hello World</h1>

index.html.erblayout.erb

<%= yield %>

Page 13: Web Design Bootcamp - Day1

New Structural <tags>

Page 14: Web Design Bootcamp - Day1

Section tag

<section></section>

“The section element represent a generic section of a

document or application. A section, in this context, is a

thematic groups of content, typically with a heading…”

<section> tag is not a replacement for <div> tag

Page 15: Web Design Bootcamp - Day1

Article tag

<article></article>

“The article element represents a self-contained

composition in a document, page, application, or site

and that is intended to be independently distributable

or reusable, in syndication

e.g: a blog entry, newspaper article, forum post, blog

comments or any other independent item of content

Page 16: Web Design Bootcamp - Day1

aside tag

<aside></aside>

Represents a section of a page that consists of content

that is tangentially related to the content around the

aside element, and which could be considered separate

from that content.

e.g: sidebar content, polls, quotes, relation navigations

Page 17: Web Design Bootcamp - Day1

Aside tag

<aside>

!!

<article>

<aside>

Page 18: Web Design Bootcamp - Day1

header tag

<header></header>

Represents a a group of introductory or navigational

aids. A header element is intended to usually contain the

section’s heading (an h1 - h6 element or an hgroup

element), but this not required. The header element can

also be used to wrap a section’s table of contents, a

search form or any relevant logos.”

Note: a document can contain multiple headers

Page 19: Web Design Bootcamp - Day1

header tag

<aside>

!!

<article>

<header>

<header>

!!

<article>

<header>

Page 20: Web Design Bootcamp - Day1

Hgroup tag

<hgroup></hgroup>

Represents the heading of a section. This element is

used to group a set of h1-h6 elements when the heading

has multiple levels, such as subheadings, alternative

titles, or tag lines.

Page 21: Web Design Bootcamp - Day1

footer tag

<footer></footer>

“Represents a footer for it’s nearest ancestor sectioning

content or sectioning root element. Typically contains

information about its section such as who wrote it, links

to related documents, copyright data, and the like”

Note: a document can contain multiple footers

Page 22: Web Design Bootcamp - Day1

Footer tag

<aside>

<article>

<header>

<header>

<article>

<header>

<footer>

<footer>

<footer>

Page 23: Web Design Bootcamp - Day1

Nav tag

<nav></nav>

“Represents a section of a page that links to other pages

or to parts within the page: a section with navigation

links.”

Note: only to be used in major navigation block.

Page 24: Web Design Bootcamp - Day1

Other NEW <tags>

Page 25: Web Design Bootcamp - Day1

content tags

<video>

<audio>

<figure>

<embed>

<canvas>

Page 26: Web Design Bootcamp - Day1

Application focus tags

<meter>

<time>

<progress>

<details>

<command>

<menu>

Page 27: Web Design Bootcamp - Day1

Deprecated <tags>

Page 28: Web Design Bootcamp - Day1

presentational tags

<basefont>

<big>

<center>

<font>

<s>

<strike>

<tt>

<u>

Page 29: Web Design Bootcamp - Day1

Accessibility concerns

<frame>

<frameset>

<noframe>

Page 30: Web Design Bootcamp - Day1

Out of date tags

<dir>

<applet>

<acronym>

<isindex>

Page 31: Web Design Bootcamp - Day1

CSS

Page 32: Web Design Bootcamp - Day1

h1 { font-size: 3.2em; }

selector property value

declaration

CSS Rule

Page 33: Web Design Bootcamp - Day1

• Selectors - http://goo.gl/ZdvQj

• Properties and values: http://goo.gl/

wzNdc

Page 34: Web Design Bootcamp - Day1

Units

Page 35: Web Design Bootcamp - Day1

Units

px pixels vw viewport width

em ems vh viewport height

rem root ems vmin viewport minimum

ex exes vmax viewport maximum

gd grids ch character

Page 36: Web Design Bootcamp - Day1

ems

100% default browser font size = 16px

1em

A relative unit of measurement

Page 37: Web Design Bootcamp - Day1

calculating ems

target size / default size = # of ems

20px = 20 / 16 = 1.25em

Page 38: Web Design Bootcamp - Day1

ems

h1{ font-size: 2em; padding-bottom: 1em; background: red; }

2em = 2 x base font size (16px) = 32px

demo

1em = 2 x font size (32px) = 32px

Page 39: Web Design Bootcamp - Day1

Better way to calculate ems?

What if we can make the base font size to 10px?

10/16 = .625em

Page 40: Web Design Bootcamp - Day1

why rem (root ems)?

demo

<div class=“featured”> <h1>Hello World</h1> </div>

.featured { font-size: 2em; } !.featured h1 { font-size: 2em; } !.featured h1 { font-size: 2rem; }

2em = 2 x base font size (16px) = 32px

2em = 2 x font size (32px) = 64px

2em = 2 x base font size (16px) = 32px

http://goo.gl/85fhM

Page 41: Web Design Bootcamp - Day1

viewport measurements

http://goo.gl/Vxm7J

Page 42: Web Design Bootcamp - Day1

Understanding the Box model

Page 43: Web Design Bootcamp - Day1
Page 44: Web Design Bootcamp - Day1

margin

padding

Box model

The CSS box model describes the rectangular boxes that

are generated for elements in the document tree and laid

out according to the visual formatting model.

demo

600px

700px

Page 45: Web Design Bootcamp - Day1

Resolving Conflicts

Page 46: Web Design Bootcamp - Day1

“– Author Unknown

If you have lot’s of !important in your stylesheet, you are doing

it wrong!

Page 47: Web Design Bootcamp - Day1

Things you should master

Cascade

Inheritance

Specificity

Page 48: Web Design Bootcamp - Day1

Cascade

• Last style applies wins

demo

Page 49: Web Design Bootcamp - Day1

Inheritance

• Child always wins

• Organize the basic and default styles for top level elements

demo

Page 50: Web Design Bootcamp - Day1

Specificity

selector Inline ID class elements specificity

body 0 0 0 1 1

div p 0 0 0 2 2

.author 0 0 1 0 10

#container 0 1 0 0 100

#featured div 0 1 0 1 101

<div style=“background:

red;”>1 0 0 0 1000

demo

Page 51: Web Design Bootcamp - Day1

Specificity

• Keep specificity as low as possible

demo

Page 52: Web Design Bootcamp - Day1

General rules of thumb

Avoid local and inline styles

Page 53: Web Design Bootcamp - Day1

Colors

Page 54: Web Design Bootcamp - Day1

#FFFF00

hexadecimal

#FF0

demo

Page 55: Web Design Bootcamp - Day1

rgb(255,23,54)

RGB

rgb(90%,10%,30%)

demo

Page 56: Web Design Bootcamp - Day1

hsl(0-360,%,%)

hsl

demo

Page 57: Web Design Bootcamp - Day1

Tools

• Adobe Kuler - http://kuler.adobe.com

• ColorSchemer Studio (Mac/Windows)

• ColorSnapper (Mac)

• Alfred Color plugin

Page 58: Web Design Bootcamp - Day1

Cross browser issues

• Avoid Hacks as much as possible

• Use conditional comments

Page 59: Web Design Bootcamp - Day1

Meet Modernizr

demo

Page 60: Web Design Bootcamp - Day1

CSS Frameworks

demo

Page 61: Web Design Bootcamp - Day1

CSS Reset

demo

• Eric Mayer’s reset

• YUI Reset

• Normalize

Page 62: Web Design Bootcamp - Day1

“– Eric Meyer, Reset Reasoning

I don’t want to take styles effects for granted[…] It makes me think just that little bit harder about the

semantics of my document. With the reset in place, I don’t pick strong because the design call for

boldfacing. Instead, I pick the right element whether it’s strong or em or b or h3 or whatever - and then

style it as needed

Page 63: Web Design Bootcamp - Day1

Please don’t do this!

* { margin: 0; padding: 0; }

Page 64: Web Design Bootcamp - Day1

CSS GRIDS

Page 65: Web Design Bootcamp - Day1

DEMO

demo

Page 66: Web Design Bootcamp - Day1

Sass & Compass

demo

Page 67: Web Design Bootcamp - Day1

keep in touch

Twitter: @aslamnd

Facebook: /aslamnajeebdeen

Email: [email protected]

Blog: http://aslamnajeebdeen.com