CODE

Great Resource


http://css-tricks.com/
http://css-tricks.com/what-beautiful-html-code-looks-like/






REFRESHING BACKGROUNDS

To get an alternating background, there is a very simple Java Script Code that you can use.
 The code is the following:

<script type="text/javascript">
var banner= new Array()
banner[0]="images/background1.jpg"
banner[1]="images/background2.jpg"
banner[2]="images/background3.jpg"
banner[3]="images/background4.jpg"
banner[4]="images/background5.jpg"
banner[5]="images/background6.jpg"
var random=Math.floor(ENTER NUMBER OF BACKGROUNDS HERE*Math.random());
document.write("<style>");
document.write("body {");
document.write(' background:url("' + banner[random] + '") repeat center center fixed;');
document.write(" }");
document.write("</style>");
</script>

Despite the fact that it says there are 5 background, there are actually 6 due to the banner[0] which counts as one. This is because JAVA scripts most of the time start at 0.
Where it says "ENTER NUMBER OF BACKGROUNDS HERE" you would place the number of backgrounds, which is in this code, 6, not 5. You can have unlimited number of backgrounds on this code, but you do need to edit that number.

This code goes right below your opening body tag.

MAKING HTML PAGES PASSWORD PROTECTED

To make a page password protected, you can use a very simple javascript code. Here is the code.

<script>
var p=confirm("This page is password protected")
if(p){
var ans="PASSWORD HERE"
var pass=prompt("Password?")
if(pass!==ans)
{
alert("Incorrect!")
window.location="redirect link here"
}else{alert("Correct");}
}else{window.location="redirect link here"}

</script>

To use this code, put this into your header and replace the password you want to use in the PASSWORD HERE section. The password will be password protected and the code does not work as well in Internet Explorer unless you can activate Active Scripting.  If Internet explorer has not already enabled this, you can do this manually. In IE, you can go to Tools > Internet Options > Securtity Tab > Custom Level > Then under "Allow websites to prompt for information using scripted windows" Click *ENABLE*, not prompt. If you do use this script, be sure tell your website viewers about this code as if you enable it on your own computer, it will NOT be enabled on all the viewers computers.


SITE ICON IN BROWSER TAB


Have you ever wondered why some sites have little icons in the url bar or tab next to their title? Well the code for it is surprisingly simple. Under the <title> tag in the header, use this simple code.

<LINK REL="SHORTCUT ICON" href="/imagelinkhere">

The code is pretty self explanatory, there is no end tag and all you have to edit is the image link tag.
Your image can be any size but will be made to fit a 10 px by 10 px, no matter what its dimensions were before.