w3b sk1llz zhongshan university day 2: creative commons and stylesheets

Post on 31-May-2018

221 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 1/138

 

W3b Sk1llz

現在 !Day 2 of 2

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 2/138

 

What is the commons?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 3/138

 

Resources that are freely

accessible to any member of a given community.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 4/138

 

Natural resources(air, water, parks)

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 5/138

 

Cultural resources(creative works, scientific works, public knowledge)

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 6/138

 

What is Copyright?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 7/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 8/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 9/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 10/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 11/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 12/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 13/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 14/138

 

Copyright grants copyrightowner a bundle of rights.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 15/138

 

If you want to...

then you need to ASK!

Copy/Distribute Publicly Perform Publicly Display Build Upon Digitally Distribute

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 16/138

 

CC provides free licenses for 

content (creative works).

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 17/138

 All Rights Reserved.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 18/138

 No Rights Reserved.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 19/138

 Some Rights Reserved.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 20/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 21/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 22/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 23/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 24/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 25/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 26/138

 

46

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 27/138

 

http://cn.creativecommons.org/

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 28/138

 By preciouskhyatt, http://flickr.com/photos/preciouskhyatt/http://creativecommons.org/licenses/by/2.0

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 29/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 30/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 31/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 32/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 33/138

 

http://creativecommons.org/license/by/3.0

Unless otherwise noted, this work is

licensed under a CC Attribution 3.0un orted license.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 34/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 35/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 36/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 37/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 38/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 39/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 40/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 41/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 42/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 43/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 44/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 45/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 46/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 47/138

 

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 48/138

 

?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 49/138

 

Quick Review from Day 1

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 50/138

 

XHTML 1.0 is current standard● xhtml 1.0 specification

● All elements lowercase

● Use double-quotes

● All tags close

● Removal of some arcane tags (<blink />)

● Separation of style/css and structure/html

http://www.w3.org/TR/xhtml1/

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 51/138

 

Why use standards?● Compliance on multiple operating systems

● Compliance on multiple web browsers

● Accessibility (disabilities)

● Scalable media (from computer to cell phoneto PDA)

● Quality assurance

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 52/138

 

HOWTO● Create plain-text file in favorite text editor

 – notepad

Save file with name “index.html”● Open web browser

● Drag your text file into browser window

● Now, make edit, and refresh the browserwindow to see changes.

B i HTML W b

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 53/138

 

Basic HTML Webpage

<html>

<head>

<title>Summer</title>

</head>

<h1>Summer Vacation</h1>

<p>My summer vacation was sunny, silly, and far tooshort.</p>

<p>How many days till Christmas?</p></html>

B i HTML W b

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 54/138

 

Basic HTML Webpage

<html>

<head>

<title>Summer</title>

</head>

<h1>Summer Vacation</h1>

<p>My summer vacation was sunny, silly, and far tooshort.</p>

<p>How many days till Christmas?</p></html>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 55/138

 

http://rejon.org/wiki/Developing_a_Buzz:Web_Workshop

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 56/138

 

Testing: Validationhttp://validator.w3.org/

Valid Basic Webpage

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 57/138

 

Valid Basic Webpage<!DOCTYPE html

PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

<title>Jon Phillips</title>

</head>

<body>

<!-- menu start -->

<p><a href="about.html">about</a> :

<a href="http://www.rejon.org/">rejon.org</a> :

<a href="projects/index.html">projects</a>

</p>

<!-- menu stop -->

<h1>bio</h1>

<p><b>Jon Phillips</b> (www.rejon.org) is an open source developer, artist, writer, educator, lecturer, and curator with 12+ years of experience creating communities and working within computing culture. His involvements with

mixing culture and software development have been shown internationally at the Desktop Developers Conference (2005), SFMoMA (2004), University of Tokyo (2004), Korea's KAIST (2004), UCLA Hammer Museum'sDigital Storytelling Conference, UC-Berkeley's 040404 Conference (2004), USC Aim Festival IV (2003), and the ICA London (2002). He is a core Open Source developer advocate and developer on Inkscape(http://www.inkscape.org), a scalable vector graphics editor and on the Open Clip Art Library (http://openclipart.org), and is writing/producing a book, "CVS: Concurrency, Versioning and Systems." Currently, he is visitingfaculty at the San Francisco Art Institute (www.sfai.edu) in the Design+Technology department and is an Open Source developer for the Creative Commons (www.creativecommons.org).</p>

<!-- footer start -->

<p><a href="mailto:jon@rejon.org">email</a></p>

<!-- footer stop -->

</body>

</html> http://rejon.org/wiki/Developing_a_Buzz:Web_Workshop#Valid_Basic_Page

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 58/138

 

LASTCLASS

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 59/138

 

Create your own webpage with

personal profile and with all your class work on it (linked to it)

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 60/138

 

Your Page MUST Validate:http://validator.w3.org/

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 61/138

 

Work in groups of 4-5 ppl. to make

a simple group page with links togroup member pages

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 62/138

 

TEACHING: Styling your Pages

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 63/138

 

Day 2: Web Design (CSS)

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 64/138

 

