Wednesday, February 20, 2008

HTML code examples

HTML Line Breaks
Use the <br /> tag if you want a line break (a new line) without starting a new paragraph.
Even if <br> works in all browsers, writing <br /> instead is more future proof.

Mailto Links
<a href="">Mailto Test Without Subject </a>
Mailto Test Without Subject
<a href=" Mailto Links">Mailto Test With Subject </a>
Mailto Test With Subject

Code Box as in forums
<p style="border:2px inset;width:300px"></p>

Create tables
<table border="1">
<tr><th align="center"> Bold Heading</th><th align="center">Bold Heading</th></tr>
<tr align="center">
<tr align="center">

Bold HeadingBold Heading

Combine Rows
Bold HeadingBold Heading
Combined (1,1) & (2,1)(1,2)

Combine Columns
Bold HeadingBold Heading
Combined (1,1) & (1,2)

Hyperlink to open in a new window/tab
<a href="" target="_blank"></a>

Insert Images
To insert images from image hosting sites use the "direct link to image" and the following code
<img src="" />

In a table, add a non-breaking space (&nbsp;) to empty data cells, to make the borders visible
To display HTML code in an HTML document, replace the (<) with (&lt;) (less than) and (>) with (&gt;) (greater than).
If you want to display <>,replace only one of the symbols with corresponding (&lt;) or (&gt;)
To display (&) ampersand in an HTML document use (&amp;).


No comments:

Post a Comment