Basic html

Introduction to html
html stands for Hyper-Text-Markup-Language.

html "tags" are written commands to a computer to perform certain functions. For basic documents you will need very few commands, for example:

  • a line break
  • aligning text
  • starting and ending paragraphs
  • justification
  • font commands such as bold, underline, and font size

In the absence of word processing programs, your computer simply would not know what to do and your text would continue endlessly. So, we must give it the commands that will make your document appear in the format you want.


Basic html Tags
Unfortunately, now that we are just getting the "hang" of html, the W3C (World Wide Web Consortium) has started to deprecate (remove and/or replace) some of the html tags in favor of CSS (cascading style sheets). In addition every tag <> must be closed </>. This means that eventually browsers will not recognize some of the html tags.  However, it will be a very long time (if ever) before the deprecated tags are not recognized so at this time it is not a major concern.

To add to the confusion, some things are browser sensitive (usually because they were developed by another browser) so it is important to know what will work in your browser. For example, neat things like marquees, color codes for horizontal rules or table borders, and music may not work in all browsers.

  • <center> to center your text or images on the page. Deprecated. <p align="center"> is replacing <center>.
  • <p align="left"> to align your text or images to the left. "right" is substituted to align to the right. "center" can also be indicated with this tag.
  • <p align="justify"> to full justify your text.
  • <br> to force a line break.
  • <p> to start a new paragraph.
  • <i> for italics. Deprecated. <em> is replacing.
  • <b>to bold your text.  Deprecated. <strong> is replacing <b>.
  • <u> to underline your text. (Deprecated) Underlining text or headings for emphasis should be avoided as most web surfers now recognize underlining as being a link. Use bold or italics instead.
  • <big> to increase the font size. To increase the size even more add another tag as in <big><big>. (Deprecated. Font size and weight are replacing <big>.
  • <hr> to add a horizontal rule.
 
Upper and Lower Case
 
Tags are not case sensitive so either caps or small letters can be used. However, since all browsers do not react the same way, it is good practice to use small letters.
 
Blank Spaces
 
html does not recognize space. For instance, if you type in your html code: Hello.                                    My name is Jumpy, it will still show on the page like this: Hello. My name is Jumpy.

Using Tags
A tag is started by putting <> around it and closed by putting </> around it.

Several tags can be used together. It does not matter what order you put the tags in but, when closing, the first tag used is the last tag closed. For example, if we want to center the text, and underline it, we would use:

<center><u> Hello, my name is Jumpy. </u></center>
The text would look like this.

Hello, my name is Jumpy.

If we wanted to make the sentence bold and two times larger we would add.

<center><u><b><big><big>Hello, my name is Jumpy
</big></big></b></u></center>
The text would look like this.

Hello, my name is Jumpy.


Adding Images/Alignment
To add an image to your page and center it, the code is:

<center> <img src="image from your browser"> </center>
Your image will look like this.

To add two images side by side the code is:
<center> <img src="image from your browser"> <img src="image from your browser"> </center> Your images will look like this.

To align your image to the left (or right) the code is:

<p align="left" (or)"right"> <img src="image from your browser">
Your image will look like this.

 

Adding Music
The code for adding music to your page is:

<bgsound src="http://music from your browser.wav"></bgsound>

If you want the music to play over and over add:

<bgsound src="http://music from your browser.wav" loop=infinite></bgsound>

Note though that playing music is risky. Firstly, although you might like the music - not everyone has your taste and may "click off" because of it. Secondly, playing the same song over and over can get annoying. Your viewer does have the option of turning off his sound but you again run the risk of them just leaving your page because of it.


No comments:

Post a Comment