views:

28

answers:

3

Strange issue that I'm not exactly sure about...also, please feel free to correct me if I am going about the SEO incorrectly, as it is relatively new to me.

I have a few h3 tags that I am replacing with images to make them a bit prettier. I still have text in between the tags, but I have made the font-size 0 in hopes that the search spiders would still register them.

Naturally, everything looks fine in FF (ie the images are left-aligned), but in IE the images are centered, and I'm not exactly sure how to fix them. I had hoped that the background-position would take care of that, but it remains center-aligned.

**style.css**
h3 {
  font-size: 0px;
}

h3#provide {
  background: url('provide.png') no-repeat;
  background-position: top left;
  width: 234px;
  height: 38px;
}

.object_wrapper {
  margin: 10px auto 0px auto;
  padding: 10px;
  width: 400px;
}


**index.php**
<div class="object_wrapper">
  <h3 id="provide">h3 text</h3>
  <p>
    text text text
  </p>
</div>
+1  A: 

Maybe the problem is caused by margin/padding. How about adding

h3#provide {
    margin: 0;
    padding: 0;
}
Alexander Gyoshev
thanks, but unfortunately no luck with that one
espais
have you got the site live? it would be more helpful than guessing...
Alexander Gyoshev
unfortunately i don't...i'm behind a firewall that prohibits FTP uploading
espais
well, you could use the "floating comment" technique in order to find the problem - try to comment out everything else on the page until the code works, and start enabling styles one-by-one until it breaks.
Alexander Gyoshev
A: 

You showed only fragments of your CSS and HTML.

Don't forget that the DOCTYPE is important if IE is to behave in a more standard manner.

pavium
DOCTYPE is set to strict.
espais
+1  A: 

Combine your background and background-position attributes. I don't know if it will fix anything but it looks cleaner.

h3#provide {
  background: url('provide.png') no-repeat;
  background-position: top left;
  width: 234px;
  height: 38px;
}

Could (and should) be:

h3#provide {
  background: url('provide.png') no-repeat top left;
  width: 234px;
  height: 38px;
}

And maybe it's centering because of the auto-margin of the .object_wrapper. Seems unlikely, but maybe this plus Alexander's solution will fix it.

Cory Larson
It turns out that (of course) it was my own stupid fault. I had left in a div from a previous layout that had 'text-align: center' This was causing the h tags to center their background images. Once I removed that everything is ok.
espais