Table of Contents

~~SLIDESHOW~~

Text, Images and Links

Contact Hour 14: To be discussed on Tuesday 13th March, 2012.

Lecturer: Dr Chris P. Jobling.


The contents of these notes and all the examples are from Castro and Hyslop, HTML5 and CSS3: Visual Quickstart Guide, 7th Ed., PeachPit Press, 2012.

These notes are incomplete and you are invited to contribute to them by getting an account on this wiki.

Text, Images and Links

Text

All the Text Examples

All the examples to be explored in this session are from Chapter 4 of Castro and Hyslop:

Paragraphs

<article>
  <h1>Antoni Gaudí</h1> 
  <p>Many tourists are drawn to Barcelona to see 
     Antoni Gaudí's incredible architecture.</p>
  <p>Barcelona celebrated the 150th anniversary 
     of Gaudí's birth in 2002.</p>
  :
  :
</article>

Example


<note>

</note>

Addresses

The address element is used to mark up the contact information of the author, people or organisation responsible for creating the web page or an article within a page.

Example

Figures and Time

Phrasing elements

Marking Important and Emphasized Text

Phrasing elements (2)

Phrasing elements (3)

Marking up Code, etc.


<note tip> If you want to present HTML code in your code examples, you have to replace each < and > by &lt; and &gt; respectively. </note>

Fine print, line breaks and spans


<note> Because they don't have any default styling, spans are usually used with class or id and CSS rules. </note>

Other miscellaneous elements

See pages 136–145 of Chapter 4. Of these, meter and progress are new elements added by HTML5.

Images

<img src="images/image.url" alt="Alternative text -- displayed if image is not." />

<note>

</note>

All the Images Examples

All the examples to be explored in this session are from Chapter 5 of Castro and Hyslop:

To another page:

<a href="page2.html">Page 2</a>

<note> * The element name a stands for anchor. * The href attribute is the location of the resource – A URL. Should be relative if page is in same web site as referring page (the full URL is computed by the Browser). When clicked, browser will issue an HTTP GET request. </note>

Anchors

All the examples to be explored in this session are from Chapter 6 of Castro and Hyslop:

Example

Markup a blog post and make a note of the tags you use.

The Ballad of John and Yoko
John Lennon's blog
Post title: A day in the life -> link: http://bit.ly/xAbMvf 
[image: source -> http://bit.ly/wOEIS5]
Text: I read the news today
Oh, boy! 4,000 holes in Blackburn Lancashire
And though the holes were rather small, they had to count them all.

Now they know how many holes it takes to fill the Albert Hall!

Byline: Posted by: John, January 17th. 1967.

Summary

Homework

<header>
<hgroup>
<h1>Blog Title</h1>
<h2>Sub title</h2>
</hgroup>
<article id= "unique-id" class="post">
  <h2>Entry Title</h2>
  <div class="entry-text">
    <p>The blog entry</p>
    <p> ... </p>
  <footer class="byline">
    <em>Posted by</em>: 
    <address>Author</address> <datetime>
  </footer>
</article>
<aside>
<h2>Archive</h2>
<nav role="navigation>
  <!-- Put links to previous posts here -->
</nav>
</aside>
<footer>
  Copyright notice etc
</footer>

* Add some extra entries and link them to a table of contents.

  Experiment highlighting parts of the document using styles.

Coming Next

lecture15