Subscribe To RSS Feed


Amber Taylor's SharpBlog

IE Is My Nemisis – Adventures in Hack-land

Archive for February, 2009

iStock’s 503 Error Page

- Tuesday, February 10th, 2009 -

So I was on iStock photo today and came accross this page after thier site was unresponsive. They have my vote for the funniest 503 error page to date. The funniest 404 page I have seen is a little to shocking to share with you on this blog, but I am sure there is another one wait for us out there.

Posted in Error Pages | 1 Comment »

IE Hack – Hide Text on your Submit Buttons

- Sunday, February 1st, 2009 -

A New Way To Style Your Buttons

Recently, I designed a website and I decided to do a unique style on the search field. I added a background image to the input field and then a background image to the submit button. Everything looked great until I viewed it in Internet Destroyer (Internet Explorer). That’s when the sky fell on my head…as usual.

The Issue:

I was not able to hide the text from the button, letting the underlying image to show it’s text. Normally my preferred image replacement technique is to have text in the background image and then use a negative text-indent at a high number like this:

background-image: url('my-picture-with-text.jpg');
text-indent: -9999px;

This works fine with submit buttons on most browsers, except IE.

The fix:

Add 2 extra lines to your css file:

color: transparent;
text-transform: capitalize;

For some reason the text indent doesn’t work by itself in IE, so after adding these 2 lines it works. It is a hack within a hack though, the color:transparent property should work by itself, but it doesn’t. For some odd reason setting the text-transform to anything (in this case I chose capitalize because I don’t use it very often) makes it magically work. Anyhow if anyone finds this useful please leave a comment below.

**IMPORTANT UPDATE**

Thanks to a comment by Chris Mahon I learned of another (better) method for hiding text on your submits. Instead of adding color: transparent; and text-transform capitalize; (the above method) add the lines below. The above method can mess up layouts where lots of absolute positioning is happening on the page. Thanks again Chris!

background-image: url('my-picture-with-text.jpg');
line-height: 999px; /* Set it higher than your image height */
overflow: hidden; /* Hide the text */
font-size: 0; /* FF2 doesn’t like the above */

Tags: , , , ,
Posted in Hacks, Tutorials | 35 Comments »