Java Reference
In-Depth Information
Introduction to HTML (continued)
The <body> tag contains the content of the Web page. Common tags in the body of a
page include:
<p>. The paragraph tag.
<hx>. The heading tag. Possible values of x and 1-6. For example, <h1> is the
heading 1 tag, which creates a large heading. <h6> is the smallest heading.
<center>. For centering items.
<img src=” url ”>. Displays the image at the specified URL.
<font face=” font_name ” size=”size” color=” #color ”>.
Displays the nested
text with the given font, size, and color.
<a href=” url ”>. The anchor tag; it creates a hyperlink to some other URL.
<applet>. Embeds an applet in the HTML document.
<table>. For creating a table. Nest <tr> within <table> to create a table row, and
nest <td> within <tr> to create columns for the table data.
The following HTML displays the HelloSwingApplet and demonstrates the use of some of
the other HTML tags. Study the HTML, and see if you can determine how the page will look.
<html>
<head>
<title>An Introduction to HTML</title>
</head>
<body>
<h2>The HelloSwingApplet</h2>
<p>This applet demonstrates using the JApplet class.</p>
<center>
<table border=”1”>
<tr><td>
<applet code=”HelloSwingApplet”
width=”250”
height=”250”>
</applet>
</tr></td>
<tr><td>
<p><font size=”-1” color=”#B21445”>
Move the mouse around the area above
</font></p>
</td></tr>
</table>
</center>
<br>
<p><a href=”HelloSwingApplet.java”>Click here</a>
to view the source code.</p>
</body>
</html>
Search WWH ::




Custom Search