I am using an H2 for the page title. The words are using CSS to replace it with an image that reads “MARINAS”. It looks accurate in Safari but in Internet Explorer it crops off the bottom few pixels. Attached is a screen grab to visually explain what is going on. Can anyone help me figure this one out?
Okay, I set the height to 35px for that one class which worked but now I cannot get the #page_title_top with the class .sports_facilities to work correctly. It is also getting cropped or clipped on the bottom portion. Just a few pixels are trimmed off.
I added the same property of height and set it to 35px which works for the top h2 but not for the bottom one. What gives? Can anyone figure this one out?
Okay, so I think I have it working in IE7 and IE8 but I wouldn’t mind someone else still taking a look. It appears that maybe the problem was with using CSS shorthand.
So I was reading up on “haslayout” thinking that it might be the cause and it mentioned that some of the consequences of an element not having “layout” can include differences in the positioning of background images.
So that made me look at adding a horizontal and vertical position to the background shorthand - even though they are both zero.
Now it works in IE7 and IE8… I think. And the reason I am saying that is because I am using a screen capture service (Adobe BrowserLab) to view the rendered results as opposed to having an actual IE environment.
I have an H2 with a class of “shopping” and the css shows that class (.shopping) with a height of 35px and a line-height of 35px and I have also added your suggestion of a class (h2.shopping) with a height of 35px and a line-height of 35px but it still does not work in IE8. Works in IE7.
Having to give a class to each instance is pretty inefficient, though. If all of your h2s are images like this, you could just set one rule for all h2s.
EDIT: I mean one height rule, as you obviously need a separate rule for each h2 if you have a different image on each one.
A height on the <h2> should not have been needed at all. So Todd, if you read this please break the site so I can take a look at it :). Normally something simple causes simple text to be cut off. Most of the time line-height is too small :).
I still don’t think I have this figured it out. Take a look at the h2 used in the site and see if any of them are clipped or trimmed off at the bottom of those graphics…