+ All Categories
Home > Documents > HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio...

HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio...

Date post: 27-Dec-2015
Category:
Upload: bertram-wilson
View: 230 times
Download: 3 times
Share this document with a friend
Popular Tags:
53
HTML & CSS
Transcript
Page 1: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

HTML & CSS

Page 2: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Objectives

HTML Block | Inline elementsVisual | Structural markupProject portfolio page

Page 3: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Block boxes and inline boxes

HTML create boxes

Block boxes and inline boxes—that correspond to the two types of tags—

• Inline tags

•Block-level tags.

Page 4: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Block boxes and inline boxes

Inline tags don’t create a break before or after element.

<span>, <em>, <strong> <cite>, <abbr>,<kbd>

<q> A block-level tags create a break before and

after the element.

<p> <h>,<ol>,<div>, etc.

Page 5: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

<p> I am seeking funds to assist me in further

developing an <em>intelligent online tool</em>

that provides semantic as well as temporal analyses

of online educational conversations. </p>

<p> I am seeking funds to assist me in further

developing an intelligent online tool that provides

semantic as well as temporal analyses of online

educational conversations. </p>

Block boxes and inline boxes

Block InLine

Page 6: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

I am seeking funds to assist me in further developing an

intelligent online tool that provides semantic as well

as temporal analyses of online educational

conversations.

I am seeking funds to assist me in further developing

an intelligent online tool that provides semantic as

well as temporal analyses of online educational

conversations.

Block boxes and inline boxes

Page 7: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Structural: Block-Level Elements

p – paragraphs h1, h2,…,h6 – level 1, 2,…,6 headers blockquote – long quotations div – arbitrary division <section><article><nav><aside> OL, UL, DL - list <table> for tabular data

Page 8: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Structural: Heading Levels

<h1>Heading Level 1</h1><h2>Heading Level 2</h2><h3>Heading Level 3</h3><h4>Heading Level 4</h4><h5>Heading Level 5</h5><h6>Heading Level 6</h6>

Page 9: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

In the summer of 2009, I developed Mapping Temporal Relations

of Discussions Software (MTRDS) as a tool to analyze the temporal

aspects of online course discussions. This Web-based prototype

imports discussion files from a course management system and

diagrams the temporal aspects of conversations. From the

diagrams, one can observe the general time and date of

discussion activity and individual patterns of interactivity.

I am seeking funds to assist me in further developing an intelligent

online tool that provides semantic as well as temporal analyses of

online educational conversations.

<h1> Introduction</h1>

<h2> Educational Conversations</h2>

Page 10: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Making Links

Page 11: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Linking to Another Document

Null links

<a href =“#”>This is a NULL link</a>

Page 12: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Linking to Another Document

<a href =“document.htm”>Text that acts as the link</a>

This anchor links to a document in the same folder as the current web page.

Page 13: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Linking to a Specific Section of A Document

<a href=“#SectionTitle”>Text that acts as the link</a>

<a name=“SectionTitle”> </a>

This anchor links to a specific section of the current page .

Page 14: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Linking to a Specific Section of Another Document

<a href=“document.htm#SectionTitle”>Text that acts as the link</a>

<a name=“SectionTitle”> </a>

This anchor links to a specific section of the document.htm page, which is in the same folder and the current web page.

Page 15: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Linking Another Document

<a href=“books/document.htm”>Read Books</a>

This anchor links to the document.htm page, which is in a folder titled books.

Page 16: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Linking to a Another Site

<a href=“http://www.cnn.com”>Read News</a>

This anchor links to an external web site.

Page 17: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Tutorials

http://www.w3schools.com/html/

Page 18: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Cascading Style Sheets

CSS

Page 19: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Cascading Style Sheets

What are style sheets? HTML was not meant to specify

appearance for Web pages.

Tags suitable for marking up scientific papers.

Page 20: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Sci

enti

fic

pap

ers

Sci

enti

fic

pap

ers

HTML is for structure

Page 21: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Cascading Style Sheets

What are style sheets?

CSS (Cascading Style Sheets) allows you to specify more information about the appearance of elements on a Web page.

Zen Garden

Page 22: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.
Page 23: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Cascading Style Sheets

A style sheet is a set of one or more rules that apply to HTML elements or document.

