Log in

View Full Version : IE7 images not showing up when in an "a" tag



punstc
02-26-2009, 05:08 PM
I have an issue that I have no clue what is wrong.

I have an image that i'm using as a button. when I wrap an a tag around it for the link then in IE7 it doesnt show up. Theres no specific css styling being applied to the a tags either. I tried taking it out of the a tag and then the image shows up.

heres the code i have in plce for the image.


<td class="table_bottom_column1"></td>
<td class="table_bottom_column2"><img src="../images/purchase_btn.jpg" title="Purchase Silver" /></td>
<td class="table_bottom_column3"><a class="buy" href="purchase_signin.php?package=gold"><img class="p_button" src="../images/purchase_btn.jpg" title="Purchase Gold" /></a></td>
<td class="table_bottom_column4"><a class="buy" href="purchase_signin.php?package=platinum"><img class="p_button" src="../images/purchase_btn.jpg" title="Purchase Platinum" /></a></td>

you can check out the full page at www.profoundcar.com/test/services.php


thanks for the help I appreciate it.

Snookerman
02-26-2009, 05:28 PM
That doesn't have anything to do with the anchor tag. The images that don't show up have the class value p_button. The image that does show up doesn't have that class. The exact piece of code that is causing your images to move off the page in IE is this:

td img.p_button {
display:block;
background:url(../images/purchase_btn.jpg) no-repeat;
height:28px;
width:140px;
margin:-33px 0 0 22px;
cursor:pointer;
}

Consider doing whatever that is doing in another way. The best thing would be not to use tables.

Good luck!

punstc
02-26-2009, 08:39 PM
I dont understand why that is causing it to bug out in ie though? its the correct positioning and styling in every other browser.

I used an IE specific style to reset it's margins and such back to 0 and it seems to be ok now.

and Yeah I normally don't use tables but its tabular data so I used a table. A lot simpler then using floats and positioning to line up perfect with the table lines.

Thanks though for the help though I appreciate it

Snookerman
02-26-2009, 08:50 PM
The problem is that IE has some quirks with tables. Try giving the td's a style of vertical-align: top; and the images a style of margin: auto;

Good luck!

punstc
02-26-2009, 08:54 PM
ok thanks,

IE has problems with basically everything. I'm normally a flash developer so I get caught up in little ie things from time to time. Thanks for the help I appreciate it.