IE8 CSS Width Issues...

Status
Not open for further replies.

Stray Toaster

Ars Tribunus Militum
2,292
Subscriptor++
We are experiencing inconsistencies between div widths between IE8, Firefox and Chrome. I am aware that in IE6 and before does weird things with borders and what not, but I was under the impression they fixed that with IE7 & 8, however, the problem seems to be present.

When I take a screenshot of the section in question, the border is definitely being included in the width. But then a div that is supposed to reside inside the broken div is set to a width of 690px with a 20px border but is showing up as 734 wide, so the border plus some... So I did some more digging, and found IE has issues understanding the CSS width command, and interprets it as min-wdith. But I also read IE8 is fully CSS2.1 compliant, so shouldn't this be fixed?

Which leads me to my final question, the header reads as:
Code:
<!-- DOCTYPE HTML PUBLIC  -//W3C//DTD HTML 4.01 Transitional//EN  -->'
<!-- l version="1.0" encoding="iso-8859-1 -->

But from what I can tell, to make it compliant it needs to be:
Code:
<!-- DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"  -->'
<!-- l version="1.0" encoding="iso-8859-1 -->

Would that change possibly fix the issue, or is something more going on?

I also found this:
Code:
<meta http-equiv="X-UA-Compatible" content="IE=8" />
Would that do anything?

I'd post code, but it's a whole crap load of code (a sharepoint based site) and I think it is considered proprietary, NDA and all that...

I hope I made sense...

Oh, also I am not the I.T. department, who should be doing this, I am just the graphic designer, but eh, sometimes if you want something done... (also why I can't just test this, I have to email someone else, and am trying to minimize attempts)
 

technophile

Ars Legatus Legionis
23,768
The simplest way to test this might be to open IE8, go to the site, and hit F12. This opens the IE developer tools, which are included in every install.

Now, in the window that opens, in the menu bar, there will be labels for the Browser Mode and the Document Mode. Note those; you probably want them to be IE8 and IE8 Standards if you're trying to get it to look like Chrome/Firefox.

If they are not, then you can change them right there in the dev tools (click the label) and see if that fixes it; if so, you can make the changes (correcting proper doctype and using X-UA-Compatible) in the source.
 

Stray Toaster

Ars Tribunus Militum
2,292
Subscriptor++
The mark-out thing shows up in the developer tools window of IE, but when I check the source as it actually is, it is the normal way... The developer tools window seems to comment out a handful of stuff before the header, I assume this is maybe so it can switch between standards for preview purposes? But no idea really... Regardless, other than some pesky scroll bars showing up and an apparent javascript issue, the doctype thing fixed the width issues.

Here is hoping the IT dept can do their jobs and fix that stuff...
 

gnosis

Ars Tribunus Angusticlavius
8,339
Note that IE8/9 treats Intranet sites as always being in "compatability mode" by default, unless the X-UA-Compatible meta tag or header is used.
Which, and pardon my rant that doesn't help anyone here, really makes my blood boil because the only way that would have ever been useful is if "compatibility mode" was IE 6 mode, not IE 7 mode. :mad:
 

Blacken00100

Ars Legatus Legionis
10,130
Subscriptor
gnosis":222s5wux said:
Note that IE8/9 treats Intranet sites as always being in "compatability mode" by default, unless the X-UA-Compatible meta tag or header is used.
Which, and pardon my rant that doesn't help anyone here, really makes my blood boil because the only way that would have ever been useful is if "compatibility mode" was IE 6 mode, not IE 7 mode. :mad:
Wrong. Loads of code targets IE7 specifically. I deal with it daily.
 

Stray Toaster

Ars Tribunus Militum
2,292
Subscriptor++
Well latest word is, changing the doctype messes something else up with sharepoint's scripts in I.E. or some such nonsense. I am guessing the final product is going to look weird across different browsers and probably act broken somewhere, but that is the IT department and developers problems. I tried to do my part...

EDIT: For reference it looks different in IE, firefox and Chrome. It is not 100% consistent between any of them. The closest I could come to sameness looking, is IE8 in Developer mode, set to IE7 Standards it looks like Firefox. And set to IE8 Standards, it looks mostly like Chrome (but not entirely)... bleh.
 
Status
Not open for further replies.