På svenska

HTML codes
Links

Carin's web page


Webmaster
Copyright © 2018,
Carin Olofsson

Last updated:
November 6, 2019
 

Content


Introduction

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.

To Content

Naming areas in your document

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>
To Content

Different text formats

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>

To Content

Margins

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>
To Content

Menu list

This is an example of a menu list (more compact than ordinary lists):

My favourite cats

  • European
  • Norwegian forest
  • Maine coon
  • ...etc.
  • Code: <MENU COMPACT>
    <LI>Text</LI>
    <LI>Etc...</LI>
    </MENU>
    To Content

    Unordered list

    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>
    To Content

    Ordered list

    This is an example of an ordered list:

    My three favourite cats

    1. European
    2. Norwegian forest
    3. Maine coon
    Code: <OL>
    <LI>Text</LI>
    <LI>Etc...</LI>
    </OL>
    To Content

    Sound

    This is how you include a sound file to your page:



    Code: <EMBED SRC="sound.wav" AUTOSTART="false" WIDTH="146" HEIGHT="60" LOOP="false">

    If you want the music to start playing when the page is loaded, change Autostart from false to true.
    If you want the music to continue playing, change Loop to true.
    If you want the music to be repeated for example 5 times and then stop playing, change Loop to 5.
    If you want to hide the player, change Width and Height to 0.

    To Content

    Different font formats

    This text is red.
    This text is also red.
    Code: <FONT COLOR=#FF0000>This text is red.</FONT>
    <FONT COLOR=RED>This text is also red.</FONT>

    This text will be either Comic Sans MS, Arial or Times New Roman, depending on which fonts are installed on your computer. (This does not work with all browsers).
    Code: <FONT FACE="Comic Sans MS,Arial,Times New Roman">Here you type your text.</FONT>

    This text is the colour FF0000
    Code: <FONT COLOR=#FF0000>This text is the colour FF0000</FONT>
    This text is the colour 000000
    This text is the colour C0C0C0
    This text is the colour FFFFFF
    This text is the colour 00FF00
    This text is the colour 0000FF
    This text is the colour FFFF00
    This text is the colour F0F0F0
    This text is the colour CCC000
    This text is the colour CC0000
    This text is the colour 00CC00
    This text is the colour AAA000
    This text is the colour AA0000
    This text is the colour 00AA00
    This text is the colour 0000AA
    This text is the colour 99FFFF
    This text is the colour FFFFCC
    This text is the colour 6633FF
    This text is the colour CC3333
    This text is the colour 8E2323
    This text is the colour 0085FF
    This text is the colour FF77AA
    To Content

    Tables

    A table can look like this:

    Left column with a little longer text


    Under construction

    Right column with a little longer text

    Left column with a little longer text


    Under construction

    Right column with a little longer text


    Code: <TABLE BORDER=1><TR>
    <TD WIDTH="300">
    <P ALIGN="CENTER"><FONT SIZE="3"><B>Left column with a little longer text</B></FONT></P></TD>
    <TD WIDTH="220">
    <P ALIGN="CENTER"><IMG SRC="undercon.gif" ALIGN="BOTTOM" WIDTH="40" HEIGHT="38"><BR>
    <STRONG>Under construction</STRONG></P></TD>
    <TD WIDTH="220"<
    <P ALIGN="CENTER"><B>Right column with a little longer text</B></P></TD></TR>
    <TR><TD WIDTH="300">
    <P ALIGN="CENTER"><FONT SIZE="3"><B>Left column with a little longer text</B></FONT></P></TD>
    <TD WIDTH="220">
    <P ALIGN="CENTER"><IMG SRC="undercon.gif" ALIGN="BOTTOM" WIDTH="40" HEIGHT="38"><BR>
    <STRONG>Under construction</STRONG></P></TD>
    <TD WIDTH="220">
    <P ALIGN="CENTER"><B>Right column with a little longer text</B></P></TD></TR>
    </TABLE>

    ...or like this:

    Centered text spanning over two columns

    Right adjusted text

    • Lists work in tables too
    • Next row
    • And another row


    Under construction



    Code: <TABLE WIDTH="100%" BORDER=15 CELLPADDING=10 CELLSPACING=20><TR>
    <TD COLSPAN=2 ALIGN="CENTER">
    <FONT SIZE="3"><B>Centered text spanning over two columns</B></FONT></P></TD>
    <TD COLSPAN=1 ALIGN="RIGHT">
    <B>Right adjusted text</B></P></TD></TR>
    <TR><TD COLSPAN=1>
    <UL><LI>Lists work in tables too</LI>
    <LI>Next row</LI></UL></TD>
    <TD COLSPAN=1>
    <UL><LI><A HREF="http://www.otherpage.com/">Link to another web page</A></LI>
    <LI><A HREF="MAILTO: email@tome.com">Send e-mail</A></LI></UL></TD>
    <TD COLSPAN=1>
    <P ALIGN="CENTER"><IMG SRC="undercon.gif" ALIGN="BOTTOM" WIDTH="40" HEIGHT="38"><BR>
    Under construction</P></TD></TR></TABLE>

    To Content

    Family tree

    This is how you make a family tree by using a table:

    Me

    Father

    Mother

    Father's father

    Father's mother

    Mother's father

    Mother's mother

    Father's father's father

    Father's father's mother

    Father's mother's father

    Father's mother's mother

    Mother's father's father

    Mother's father's mother

    Mother's mother's father

    Mother's mother's mother



    Code: <TABLE WIDTH="100%" BORDER=0>
    <TR><TD COLSPAN=8 ALIGN="CENTER">
    <FONT SIZE="3">Me</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD></TR>
    <TR><TD COLSPAN=4 ALIGN="CENTER">
    <FONT SIZE="3">Father</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=4 ALIGN="CENTER">
    <FONT SIZE="3">Mother</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD></TR>
    <TR><TD COLSPAN=2 ALIGN="CENTER">
    <FONT SIZE="3">Father's father</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=2 ALIGN="CENTER">
    <FONT SIZE="3">Father's mother</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=2 ALIGN="CENTER">
    <FONT SIZE="3">Mother's father</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=2 ALIGN="CENTER">
    <FONT SIZE="3">Mother's mother</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD></TR>
    <TR><TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Father's father's father</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Father's father's mother</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Father's mother's father</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Father's mother's mother</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Mother's father's father</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Mother's father's mother</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Mother's mother's father</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD>
    <TD COLSPAN=1 ALIGN="CENTER">
    <FONT SIZE="3">Mother's mother's mother</FONT>
    <P ALIGN="CENTER"><IMG SRC="photo.jpg"</P></TD></TR>
    </TABLE>

    To Content

    Price list

    A price list can look like this:

    Art. IDNamePrice excl VATPrice incl VAT
    Header
    No001
    No002

    New header
    No003
    No004

    Article 123
    Article ABC


    Article 456
    Article DEF

    1,000.00
    700.00


    700.00
    1,000.00

    1,250.00
    875.00


    875.00
    1,250.00


    Code: <TABLE BORDER="5" CELLPADDING="10" CELLSPACING="0"><TR>
    <TH ALIGN="LEFT">Art. ID</TH><TH ALIGN="LEFT">Name</TH><TH ALIGN="LEFT">Price excl VAT</TH><TH ALIGN="LEFT">Price incl VAT</TH></TR>
    <TD VALIGN="TOP">
    Header<BR>
    No001<BR>
    No002<BR><BR>
    New header<BR>
    No003<BR>
    No004<BR></TD>
    <TD VALIGN="TOP"><BR>
    Article 123<BR>
    Article ABC<BR><BR><BR>
    Article 456<BR>
    Article DEF<BR></TD>
    <TD VALIGN="TOP" ALIGN="RIGHT"><BR>
    1,000.00<BR>
    700.00<BR><BR><BR>
    700.00<BR>
    1,000.00<BR></TD>
    <TD VALIGN="TOP" ALIGN="RIGHT"><BR>
    1,250.00<BR>
    875.00<BR><BR><BR>
    875.00<BR>
    1,250.00<BR></TD>
    </TR></TABLE>

    To Content

    Table with background colour

    This is what the price list looks like with background colour added (does not work with all browsers):

    Art. IDNamePrice excl VATPrice incl VAT
    Header
    No001
    No002

    New header
    No003
    No004

    Article 123
    Article ABC


    Article 456
    Article DEF

    1,000.00
    700.00


    700.00
    1,000.00

    1,250.00
    875.00


    875.00
    1,250.00


    Code: <TABLE BORDER="10" CELLPADDING="10" CELLSPACING="0" BGCOLOR=#FF00FF> <TR>
    The rest of the code is exactly the same as in the above exemple.
    To Content

    Pictures

    This is me:

    Text adjusted to the top of the picture

    Code: <A HREF="photo.jpg"><IMG SRC="photo.jpg" BORDER=3 ALIGN="TOP" WIDTH="100" HEIGHT="145"> Text adjusted to the top of the picture</A>

    This is a picture of my cat Frida when she jumps between the kitchen doors:

    Text adjusted to the middle of the picture

    Code: <A HREF="photo.jpg"><IMG SRC="photo.jpg" BORDER=3 ALIGN="MIDDLE" WIDTH="300" HEIGHT="162"> Text adjusted to the middle of the picture</A>

    This is a picture of my cats Frida and Fritte:

    Text adjusted to the bottom of the picture

    Code: <A HREF="photo.jpg"><IMG SRC="photo.jpg" BORDER=3 ALIGN="BOTTOM" WIDTH="251" HEIGHT="119"> Text adjusted to the bottom of the picture</A>
    To Content

    This is how you contact me

    E-mail address
    carin@hembygdshistoria.se

    Web address
    http://www.hembygdshistoria.se/

    Code: <ADDRESS>
    <STRONG>E-mail address</STRONG><BR>
    <A HREF="mailto:email@tome.com">email@tome.com</A><BR><BR>
    <STRONG>Web address</STRONG><BR>
    <A HREF="http://www.mypage.com/">http://www.mypage.com/</A>
    </ADDRESS>

    To the top