What are Stylesheets?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 65/138

 

"In computing, Cascading Style Sheets (CSS) is astylesheet language used to describe the presentation of a document written in a markup language. Its most

common application is to style web pages written inHTML and XHTML, but the language can be applied toany kind of XML document, including SVG and XUL. TheCSS specifications are maintained by the World WideWeb Consortium (W3C)."

http://en.wikipedia.org/wiki/Cascading_Style_Sheets

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 66/138

 

What is possible?http://www.csszengarden.com/

http://en.wikipedia.org/wiki/Cascading_Style_Sheets#External_li

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 67/138

 

Current CSS Spec is 2.1http://www.w3.org/Style/CSS/

http://www.w3.org/TR/CSS1

http://www.w3.org/TR/CSS2/

http://www.w3.org/TR/CSS21/

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 68/138

 

BasicsA style sheet consists of a list of rules. Each rule

consists of a selector and a declaration block.A declaration-block consists of a list of 

semicolon-separated declarations in curlybraces. Each declaration itself consists of aproperty, a colon (:) then a value.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 69/138

 

IN CSS

body {background-color: red;

}

In a new file, default.css:

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 70/138

 

Elements are styled through

selectors. Examples:

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 71/138

 

All elementsthat is, using the * selector

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 72/138

 

By element namee.g. for all p or h2 elements

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 73/138

 

Descendentse.g. for a elements that are descendants of li

elements (e.g links inside lists) the selector isli a

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 74/138

 

class or id attributes (from html)e.g. .class and/or #id for elements with:

class="some_class"

id="some_id"

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 75/138

 

Adjacent elementse.g. for all p elements preceded by h2

elements, the selector would be h2 + p

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 76/138

 

Direct child elemente.g. for all span elements inside p, but no span

elements deeper within the hierarchy, theselector would be p > span

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 77/138

 

By attributee.g. for all <input type="text"> the selector

would be input[type="text"]

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 78/138

 

In addition to these, a set of pseudo-classes can be usedto define further behavior. Probably the best-known of these is :hover, which applies a style only when the user 'points to' the visible element, usually by holding the

mouse cursor over it. It is appended to a selector as ina:hover or #elementid:hover. Other pseudo-classes andpseudo-elements are, for example, :first-line, :visited or :before. A special pseudo-class is :lang(c), where thestyle would be applied on an element only if it is inlanguage "c".

IN CSSp {

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 79/138

 

p {font-family: "Garamond", serif;

}h2 {

font-size: 110%;color: red;background: white;

}.note {

color: red;background: yellow;font-weight: bold;

}p#paragraph1 {

margin: 0;}a:hover {

text-decoration: none;}

Examples inspired by http://en.wikipedia.org/wiki/Cascading_Style_Sheets

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 80/138

 

REMEMBERhttp://webmonkey.com/webmonkey/reference/stylesheet_guide/units.html

http://www.ilovejackdaniels.com/css/box-model/

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 81/138

 

Classes are an attribute that maybe used however many times youwant. It is a blueprint for creating

many different styles.IN HTML

<p class="note">This paragraph will be renderedin red and bold, with a yellowbackground.</p>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 82/138

 

IN CSS

