CSSE 290 Web Programming

Lecture 2: Basic HTML

Reading: Ch. 2; 3.1

Except where otherwise noted, the contents of this document are Copyright 2012 Marty Stepp, Jessica Miller, and Victoria Kirst. All rights reserved. Any redistribution, reproduction, transmission, or storage of part or all of the contents in any form is prohibited without the author's expressed written permission.

Otherwise note: Claude Anderson was given permission to modify the slides for CSSE 290 at Rose-Hulman by author Jessica Miller. The authors' original slides, based on Web Programming Step by Step, can be seen at http://webstepbook.com.

Some of the examples in some days' slides are from David Fisher at Rose-Hulman, who was kind enough to allow me to use them. My intention is to mark these examples with [DSF].

Valid HTML Valid CSS!

Administrivia (great word I got from Curt Clifton)

2.1: Basic HTML

HTML review from last session

Horizontal rule: <hr>

a horizontal line to visually separate sections of a page (block)

<p>First paragraph</p>
<hr />
<p>Second paragraph</p>

More about HTML tags

Links: <a>

links, or "anchors", to other pages (inline)

<p>
	Search 
	<a href="http://www.google.com/">Google</a> or our
  <a href="lectures.html">Lecture Notes</a>.
</p>

Block and inline elements

elements

Images: <img>

inserts a graphical image into the page (inline)

<img src="images/gollum.jpg" alt="Gollum from LOTR" />

More about images

<a href="http://theonering.net/">
	<img src="images/gandalf.jpg" alt="Gandalf from LOTR"
	     title="You shall not pass!" />
</a>

Line break: <br>

forces a line break in the middle of a block element (inline)

<p>Teddy said it was a hat, <br /> So I put it on.</p>
<p>Now Daddy's sayin', <br /> Where the
heck's the toilet plunger gone?</p>
  • br should not be used to separate paragraphs or used multiple times in a row to create spacing

Phrase elements : <em>, <strong>

em: emphasized text (usually rendered in italic)
strong: strongly emphasized text (usually rendered in bold)

<p>
	HTML is <em>really</em>,
	<strong>REALLY</strong> fun!
</p>

Nesting tags

<p>
	HTML is <em>really,
	<strong>REALLY</em> lots of</strong> fun!
</p>

HTML Character Entities

a way of representing any Unicode character within a web page

character(s)entity
< >&lt; &gt;
é è ñ&eacute; &egrave; &ntilde;
™ ©&trade; &copy;
π δ Δ&pi; &delta; &Delta;
И&#1048;
" &&quot; &amp;

Comments: <!-- ... -->

comments to document your HTML file or "comment out" text

<!-- My web page, by Suzy Student
     CSSE 290, Spring 2013       -->
<p>CSSE courses can be <!-- NOT --> a lot of fun!</p>

Let's do some practice! (see next page)

Follow the link on the schedule page to get the starting code (a ZIP file). Extract the Session02 folder and all of its contents to somewhere on your computer.

Try to duplicate this page

second page image

2.3: Web Standards

Web Standards

W3C HTML Validator

<p>
	<a href="http://validator.w3.org/check/referer">
		<img src="http://www.rose-hulman.edu/class/csse/csse290-WebProgramming/images/w3c-html.png"
		alt="Validate" />
	</a>
</p>

RHIT Public Place for Your Code

SecureFX sample use

Excercises on basic HTML