Ie problems

Hello.

On www dot religioniperlapaceitalia dot org (wordpress 3.7.1)
I have a series of symbols which have a tooltip, which they do show correctly in firefox, chrome (a bit of position issue), and ie-8.

Problem is neither the images (symbols), nor the tooltip show on ie-9,10,11.

The images, and tooltip disappear on ie8 as well, if I change the original doctype of wordpress (<!DOCTYPE html>) to
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EIT” " www w3 org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns=" www w3 org/1999/xhtml" xml:lang=“it” >

If you have alternative solutions for the purpose I am open, as long as I get it working.

Thank you

Hi,

The doctype change shouldn’t have an effect as long as you have no typos in there because both those doctypes will activate standards mode so there will be no rendering implications as such.

It looks to me as though the issue of the inline element (the header image) which is followed by a float with a negative top margin and upsets the positioning.

Try this:


#masthead img{display:block}

It is always dangerous to leave inline elements hanging in mid air unless you set them to display:block (especially now that anchors can wrap block elements in html5) or indeed wrap a block element around the inline element (which is my preferred solution for semantics sake).

Also note that <hgroup> no longer exists, so it would be better to remove it. (It wasn’t really meant to have all that stuff inside it anyhow.)

Thank you both.

@Paul O’B
I did add the suggested css, but the problem is still there, I noticed (it didn’t cross my mind to do it before) that in compatibility view it displays ok; problem is most users of the site are not familiar with that (go figure I am a bit more into it and did forget to check it).

It is always dangerous to leave inline elements hanging in mid air unless you set them to display:block (especially now that anchors can wrap block elements in html5) or indeed wrap a block element around the inline element (which is my preferred solution for semantics sake).

Would you care to explain it a bit more please?

ralph.m
Yes, thanks I was planning to after running the w3 validator, since you reminded me I did it now.
I wonder why the gurus at Wordpress still keep it there.

The code hasn’t been added to your live page yet so please add it and we can test from there. I’m sure you will find it will fix the issue once added because I previously copied your whole site locally to test. If not then I need to see that the code is in place before testing again to see what went wrong. You seem to have added #masthead{display:block} but that’s not what I said you should add.

I noticed (it didn’t cross my mind to do it before) that in compatibility view it displays ok; problem is most users of the site are not familiar with that (go figure I am a bit more into it and did forget to check it).

Compatibility mode is a mess and should be avoided at all times as 9 times out of ten it makes things worse. It may appear to fix the issue due to legacy handing of inline elements which in ie5 which could have dimensions applied (as they were more akin to inline-block). This is triggered by quirks mode which is basically what happens in compatibility mode but with differences.

Would you care to explain it a bit more please?

In html5 you can now do this:


<a href="#">
<div>block content</div>
</a>

However, browsers still hate it and will cause rendering problems unless you set the anchors to display:block. I have answered to or three questions recently in the forums where this has caused issues.

Also I hate to see things like this:


<div>
Some text
<p>Some more text</p>
</div>

The 'some text" runs into a block element and so the browser must construct an anonymous block box to hold this stray text. In older versions of IE these structures would often cause rendering problems in complicated layouts but semantically it is bad also as the initial text should also be in a suitable container to add semantic meaning to the snippet.


<div>
<p>Some text</p>
<p>Some more text</p>
</div>

It would also be incorrect (semantically speaking) to have this:


<div>
<span>Some text</span>
<p>Some more text</p>
</div>

Although it is valid it makes no sense semantically as to why one section of text is a paragraph and another similar one is not.

In your case the image was an inline element and then you followed it immediately with a float (a block display). When floats follow inline elements the inline element should be moved out of the way so that the float can move to the right on the same line (assuming there is room). This combined with the negative top margin was confusing some versions of IE. Without the negative top margin the float stays underneath and visible but once the full negative top margin was added the element disappeared. Setting the image to display:block forces the float to start under the image and not collapse its margins. At least that was my best guess as to what it was doing.:slight_smile:

My apologies.

My memory is getting worse, I should have just copy/paste your solution … yep I missed the img, and if you hadn’t had the patience to point it out I’d have never seen it!

Thanks a lot, for your kindness, and the great mini-tutorial.