Single line HTML

Web programming topics
Post Reply
Tony
Lieutenant
Lieutenant
Posts: 86
Joined: Tue Jul 21, 2009 4:11 pm

Single line HTML

Post by Tony » Sun Nov 29, 2009 5:13 am

You can easily create a scrollable text box with this one line <div> tag. You can put anything inside the scrollable area. This is a very simple one line alternative to the iframe.

Code: Select all

<div style="padding: 20px; overflow: auto; border: solid 1px black; width: 400px; height: 300px;"> 
Content goes here
<div >  
Use this line to pre-load those mouseover images to avoid browser delay:

Code: Select all

<img src="image.gif" alt="" style="display: none;">  
Get rid of the IE image toolbar with this one line in the <head> section of your html:

Code: Select all

<meta http-equiv="imagetoolbar" content="no">  
Disable the "right click" with the oncontextmenu parameter in your body tag (this parameter is not W3C standards compliant but it works with most browsers):

Code: Select all

<body oncontextmenu="return false">  
Disable autocomplete on any input field with the autocomplete parameter in your input tag:

Code: Select all

<input . . . autocomplete="off">  
You can tell search robots to index your main page and go no further with this one line in the <head> section of your html:

Code: Select all

<meta name="ROBOTS" content="INDEX,NOFOLLOW">  
You can do a simple redirect to another page by putting this one line in the <head> section of your html.
The zero is how many seconds to wait before doing the redirect.

Code: Select all

<meta http-equiv="refresh" content="0;URL=http://yourdomain.com/anypage.htm">  
You can force a page refresh (to keep your content current) putting this one line in the <head> section of your html.
The 300 is how many seconds to wait before doing the refresh.

Code: Select all

<meta http-equiv="refresh" content="300"> 
If your page does not need to scroll, in IE may still show the browser gutter (placeholder for the scrollbar).
Get rid of it with this one CSS line:

Code: Select all

html {overflow:auto;} 
Post Reply

Return to “Web programming”