Selected content adapted from material by Simon Minor, Marty Stepp, Jessica Miller, and Victoria Kirst © 2012. Used by permission.
ipconfig
(Windows) or ifconfig
(Mac/Linux)www.cps.gordon.edu
→ 216.236.251.139
C:\Windows\system32\drivers\etc\hosts
/private/etc/hosts
/etc/hosts
http://www.aw-bc.com/info/regesstepp/index.html ~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~ protocol host path
www.aw-bc.com
GET /info/regesstepp/index.html
http://www.textpad.com/download/index.html#downloads
index.html
then jumps down to part of the page labeled downloads
http://www.cps.gordon..edu:8080/secret/money.txt
http://www.google.com/search?q=miserable+failure&start=10
q
is set to "miserable+failure"
start
is set to 10
GET filename
: downloadPOST filename
: send a web form responsePUT filename
: upload$ telnet www.cps.gordon.edu 80 Trying 216.236.251.139... Connected to www.cps.gordon.edu. Escape character is '^]'. GET /index.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> ...
Number | Meaning |
---|---|
200 | OK |
301-303 | page has moved (permanently or temporarily) |
403 | you are forbidden to access this page |
404 | page not found |
500 | internal server error |
complete list |
MIME type | file extension |
---|---|
text/html | .html |
text/plain | .txt |
image/gif | .gif |
image/jpeg | .jpg |
video/quicktime | .mov |
application/octet-stream | .exe |
application/json | .json |
application/xml | .xml |
<
element>
content </
element>
<p>This is a paragraph</p>
<!DOCTYPE html> <html> <head> information about the page </head> <body> page contents </body> </html>
.html
or .htm
DOCTYPE
tag tells browser to interpret our page's code as HTML<title>
describes the title of the web page
<title>Chapter 2: HTML Basics</title>
head
of the page<p>
paragraphs of text (block)
<p>In the beginning was the Word, and the Word was with God, and the Word was God. He was with God in the beginning. </p>
In the beginning was the Word, and the Word was with God, and the Word was God. He was with God in the beginning.
body
of the page<h1>
,
<h2>
, ...,
<h6>
headings to separate major areas of the page (block)
<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>
First paragraph
Second paragraph
/>
<
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>
links, or "anchors", to other pages (inline)
<p> Search <a href="http://www.google.com/">Google</a> or our <a href="01_course_introduction.html">Lecture Notes</a>. </p>
Search Google or our Lecture Notes.
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>The Lord is my shepherd, I lack nothing.<br /> He makes me lie down in green pastures,<br /> he leads me beside quiet waters,<p>
The Lord is my shepherd, I lack nothing.
He makes me
ie down in green pastures,
he leads me beside quiet waters,
br
they are hard to apply css styles (more on this later)
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>
HTML is really REALLY fun!
<p> HTML is <em>really, <strong>REALLY</em> lots of</strong> fun! </p>
<!--
... -->
comments to document your HTML file or "comment out" text
<!-- My web page, by Anthony Aardvark CPS353 Fall 2015 --> <p>Computer science courses are <!-- NOT --> a lot of fun!</p>
Computer science courses are a lot of fun!
--
<ul>
,
<li>
ul
represents a bulleted list of items (block)
li
represents a single item within the list (block)
<ul> <li>No shoes</li> <li>No shirt</li> <li>No soup for you!</li> </ul>
<ul> <li>Tribes: <ul> <li>Levi</li> <li>Judah</li> <li>Benjamin</li> </ul> </li> <li>Apostles: <ul> <li>Peter</li> <li>John</li> </ul> </li> </ul>
<ol>
ol
represents a numbered list of items (block)
<p>RIAA business model:</p> <ol> <li>Sue customers</li> <li>???</li> <li>Profit!</li> </ol>
RIAA business model
<dl>
, <dt>
, <dd>
dl
represents a list of definitions of terms (block)
dt
represents each term, and dd
its definition
<dl> <dt>newbie</dt> <dd>one who does not have mad skills</dd> <dt>own</dt> <dd>to soundly defeat (e.g. I owned that newbie!)</dd> <dt>frag</dt> <dd>a kill in a shooting game</dd> </dl>
<blockquote>
a lengthy quotation (block)
<p>As Lincoln said in his famous Gettysburg Address:</p> <blockquote> <p>Fourscore and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.</p> </blockquote>
As Lincoln said in his famous Gettysburg Address:
Fourscore and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty, and dedicated to the proposition that all men are created equal.
<q>
a short quotation (inline)
<p>Quoth the Raven, <q>Nevermore.</q></p>
Quoth the Raven, Nevermore.
<p>Quoth the Raven, "Nevermore."</p>
We don't use " marks for two reasons:
"
<q>
allows us to apply CSS styles to quotations (seen later)a way of representing any Unicode character within a web page
character(s) | entity |
---|---|
< > | < > |
é è ñ | é è ñ |
™ © | ™ © |
π δ Δ | π δ Δ |
И | И |
" & | " & |
&
on a web page?)<p> <a href="http://google.com/search?q=aardvark&ie=utf-8"> Search Google for Aardvark </a> </p><p> <a href="http://google.com/search?q=aardvark&ie=utf-8"> Search Google for Aardvark </a> </p>
<code>
a short section of computer code (usually shown in a fixed-width font)
<p> The <code>ul</code> and <code>ol</code> tags make lists. </p>
The ul
and ol
tags make lists.
<pre>
a large section of pre-formatted text (block)
<pre> Steve Jobs speaks loudly reality distortion Apple fans bow down </pre>
Steve Jobs speaks loudly reality distortion Apple fans bow down
code
tags?<meta>
information about your page (for a browser, search engine, etc.)
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="Authors' web site for Building Java Programs." /> <meta name="keywords" content="java, textbook" />
head
section of your HTML pagemeta
tags often have both the name
and content
attributes
meta
tags use the http-equiv
attribute instead of name
meta
tag Content-Type
explicitly specifies what kind of content is in the web page
<link href="filename" type="MIME type" rel="shortcut icon" />
<link href="yahoo.gif" type="image/gif" rel="shortcut icon" />
link
tag, placed in the head
section, attaches another file to the page
favicon.ico
in the root of the web server (info)<table>
,
<tr>
,
<td>
A 2D table of rows and columns of data (block element)
<table> <tr><td>1,1</td><td>1,2 okay</td></tr> <tr><td>2,1 real wide</td><td>2,2</td></tr> </table>
1,1 | 1,2 okay |
2,1 real wide | 2,2 |
table
defines the overall table, tr
each row, and td
each cell's data<th>
,
<caption>
<table> <caption>My important data</caption> <tr><th>Column 1</th><th>Column 2</th></tr> <tr><td>1,1</td><td>1,2 okay</td></tr> <tr><td>2,1 real wide</td><td>2,2</td></tr> </table>
Column 1 | Column 2 |
---|---|
1,1 | 1,2 okay |
2,1 real wide | 2,2 |
th
cells in a row are considered headers; by default, they appear boldcaption
at the start of the table labels its meaning<p> <a href="http://validator.w3.org/check/referer"> <img src="http://validator.w3.org/images/valid_icons/valid-xhtml10g" alt="Validate" /> </a> </p>
rel="..."
, itemscope
, itemtype
, itemprop
<a href="video.avi">My video</a>
<video src="video.ogv" width="425" height="350"></video>
<object>
<object data="video.avi" type="video/avi"></object>
<param>
<object id="slider1" width="100" height="50"> <param name="BorderStyle" value="thick" /> <param name="MousePointer" value="hourglass" /> <param name="Enabled" value="true" /> <param name="Min" value="0" /> <param name="Max" value="10" /> </object>
name
and value
attributes tell the object what parameter this is and what value it should have<object width="width" height="height" type="application/x-shockwave-flash" data="videoURL"> <param name="wmode" value="transparent" /> parameters </object>
<object width="425" height="350" type="application/x-shockwave-flash" data="http://www.youtube.com/v/eKgPY1adc0A"> <param name="wmode" value="transparent" /> </object>