|
|
| |
What is HTML?
|
|
| |
| |
Introduction to HTML
HTML is the language of the Internet. It defines the structure and layout of a Web document
as well as what links to other pages or web sites are available. There are a great number
of tags and attributes that may be used in an HTML page, if you'd like to see a list then
click here.
See the two examples below for a very simple sample of HTML:
Example 1 - HTML Hello World
<HTML>
<BODY>
Hello, World!
</BODY>
</HTML>
|
| |
In a browser, this would appear as:
|
Now see what happens if we add a bit of 'Style' using something called CSS (cascading
style sheets).
Example 2 - HTML with Style
<HTML>
<HEAD>
<STYLE> .hi_style { font-family:Arial, Helvetica, sans-serif;
font-size:18px;
color: #FF0000;
}
</STYLE>
</HEAD>
<BODY>
<span class="hi_style">Hello, World!</span>
</BODY>
</HTML> |
| |
In a browser, this would appear as:
|
A few points to note about this example:
- There is now a <HEAD> tag which contains a <STYLE> tag
- The <STYLE> tag which allows us to easliy change the appearance of the page.
While this may not seem very powerful, it is. The old way of changing a font would
be to use a <font> tag, which is embedded within the page along with the text. If a font needed to be changed, the developer
would have to change it in every page on the site.
If we use CSS, we would store
all of the 'styles' in an external file to be included by each page. When a font change
is needed, the developer would only need to change the one file, an all pages would
automatically have the new font!
|
|
|
 |
|
|