Top Banner
<h1>XHTML II</h1> <h2>DIGITAL MEDIA: COMMUNICATION AND DESIGN</h2> <h3>F2007</h3>
32

XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

<h1>XHTML II</h1>

<h2>DIGITAL MEDIA: COMMUNICATION AND DESIGN</h2>

<h3>F2007</h3>

Page 2: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Goals of the lecture

Learn the different text elements in an XHTML document

Learn how to create links in a website

Page 3: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Index

Text elements Links

Page 4: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Document structure

Declaration html head title body

<?xml version=“1.0” encoding=“UTF-8”?><!DOCTYPE html PUBLIC “-//W3C//DTD

XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

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

<head><title>Welcome to my website</title>

</head>

<body><p>Hello world!</p>

</body>

</html>

Page 5: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Elements

Structure: <element_name>content</element_name>

Attributes: <element attribute=“value”>content</element>

Empty elements:Line break: <br /> Image: <img src=“…” alt=“…” />

Page 6: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Text elements

Block elements: Headings, paragraphs, quotations…

Inline elements: Emphasized text, citations, code…

Lists: Unordered lists, ordered lists…

Generic elements Presentational elements: deprecated!!

Page 7: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Block elements

Headings Paragraphs Blockquotes Preformatted text Addresses Lists Div Tables Forms

Page 8: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Block elements I: Headings

<h#>…</h#>, with # from 1 to 6 Structure sections of the document Their appearance can be changed with

style sheets

Page 9: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Block elements II: Paragraphs

<p>…</p> They always start a new line May not contain other block elements

Page 10: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Block elements III: Quotations

<blockquote>…</blockquote> May contain other block elements

Page 11: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Block elements IV: Preformatted

<pre>…</pre> Text is displayed exactly as it is typed in

the HTML document

Page 12: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Inline elements

Phrase elementsEmphasisAcronyms and abbreviations

Quotations Deleted and inserted text

Page 13: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Inline elements I: Phrase elements

Add structure and meaning to inline text May contain other inline elements

em: italicsstrong: boldabbr: Inc.acronym: ITUcode: write code (Courier font)

Page 14: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Inline elements II: Quotations

<q>…</q> It introduces quotation marks

Page 15: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Inline elements III: Deleted and inserted text <del>…</del>

Usually displayed as strike-through text <ins>…</ins>

Usually displayed underlined

Page 16: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Generic elements I: div

<div>…</div> Identify a block of text Really useful when used with CSS

Page 17: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Generic elements II: span

<span>…</span> Identify inline elements Javier: <span

class=“phone”>5064</span>

Page 18: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Element identifiers

class:Group multiple elementsAll elements will be treated similarly

id:Give a unique name to a specific elementWe can apply a style sheet to each identified

element

Page 19: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Lists

Block element Unordered lists: <ul>…</ul> Ordered lists: <ol>…</ol> List element: <li>…</li>

Page 20: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Presentational elements I

Some are deprecated!! Use style sheets instead<big>, <small>, <s>, <strike>, <u>

font element emphatically deprecatedcolor facesize

Page 21: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Presentational elements II

<b>Bold textUse <strong> instead

<i> ItalicsUse <em> instead

Page 22: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Presentational elements III

Line break<br />

Horizontal rule<hr /> Introduces a horizontal rule to separate text It’s preferred to use the border property in a

stylesheet

Page 23: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Index

Text elements Links

Page 24: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links (anchor)

<a>…</a> Creates a hypertext link to another

document or a section of a document Important attributes:

href=“URL” target=“text” (deprecated) id=“text”

Page 25: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links II

You can access ITU’s website <a href=“http://www.itu.dk”>here</a> or clicking in the logo

<a href=“http://www.itu.dk”><img src=“logo.jpg” /></a>

Page 26: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links III

Absolute URL<a href=“http://www.itu.dk”>ITU</a>

Relative URLLinking to a document in the same siteSyntax based on UNIX<a href=“../index.html”>Home</a>

Page 27: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links IVimages

index.html

list.html

index.html

charlie.html

students

teachers

/

big

small

javier.html

Page 28: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links V: linking to a section

We identify the fragment <h1><a id=“contact” name=“contact”>Contact

information</a></h1> <h1 id=“contact”>Contact information</h1>

If we link from the same document <a href=“#contact”>See contact information</a>

If we link from another document <a href=“index.html#contact>See contact

information</a>

Page 29: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links VI: targeting windows

Deprecated, but very popular We can open a link in a new window/tab

<a href=“http://www.google.com” target=“_blank”>Google</a>

Can be annoying

Page 30: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links VII: other protocols

FTP, ftp://<a href=“ftp://ftp.itu.dk”>Access ITU’s FTP

server</a> Mail, mailto://

<a href=“mailto:[email protected]”>Send me an e-mail</a>

Page 31: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Links VIII: link

Link to an external document Used to link to a CSS file

<link href=“stylesheet.css” rel=“stylesheet” type=“text/css” media=“screen” />

Page 32: XHTML II DIGITAL MEDIA: COMMUNICATION AND DESIGN F2007.

Digital Media: Communication and Design F2007

Questions?