p.note {

color: red;

font-weight: bold;background: yellow;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 83/138

 

IDs are meant to be used only onceon a page, however, due to HTMLglitches, you may use just like

classes. Try to use only once per page though.

IN HTML

<p id="note">This paragraph will be rendered inred and bold, with a yellow background.</p>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 84/138

 

IN CSS

p#note {

color: red;

font-weight: bold;

background: yellow;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 85/138

 

HOWTO Connect CSS with HTML

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 86/138

 

Inline you would include stylesheets

inside the tags as an attribute.IN HTML

<p style="color: red">Hello this is a red

paragraph.</p>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 87/138

 

Why is this not correct?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 88/138

 

Global Embedded

IN HTML

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 89/138

 

IN HTML

<html><head><title>Title</title>

<style type="text/css"><!--[STYLE INFORMATION GOES HERE]

--></style>

</head>

<body>[DOCUMENT BODY GOES HERE]</body></html>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 90/138

 

Why is this not correct?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 91/138

 

Linked (preferred)

IN HTML

<link rel="stylesheet" href="example.css"type="text/css" />

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 92/138

 

Linking Example 2 (not all browsers)

IN HTML

<style type="text/css">

@import "example.css";</style>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 93/138

 

InheritanceIn cases where local, global, and linked style definitionsconflict, the most specific stylesheet will generally take

precedence: local overrides global, global overrideslinked. Similarly, inline style attributes override ID, IDoverrides class, and class overrides stylesheet-definedHTML elements. (Hence the concept of cascadingstylesheets)

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 94/138

 

CSS Comments

IN CSS

body {

background: yellow;

padding: 4px;

/* border: 1px solid black; */

}

/* This is a comment and is not visible */

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 95/138

 

Referencehttp://en.wikipedia.org/wiki/Cascading_Style_Sheets#Reference

http://jigsaw.w3.org/css-validator/

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 96/138

 

http://rejon.org/wiki/Developing_a_Buzz:Web_Workshop

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 97/138

 

READY FOR NEXT LEVEL?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 98/138

 

What is the difference between

HTML tag and CSS selector formats?

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 99/138

 

HTML tag format<a href="http://www.rejon.org/" class="myclass"name="My Link" />

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 100/138

 

CSS selector formata.myclass {

color: blue;

background: red;

padding: 8px;}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 101/138

 

CSS: Different DISPLAY Modes

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 102/138

 

INLINEDoes not break the current line.EXAMPLES: <b />, <i />, <span />

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 103/138

 

BLOCKIs a block that breaks a lineEXAMPLES: <p />, <h1..h* />, <div />,<blockquote />

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 104/138

 

DIVDIV stands for block level division.It is generic.DIVs are used in modern web design to createthe overall look and feel of a page.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 105/138

 

Div Example<div>

<!-- put whatever you want here -->

</div>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 106/138

 

Div Example CSSdiv {

padding: 2%;

background-color: red;

width: 20%;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 107/138

 

Div Example 2 HTML<div id="sidebar">

<p>This is my sidebar.</p>

</div>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 108/138

 

Div Example 2 CSSdiv#sidebar {

float: right;

padding: 2%;

background-color: #ccc;

width: 25%;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 109/138

 

BOX MODELBox model is a way of understanding how block

level elements styling works as a block.http://www.redmelon.net/tstme/box_model/http://www.w3.org/TR/REC-CSS2/box.html#box

http://www.hicksdesign.co.uk/boxmodel/GO THROUGH THIS!!!http://www.w3.org/TR/REC-CSS2/box.html

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 110/138

 

Box HTML Example<div id="box">

hello friends

</div>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 111/138

 

Box CSS Examplediv#box {

width: 100px;

border: 1px solid #900;

padding: 10px;margin: 10px;

background: #fee;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 112/138

 

<span>...</span>This is used inline (like in paragraph)May be used to specify style inline

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 113/138

 

Span Example<p><span class="alert">NEW UPDATE</span>: Thisis a new item.</p>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 114/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 115/138

 

LISTS: Unordered List<ul>

<li>item one</li>

<li>item two</li>

<li>item three</li></ul>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 116/138

 

Unordered Lists CSSul {

padding: 8px;

background: #eeeeee;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 117/138

 

LISTS: Ordered List<ol>

<li>item one</li>

<li>item two</li>

<li>item three</li>

</ol>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 118/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 119/138

 

List Exampleshttp://www.w3schools.com/css/css_list.aspNO DECORATIONS in CSS use:

− list-style-type: none;

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 120/138

 

<img /><img src="myimage.jpg" alt="Text here in case image not loading"name="Text for mouse when over image" class="myimage" />

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 121/138

 

CLASS EXAMPLE: We are designing a

page with one big main section, aheader, and sidebar.

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 122/138

 

Table-less Page Example

<html>

<head>

<title>hello</title>

</head>

<body>

<div id="header">

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 123/138

 

This is the header. Maybe good to put your title here and menu.

</div>

<div id="main">

This is where your main page section goes.

</div>

<div id="sidebar">

This is where possibly quick information, a menu, etc, might go.

</div>

</body>

</html>

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 124/138

 

Example CSS

html {

margin: 0;

padding: 0;

}

#header {

width: 100%;background-color: blue;

color: white;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 125/138

Example CSS Version 2

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 126/138

 

p

html {

margin: 0;

padding: 0;

}

#header {

width: 100%;

background-color: blue;color: white;

padding: 2%;

}

#main {

width: 80%;

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 127/138

 

float: left;

background-color: #eee;padding: 2%;

border: 1px dotted black;

}

#sidebar {

width: 20%;

float: left;background-color: #ccc;

padding: 2%;

}

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 128/138

 

Designing Websites (reJon-Stylee)

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 129/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 130/138

 

Make Proposal/Contract with ClientBe Specific as to what you are doing for them!

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 131/138

 

Develop Concept Sketches

Make Mockups in Favorite

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 132/138

 

Make Mockups in Favorite

Professional WayIllustrator, Inkscape (http://www.inkscape.org/), Photoshop

Why use Illustration program compared to photo-editing app?

2:1 rule (about window size)

Minimum: 600 px width by 300 px height

Compression/Expansion: How will page compress and expand?

Navigation

Standard Navigation (unless really good idea to change)

Think in terms of sections/boxes (general): Header, menu, body,sidebar, footer

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 133/138

 

Slice and Dice: Create

CSS+XHTML to match mockupUse text editor, browser and image editor

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 134/138

 

TestAll Browsers (Internet Explorer, Mozilla, on bothMac/PC)

Validation/Compliance

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 135/138

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 136/138

 

If everything fine, then done,

otherwise...

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 137/138

 

Revise the site and go back to "Slice

and Dice step" and continue...

8/14/2019 W3b Sk1llz Zhongshan University Day 2: Creative Commons and Stylesheets

http://slidepdf.com/reader/full/w3b-sk1llz-zhongshan-university-day-2-creative-commons-and-stylesheets 138/138

top related