HTML codes
Links
Carin's web page
Webmaster
Copyright © 2018,
Carin Olofsson
Last updated:
November 6, 2019
|
|
After the examples I have included how to write the HTML-code.
If you do not want to type the code yourself, then you can copy it from this page. Mark the text with the codes by pressing the left mouse button and pull the mouse over the text you want to copy. Then press Ctrl-C to copy the text. Open Notepad or WordPad and press Ctrl-V to paste the text.
To see how the code in a document is written, choose View Document source (or View Frame source if the document has frames) if you are using Netscape. Choose View Source if you are using Internet Explorer. You can also save the document as an HTML-document and open it in a text editor (Notepad or WordPad for example).
If you want to make a note for yourself on your page, you use the following code:
<!--This is a comment-->
The text cannot be seen on the page, but you can read it in the code. Helpful if you want to comment on the different sections of your page.
This is how you "name" the different areas in your document in order to easily move beteween the sections in the document.
Start by giving a section a name. This will create a link to the section somewhere else in the text (but still on the same page).
This is how you name areas in your document
Code: <A HREF="#nameing">This is how you name areas in your document</A>
Then you have to state where the section begins.
Naming areas in your document
Code: <A NAME="naming">Naming areas in your document</A>
This is bold text and this is in italics
Code: <B>bold</B> and <I>italics</I>
This is citation.
Code: <CITE>citation</CITE>
This is emphasis.
Code: <EM>emphasis</EM>
This is strong emphasis.
Code: <STRONG>strong emphasis</STRONG>
A few different methods to make margins:
By using "BLOCKQUOTE" you get both right and left margins. This is to make the paragraphs easier to read.
Code: <BLOCKQUOTE>This is where the text should be.</BLOCKQUOTE>
By using "UL", without "LI", you also get margins, however, only left margins. You can write very long texts this way.
Code: <UL>This is where the text should be.</UL>
Finally, you can use "TABLE" and set BORDER=0. Choose the width of the left margin by setting an optional number for "CELLSPACING", for instance, here I have used CELLSPACING=30. The disadvantage in using TABLE is that the page takes longer to load. In addition to that, there will also be a large space before and after the table. The higher the number you use for CELLSPACING the larger space you get.
Code: <TABLE BORDER=0 CELLSPACING=30><TR>
<TD ALIGN="LEFT">This is where the text should be.
</TD></TR></TABLE>
|
This is an example of a menu list (more compact than ordinary lists):
My favourite cats
Code:
<MENU COMPACT>
<LI>Text</LI>
<LI>Etc...</LI>
</MENU>
This is an example of an unordered list:
The advantage of unordered lists
- You can add as many items as you need.
- You can add the items in any order you like.
- The text can be short.
- Or the text can be so long that it is several rows long and then there is a risk that the reader gets fed up and chooses to go to another page instead. Therefore it is probably best to keep it short when writing lists.
- ... you can add items later.
Code:
<UL>
<LI>Text</LI>
<LI>Etc...</LI>
</UL>
This is an example of an ordered list:
My three favourite cats
- European
- Norwegian forest
- Maine coon
Code:
<OL>
<LI>Text</LI>
<LI>Etc...</LI>
</OL>
This is how you include a sound file to your page:
|
|