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:staraphd@gmail.com">Mailto Test Without Subject </a>
Mailto Test Without Subject
<a href="mailto:staraphd@gmail.com?subject=Testing Mailto Links">Mailto Test With Subject </a>
Mailto Test With Subject

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

www.smashitsusa.com

Create tables
<table border="1">
<tr><th align="center"> Bold Heading</th><th align="center">Bold Heading</th></tr>
<tr align="center">
<td>(1,1)</td><td>(1,2)</td></tr>
<tr align="center">
<td>(2,1)</td><td>(2,2)</td></tr></table>

Bold HeadingBold Heading
(1,1)(1,2)
(2,1)(2,2)

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

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

Hyperlink to open in a new window/tab
<a href="http://www.staraphd.blogspot.com" target="_blank">http://www.staraphd.blogspot.com</a>
http://www.staraphd.blogspot.com

Insert Images
To insert images from image hosting sites use the "direct link to image" and the following code
<img src="http://img161.imageshack.us/img161/1501/xpaudiocontrollersettinpb8.jpg" />

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;).

References:
http://www.w3schools.com

No comments:

Post a Comment