This lecture notes is based on Prof Doreen De Leon's lectures.
<p> tag signals the start of a paragraph.align
left, right,
center
<?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>p</title></head>
<body>
<p>The following paragraph is copied from CNN </p>
<p>LA CONCHITA, California (CNN) -- Three people were killed and up to 12
other people were feared trapped beneath a mound of mud and debris late
Monday after a massive mudslide crashed down on this coastal community
northwest of Los Angeles, crushing several homes.</p>
</body>
</html>
|
|
The following paragraph is copied from CNN LA CONCHITA, California (CNN) -- Three people were killed and up to 12 other people were feared trapped beneath a mound of mud and debris late Monday after a massive mudslide crashed down on this coastal community northwest of Los Angeles, crushing several homes. |
<br /> tag.
<?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>Test</title></head>
<body>
<p>
This is line 1<br />
This is line 2<br />
This is line 3<br /><br />
The above is a blank line <br />
</p>
</body>
</html>
|
|
This is line 1 |
<h1>, <h2>, <h3>,
<h4>, <h5>, and
<h6>.<h1>) to lowest
(<h6>) precedence a heading may have.<h1> is used for the title of the
document (to be displayed), <h2> is used for
section titles, etc.<h1>, <h2>,
<h3> -- larger than text <h4> --same size as text <h5>, <h6> --smaller than
text
<?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>Heading test</title></head>
<body>
<h1>Biggest</h1>
<h2>Bigger</h2>
<h3>Big</h3>
<h4>Normal</h4>
<h5>Small</h5>
<h6>Smaller</h6>
</body>
</html>
|
BiggestBiggerBigNormalSmallSmaller |
<?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>Heading test</title></head>
<body>
<h1>PIC40A</h1>
<p>The class is a basic introduction to PIC40A</p>
<h2>Week 1</h2>
<p>Basic html</p>
<h2>Week 2</h2>
<p>Perl</p>
</body>
</html>
|
PIC40AThe class is a basic introduction to PIC40A Week 1Basic html Week 2Perl |
<blockquote> tag
<?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>Heading test</title></head>
<body>
<h1>Famous Quotes</h1>
<p>Albert Einstein (1879 - 1955)</p>
<blockquote>
<p>The most incomprehensible thing about
the world is that it is at all comprehensible.</p>
</blockquote>
</body>
</html>
|
Famous QuotesAlbert Einstein (1879 - 1955)
|
<code> --Rendered in monotype (like Courier).
Used to present segments of source code.++a*2; gives a
different result than a++*2;.<em> --Tells browser to print enclosed text
with emphasis. Generally rendered in italics.<strong> --Emphasizes text, stronger than
<em>. Rendered in bold.<b> --bold<i> --italic<big> --renders the text one font size larger
than the surrounding text<small> --decrease size of text one font
size<sub> --displays half a character's height
lower, same font size<sup> --displays half a character's height
higher, same font size<tt> --direct browser to display enclosed text
in monospaced typeface<big>, <small> can be nested to grow or
shrink text more than one level<font> tag
size attribute: value is either 1-7 or
preceded by + or - to define a relative font size that the
browser adds to or subtracts from the base font size.
Browser automatically rounds to 1 or 7 if the value exceeds
either boundary.<font size="+2">Help me!</font>
is rendered as: Help me!face attribute: lets you choose the font style
color attribute: sets color of enclosed text.
| aqua (#00FFFF) | navy (#000080) |
| black (#000000) | olive (#808000) |
| blue (#0000FF) | purple (#800080) |
| fuchsia (#FF00FF) | red (#FF0000) |
| gray (#808080) | silver (#C0C0C0) |
| green (#008000) | teal (#008080) |
| lime (#00FF00) | yellow (#FFFF00) |
| maroon (#800000) | white (#FFFFFF) |
<?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>Text test</title></head>
<body>
<p>
<font color="red">Red</font>
</p>
<p>
<font size="+2" color="green">Big green</font>
</p>
<p>
<font size="-1" color="#CC12BB">Color with RGB CC12BB</font>
</p>
</body>
</html>
|
|
Red Big green Color with RGB CC12BB |
| Character | Character entity |
| & | & |
| < | < |
| > | > |
| ° | ° |
| © | © |
<?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>Special characters</title></head>
<body>
<p>
You can use <br /> to create a line break.
</p>
</body>
</html>
|
|
You can use <br /> to create a line break. |
<hr /> tag
width
attribute --specify a number (representing width in pixels) or
a percentage (indicates portion of screen width the rule will
occupy); deprecated, but we will use until we discuss
Cascading Style Sheetssize
attribute.align
attribute (at least until we discuss
Cascading Style Sheets).<pre> Tag<,
>,&
(>, <,
&).
<?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>pre test</title></head>
<body>
<pre>
This is
a test.
</pre>
<p>
This is
a test.
</p>
</body>
</html>
|
This is a test. This is a test. |
<?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>pre test</title></head>
<body>
<pre> #include <iostream>
using namespace std;
int main() {
cout << "Hello world!\n";
return 0;
}</pre>
</body>
</html>
|
#include <iostream>
using namespace std;
int main() {
cout << "Hello world!\n";
return 0;
}
|
Here is a more advanced web page.