"The important thing is not to stop questioning. Curiosity has its own reason for existing. One cannot help but be in awe when he contemplates the mysteries of eternity, of life, of the marvelous structure of reality. It is enough if one tries merely to comprehend a little of this mystery every day. Never lose a holy curiosity."
Albert Einstein
The purpose of this web page is to demonstrate, in a complete web page, some of the aspects of HTML discussed thus far.
Here is a short paragraph that is right-justified. The right-justification is valid only for the duration of this paragraph.
Of course, I could also center my paragraph, but that looks a bit silly. I mean, who wants to read a document with centered paragraphs? The lines look ridiculous. Don't you agree?
Although the use of the <font> tag is deprecated, it
is used by web authors quite frequently.
This tag, when used with its attributes, is very handy.
For example, you can
change the color and font type of a single sentence, a portion of a
sentence, or even a paragraph.
In this case, the color is purple and the font is Comic Sans Ms.
If the browser does not like your choice of font type, which is denoted
using the face attribute, it will display the text in the
default font. In addition, the <font> tag
can be used as an alternative to <big> and
<small> to change the size of the font.
This is not really a big deal, though.
By just nesting the <big> tag
three times we can get the same result.
Just don't forget to put the end tag(s)!
When we learn about styles, we will see how the
<font> tag can be used to do even more, including
changing the "weight" of a text.
You can create your own line breaks, as well. This may be good for poetry.
For example, if I want to display a short poem in italics, I might write:
Roses are red,
Violets are blue,
Sugar is sweet,
And so are you!
Now, suppose I want to include a segment of code in my HTML web page.
I might do this if I am writing some instructions on programming in
some language. I can do this using the <code> tag,
which is useful for shorter segments, or the <pre> tag.
The nice things about the <pre> tag are that
you don't need to use line breaks and all whitespace is displayed as typed.
For example, using the <pre> tag I can display a segment
of C++ code for determining the power of a number.
#include <iostream>
using namespace std;
int main()
{
int n;
double x, pow;
cout << "Enter a number (x), and the power you want x raised to: ";
cin >> x >> n;
pow = x;
for (int i = 2; i <= n; i++)
pow *= x;
cout << x << "^" << n << " = " << pow
<< endl;
return 0;
}
I hope you have enjoyed this short web page displaying just some of the many aspects of HTML that we have discussed. Until next time, bye!