Welcome to Code Couch

Monthly archive for October 2008

  • How do you vertically centre content using CSS?

    Find out how to do vertical centring (vertical alignment) of content using just CSS (and some div elements).

  • Problems tabbing through checkboxes and radios in MacOSX Safari

    Many people find it easier to use the tab key to cycle through the various fields of a form in a web page. If you are using a browser in MacOSX, you will find that you cannot use the tab key to access checkboxes or radio buttons... instead you have to use the mouse/trackpad. Read on for a solution.

  • Problems with anchors and alpha transparency filters in IE6

    If you use the Microsoft filter CSS property to allow support for an alpha transparent PNG on an element, any links directly within that element are not clickable (in Internet Explorer 6 only). The problem is explained and a solution put forward that will make your links clickable again.

  • How to create rollovers without using Javascript

    Using just CSS, you can do simple (and more complex) rollovers... no javascript required. This post shows how to apply this technique to your own pages with ease - whether it's a colour change or a more complex image swap.

  • Fixing a disappearing caret in Firefox

    The disappearing caret issue in Firefox is very annoying. There are many variations of this bug, most with fixes or workarounds. This fix is for the case where input elements on top of a fixed element do not have a caret.

  • Enabling cross-site scripting XSS via an iframe

    Communication from an iframe that has content from a domain other than the one the iframe is contained within is a constant source of frustration - as browsers prevent this kind of activity due to built-in security policies. Here is a technique to perform cross-site scripting (XSS) in just such an environment with example code and a real-world example.

  • How to use “clearfix” CSS to clear floats without markup

    Here we extended the normal rules for clearfix and provide a complete CSS solution to clearing floated elements (ensuring that a parent element inherits it's floated child element's height). A complete clearfix redux.

  • ReferenceError: console is not defined

    If you have recently upgraded to the free Firefox extension Firebug 1.2 - then you may have experienced some difficulties with console.log throwing the following: ReferenceError: console is not defined. Read on for an explaination...

  • Using AJAX to update the time on a web page from the server

    In an attempt to better explain how you can use AJAX to fetch some data from the server and display it on the web page, I have provided a self contained PHP file.