Archive for the ‘Workshop’ Category


2Dec 2008

IE not intepreting text-indent on submit buttons ?

Author: Gopal | Filed under: Workshop
I’ve worked on many projects where in I had to style the form/input buttons using custom background images. That is, I had to hide the default text of the button. It’s not a big deal, I know. But it is, when it comes to IE. Let’s review this in detail.

The following image(button background) has been used for this tutorial. You may right click and save it.

Sample Image

1: HTML Code

Create a HTML page and insert a button with a class, “button”.

<html>

<head>
<title>ProductiveDreams</title>
<link href=”style.css” rel=”stylesheet” type=”text/css”/>
</head>

<body>
<input type=”submit” value=”Submit” class=”button”>
</body>

</html>

2: Style Sheet

I included the following in my stylesheet.

input.button {
width:114px;
height:37px;
border: none;
background: transparent url(images/submit_btn.gif) no-repeat center;
overflow: hidden;
text-indent: -999px;
}

Fixed width, overflow:hidden and negative text indent will hide the text of any button. This works well in all browsers except IE.

3: The Problem

The image below shows how IE displays the button.

IE Issue

You can see the black text within the button which looks odd.

4: IE Fix

So finally, here goes the three line CSS code that does the work for you.
Modify your CSS as shown below.

input.button{
width:114px;
height:37px;
border: none;
background: transparent url(images/submit_btn.gif) no-repeat center;
overflow: hidden;
text-indent: -999px;
font-size: 0px;
display:block;
line-height: 0px;

}

5: How it works

Let’s see how it works.

font-size:0px is used to reduce the font size and works well in IE7. But even after adding this line, you would notice a black line(which is basically the text) on the center of the button in IE6.

display:block Negative text-indent works in IE only if this is added.

line-height: 0px Another fix for IE6.

I have included the sample files for your reference.

Download IE text-indent issue Version 1.0

Downloaded a total of 70 times

9Nov 2008

ProductiveDreams Desktop Wallpaper v1

Author: Gopal | Filed under: Freebies, Workshop
I hope all of you enjoyed my previous “Free Wallpaper Generator” post!. This is a grungy, dark and warm design which will definitely enrich your desktop. This was created using Adobe Photoshop CS3. The zip file file contains both Standard (1024×768 and 1600×1200) and Wide versions (1280×800 and 1920×1200).

pd Wallpaper

Please do let me know your feedbacks.

Download pdWallpaper v1 Version 1

Downloaded a total of 459 times

I'm Gopal, currently working as a Senior WebDeveloper.

Gopal Raju

I'm from Trivandrum, Kerala, the southern part of India, but currently living in Bangalore.I am a MAC user.Technorati Profile

You can catch me on Facebook

View Gopal Raju's profile on LinkedIn

twitter ProductiveDreams

If you are expecting me to give you a long story behind the name of this site, I'm sorry.

This site is just meant to help out the designer/developer community which would of course make them more productive.

Advertising


Recent Comments

Twitter Updates

XHTML Valid! CSS Valid!