Useful HTML Code Snippets: Difference between revisions

From Free Knowledge Base- The DUCK Project
Jump to navigation Jump to search
New page: == Eliminate margins on web page == MSIE has one method, and Netscape has another. This will cover both standards. <BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 ... &nbsp...
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 3: Line 3:


  <BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 ...
  <BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 ...
&nbsp;
== A working NoCache hack ==
Tell browser not to cache web page you are visiting.  Simply placing the line:
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
in the HTML page HEAD is unreliable.  Browsers are buggy and may ignore the directive.  Use the following two part method, which involves placing 2 lines in the page HEAD and four lines at the end before the final HTML tag.
Place this at the top between the <HEAD></HEAD> tags:
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Expires" CONTENT="-1">
Please this pseudo head tag set at the bottom after then closing </body> tag and before the closing </HTML> tag:
  <HEAD>
  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  <META HTTP-EQUIV="Expires" CONTENT="-1">
  </HEAD>
And to resolve a final Netscape bug, use this Javascript in the body tag:
  onLoad="if ('Navigator' == navigator.appName) document.forms[0].reset();"


&nbsp;
&nbsp;
Line 9: Line 33:


[[Category:Computer_Technology]]
[[Category:Computer_Technology]]
[[Category:Programming]]
[[Category:Webdev]]
[[Category:HTML]]
[[Category:HTML]]

Latest revision as of 09:15, 13 February 2015

Eliminate margins on web page

MSIE has one method, and Netscape has another. This will cover both standards.

<BODY topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 ...

 

A working NoCache hack

Tell browser not to cache web page you are visiting. Simply placing the line:

 <META HTTP-EQUIV="Pragma" CONTENT="no-cache">

in the HTML page HEAD is unreliable. Browsers are buggy and may ignore the directive. Use the following two part method, which involves placing 2 lines in the page HEAD and four lines at the end before the final HTML tag.

Place this at the top between the <HEAD></HEAD> tags:

 <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
 <META HTTP-EQUIV="Expires" CONTENT="-1">

Please this pseudo head tag set at the bottom after then closing </body> tag and before the closing </HTML> tag:

 <HEAD>
 <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
 <META HTTP-EQUIV="Expires" CONTENT="-1">
 </HEAD>

And to resolve a final Netscape bug, use this Javascript in the body tag:

 onLoad="if ('Navigator' == navigator.appName) document.forms[0].reset();"