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].
<
element>
content </
element>
<p>This is a paragraph</p>
<title>Chapter 2: HTML Basics</title>
<h1>
,
<h2>
, ...,
<h6>
separate major areas of a page.
<h1>University of Whoville</h1> <h2>Department of Computer Science</h2> <h3>Sponsored by Micro$oft</h3>
<hr>
a horizontal line to visually separate sections of a page (block)
<p>First paragraph</p> <hr /> <p>Second paragraph</p>
/>
<
element attribute="
value"
attribute="
value">
content </
element>
<a href="page2.html">Next page</a>
<
element attribute="
value"
attribute="
value" />
<hr />
<img src="bunny.jpg" alt="pic from Easter" />
<a>
and <img>
tags on later slides.
<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>
href
attribute to specify the destination URL
p
or h1
<img>
inserts a graphical image into the page (inline)
<img src="images/gollum.jpg" alt="Gollum from LOTR" />
src
attribute specifies the image URLalt
attribute describing the image<a href="http://theonering.net/"> <img src="images/gandalf.jpg" alt="Gandalf from LOTR" title="You shall not pass!" /> </a>
a
anchor, the image becomes a linktitle
attribute is an optional tooltip (on ANY element)<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
(guideline: >= 2 in a row is bad)
br
should not be used to separate paragraphs or used multiple times in a row to create spacing<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>
<p> HTML is <em>really, <strong>REALLY</em> lots of</strong> fun! </p>
a way of representing any Unicode character within a web page
character(s) | entity |
---|---|
< > | < > |
é è ñ | é è ñ |
™ © | ™ © |
π δ Δ | π δ Δ |
И | И |
" & | " & |
&
on a web page?<!--
... -->
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.
<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>
abacus.csse.rose-hulman.edu
~username
SecureFX
came with your laptop; FileZilla
is another commonly used program.
<div>
and <span>