h1 { color: #000000; }

Page 24: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

<p style="color: #C7AA8D;”> In the summer of 2009,

I developed Mapping Temporal Relations of

Discussions Software (MTRDS) as a tool to analyze

the temporal aspects of online course discussions.

This Web-based prototype imports discussion files

from a course management system and diagrams the

temporal aspects of conversations. From the

diagrams, one can observe the general time and date

of discussion activity and individual patterns of

interactivity. </p>

<p style="color: blue;”> I am seeking funds to assist me

in further developing an intelligent online tool that

provides semantic as well as temporal analyses of

online educational conversations. </p>

Page 25: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Cascading Style Sheets

Why use styles?

Update the look of a Web site by changing a single document.

Keep content/structure separate from styling.

Page 26: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

External Styles

page4.htm

page6.htmpage7.htm

page2.htmpage3.htmpage1.htm

index.htm Style.cssStyle.css

page5.htm

• Make changes from a single document• Changes multiple documents

• Make changes from a single document• Changes multiple documents

<link rel="styleSheet" type"text/css" href="styles.css">

Page 27: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Cascading Style Sheets

History

Page 28: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

CSS Level 1 – CSS1

First version of CSS (CSS Level 1 - CSS1) in 1996.

Included properties for font, color, and spacing instructions to page elements.

Lack of browser support prevented

widespread use of CSS.

Page 29: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

CSS2

CSS Level 2 (CSS2) released in 1998.

Added positioning properties allowed

CSS to be used for page layout.

Page 30: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

CSS2

CSS Level 2, Revision 1 (CSS2.1) minor adjustments to CSS2 and is currently a working draft or a Candidate Recommendation (W3C).

Page 31: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

CSS2.1 and CSS3

CSS 2.1 builds on CSS2 which builds on CSS1. CSS 2.1 is derived from and will replace CSS2. CSS3 specification – Working draft

Page 32: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

CSS

Most browsers support majority of CSS1, CSS2, and CSS2.1 specifications.

Some browsers already support features from CSS Level 3 (CSS3) - still in development.

Source : www.w3.org/Style/CSS.

Page 33: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Ways to Include styles in documents

Page 34: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Ways to Include styles in documents

Inline styles<h1 style="color: #C7AA8D;">Heading 1</h1>

Embedded External

Page 35: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Internal Style Sheets: Embedded

<head>

<style type="text/css“>

h1 { color : #C0C0C0; }

font-family: Arial; font-size: 1.5em; }

p { font-size: small;

font-family: sans-serif; }

</style>

</head>

Page 36: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

External Style Sheets | Linked with HTML | 1 or more sheets

<head>

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

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

</head>

rel="stylesheet" | identifies the type of link, link to a style sheet.

type="text/css" tells browser what type of data, a text file with CSS.

Page 37: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Rules, Selectors, Declarations

Page 38: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

CSS Grammar

CSS - one or more style instructions (called Rules).

Rules describe how elements get displayed.

h1 { color: green; } or h1 {color : rgb(255, 0,0);}

p { font-size: small; font-family: sans-serif; }

Page 39: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Style sheet | Rules

p { font-family: sans-serif; }

Rule

Page 40: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Style sheet | Rules

p { font-size: small; font-family: sans-serif; }

Rule Can be written this way

Page 41: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

More about Rules | Selectors

h1 { color : #C0C0C0; }

Rule

Page 42: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

The Rule

h1 {color : #c0c0c0;}

Selector Declaration

Rule

(What to format)

Page 43: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

The Rule

h1 { color : #c0c0c0;

font-family : Arial;

font-size : 2em;

}

Selector

Declaration block

Rule

Page 44: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

The Declaration

h1 { color : #C0C0C0; }

Property

Declaration - two parts separated by a colon:

Property - part before the colon Value - part after the colon

Value

Page 45: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

The Declaration

h1 { color : #c0c0c0; font-size : 2em;

}

p { font-family : Arial;}

Brackets distinguish declarations | rules

Colon separates property and values

Semicolon separates declarations

Page 46: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Types of selectors

Page 47: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Types of selectors

1. Tag or HTML Selectors: Page-Wide Styling

2. Class Selectors: Pinpoint Control

3. ID Selectors: Specific page sections

4. Group Selectors

Page 48: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Types of selectors | HTML | Tag

Tag selector

h1 {color : #c0c0c0;}

body {background-color : #FFFFFF;}

p {padding : 10px;}

Page 49: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Types of selectors | Classes

•Class selector

.mytext {font-family: Verdana; font-size: 14px;}

<p class=“mytext”>Hello World</p>

<span class=“mytext”>Learning CSS</span>

Page 50: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Types of selectors | ID

ID selectors identify:

• Major sections

• Configured with #idname

#banner { background-color : #FF00FF;}

<div id=“banner”> </div>

Page 51: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Types of selectors | ID

Creates a rule for an id titled “banner”. Red, large, italic font.

Applies to ID “banner”

<style type="text/css">

#banner { color : #FF0000;font-size:2em; font-style: italic;

}

</style>

<h1 id=“banner”>Hello world!

</h1>

Page 52: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Combining Rules | Group Selectors

h1 { color : #F1CD33; }

h2 { color : #F1CD33; }

h3 { color : #F1CD33; }

h4 { color : #F1CD33; }

h5 { color : #F1CD33; }

h6 { color : #F1CD33; }

OR Groups selector

h1, h2, h3, h4, h5, h6 { color : #F1CD33; }

Page 53: HTML & CSS. Objectives HTML Block | Inline elements Visual | Structural markup Project portfolio page.

Recommended