Code Snippets Submitted by Tom Hanks

Absolute Center (Vertical & Horizontal) an Image

Add Non-Breaking Space on Title to Prevent Widows

22 January, 2011   

This will work in any browser on any element, to support styling changes on hover.

21 January, 2011   

Sometimes the time set on your server isn't accurate to what your local time is. If you can't change it, you can adjust it yourself. If your server thought it was 12 midnight, but it was really 7 pm, this will roll the $today variable back five hours to be correct.

22 January, 2011   

The example here is if you had a form on a website that when submitted, needed to use that information to go to a special URL where the login information was all appeneded to the URL. You could have the form post with method GET, but that is limited to the typical ?variable=foo&variable2=bar format.

Append Non-Breaking Space Between Last Two Words

02 February, 2011   

Basic Alert

02 February, 2011   

The set height and width ensure only a portion of the sprite.png graphic is shown. The rollover shifts the position of the background image, revealing a different area of the graphic.

08 February, 2011   

Empty Table Markup

08 February, 2011   

Example Form Markup

Hides iframe until fully loaded.

16 February, 2011   

HTML5 Article Structure with hNews