Archive for February, 2012

CSS Fix background-position Property

How to position a background-image as fix:

css:

body{
background-image:url('bg.gif');
background-repeat:no-repeat;
background-attachment:fixed;
}

Leave a comment

Automatically Putting the Cursor in a Field when its load

This page demonstrates a technique for automatically putting the cursor into an input field as soon the page is loaded.
Let’s suppose you want the user to go directly to the following form. Notice that we set the names for the form and the field.

<FORM NAME="MyForm" ACTION="action.html">
name: <INPUT NAME="realname"><BR>
email: <INPUT NAME="email"><BR>
</FORM>

We can set the focus immediately by adding an onLoad attribute to the tag. Notice that the word focus must be followed by open and close parentheses: ():

<BODY onLoad="document.forms.MyForm.realname.focus()">

source: http://www.htmlcodetutorial.com

Leave a comment

CSS3 box-shadow

Add a box-shadow to a div element.
The box-shadow property is supported in IE9+, Firefox 4, Chrome, Opera, and Safari 5.1.1.

css:

#div-shadow{
width:300px;
height:100px;
background-color:#ffffff;
box-shadow: 0px 0px 5px #888888;
}

Leave a comment

Design a site like this with WordPress.com
Get started