<html> <body> <h3>Here is an Exciting JApplet</h3> <p> And what an exciting applet it is. With a width of 300 pixels, and a height of 150 pixels, this applet has it all. </p> <applet code="AnotherHello.class" width="300" height="150"> </applet> </body> </html>
Tags do not have to start in column one as they do in the example, but doing so is often convenient. The following works the same as the above answer:
<html><body> <h3>Here is an Exciting JApplet</h3><p> And what an exciting applet it is. With a width of 300 pixels, and a height of 150 pixels, this applet has it all.</p> <applet code="AnotherHello.class" width="300" height="150"> </applet> </body></html>
The old standards for HTML allowed tags to be upper or lower case. Usually upper case tags will still work, but the recent standard calls for all lower case tags. Here is a list of a few HTML tags. (For more on HTML see Appendix A or search the Web for a more comprehensive tutorial.)
<html> |
mark the START of a "html" file. These should be the FIRST characters in the file. |
</html> |
mark the END of a "html" file. These should be the LAST characters in the file. |
<head> |
mark the start of the head of the file. The head of the file contains descriptions and declarations that are not supposed to be directly visible on the Web page. |
</head> |
mark the end of the head of the file. |
<title> |
give a title to the entire page (the Web browser can use the title for whatever purpose it wishes.) This should be in the head section of the page. |
</title> |
end of the title. |
<body> |
mark the start of the body of the file. The body of the file is the main part that is visible on the monitor screen. |
</body> |
mark the end of the body of the file. |
<hr> |
a horizontal rule: a line completely across the screen. There is no matching tag. |
Here is a larger version of the Web page that uses all these tags:
<html> <head> <title>An Exciting Title</title> </head> <body> <h3>Here is an Exciting JApplet</h3> <p> And what an exciting applet it is. With a width of 300 pixels, and a height of 150 pixels, this applet has it all. </p> <applet code="AnotherHello.class" width="300" height="150"> </applet> <hr> </body> </html>
If you forget to include the match to a tag, you may get
strange results.
For example, if you forget the </h3>
that matches the <h3>
tag,
the rest of the file will be displayed as a heading.
This will look odd.
What do you suppose happens if you forget the match to a
<head>
tag?