Hey, I am trying to make an <a></a> a certain width. The background image really decides what the button looks like, and the hover over effect is fine. However, in FF it seems fine, as I set the width of the ‘a’ and it’s not a problem, but in IE it seems to not allow a set width. I put a in it, and then it was only the width of that particular character (if you can call it a character). My temporary solution works and is to add a lot of to the a.
I want to know what the correct solution is though, as I’m sure that can’t be it!
Thanks for your replies.
p.s. what has happened to Sitepoint it looks really different! I preferred the old one… I’m sure there would always be a valid reason for the change though 
You could set your links to
display: inline-block;
and then set a width.
OK, I may be misunderstanding you here, but if you’re using an image as your link, then surely that should be included as an <img> tag with appropriate alt text. Images should be applied as background images if they’re purely decorative, but in this case, your image sounds to be integral to your site. Using an <img> tag will also allow you to set the appropriate width attribute.
I suppose you are right Techno Bear. Perhaps I should add text to the link and then make the background image textless. However, that would still leave me with a wrongly sized link area for the button. The reason for the background image is in order to have the hover effect you commonly see with buttons.
Thanks guys I’ll try that and see how I go. Nice one 
Dimensions of inline elements are set by their content, so this is a simple trick in which you have to change the display of the element; you can do this by floating or by setting the link to display:inline-block ( or just plain block if you don’t mind it having its own line) and THEN applying width. From there you will have to style to conform to your layout as needed.
Yep cheers, I got that, I remember having done this a few times before but it seems to dissipate from my memory each time. More gray matter please!