Home > Technical > Play With HTML

Play With HTML

Hi friends, here I am posting some HTML tips, which can be useful at the time of designing the web page.

1- How to change background colors on mouseover?
Ans:
Use this code in <TR> or <TD> tag of HTML table.

onMouseover=”this.bgColor=’#EFEFEF'”onMouseout=”this.bgColor=’#FEFEFE'”

2- How to embed web pages within web pages?

Ans:
Put this code to embed the web page within the web page:

<object data=http://www.example.com width=”800″ height=”600″> <embed src=http://www.example.com width=”800″ height=”600″> </embed> Error: Embedded page could not be displayed. </object>

3- How to make an auto fill email subject and body?

Ans:
This code will make a email link auto fill of email, subject and the body on clicking.

<a href=”mailto:yourmail@yourdomain.com?subject=Your Subject&body=Cotent of the body”>yourmail@yourdomain.com</a>

4- How to open a new window on page unload?
Ans:
This code will open a new page mentioned at the time of unloading of the page.
<body onUnload=window.open(‘http://www.example.com&#8217;); self.blur();>

5- How to make spaces between images?

Ans:

<IMG src=”yourimage.jpg” hspace=10 vspace=10 WIDTH=”96″ HEIGHT=”134″ BORDER=”0″><IMG src=”yourimage.jpg” hspace=5 vspace=5 WIDTH=”96″ HEIGHT=”134″ BORDER=”0″>

6- How to protect your email address from spam robots?
Ans:

<A href=”mailto:you@yourdomain.com”>Contact Us</A>
When your email link is clicked on, it will display your email address correctly.

7- How to open a web page in a new window?
Ans:
The following HTML code will enable you to open all of your links in a new window. Place this code between your <HEAD> and </HEAD> tags within your HTML:

<base target=”main”>

8- How to redirect visitors to another page?
Ans:
Use the following HTML redirect code between the <HEAD> and </HEAD> tags of your HTML code.

<meta HTTP-EQUIV=”REFRESH” content=”0; url=http://www.example.com/index.html”>

The content=”0; may be changed to the number of seconds you want the browser to wait before redirecting.

9- How to remove link underline?
Ans:
To remove a link underline, add STYLE=”TEXT-DECORATION: NONE” to your link code:

<A href=”http://www.example.com&#8221; STYLE=”TEXT-DECORATION: NONE”>Your Link</A>

10- How to prevent your web page to be cached by the browser?
Ans:
You can prevent browser cache simply by including a special META tag within your HTML code.

Add the following code between the <HEAD> and </HEAD> tags of your HTML.

<META http-equiv=”Pragma” content=”no-cache”>

11- How to prevent indexing of your web page by search engine?
Ans:
Many times, you may have a web page that you don’t want the Search Engines to index. To help with this problem, add one of the following META tag codes between the <HEAD> and </HEAD> tags of your HTML.

The following META tag tells the Search Engine robots not to index this page and not to follow any links within the page:

<META NAME=”ROBOTS” CONTENT=”NOINDEX,NOFOLLOW”>

The following META tag tells the Search Engine robots not to index this page, but follow any links within the page:

<META NAME=”ROBOTS” CONTENT=”NOINDEX,FOLLOW”>

Hope you had a good time with playing with HTML.

Advertisements
Categories: Technical
  1. Prawin
    June 26, 2007 at 7:18 am

    Thnx…nice tips….

  2. Amit
    January 29, 2013 at 11:11 am

    helpful blog !!

    appreciate it 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: