Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser behaviour, why? 2

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
0
0
GB
Can some one tell me why the page below looks so different in I.E vs FF.

I.E. shows correct & FF doesn't

The code is generated from SAGE, so I have no control over this, the doctype it chucks out says HTML4.1 strict.

I've run it through the w3c validator and it says i'm not allowed to use the DIV tag, i'm confused?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
1DMF said:
I've run it through the w3c validator and it says i'm not allowed to use the DIV tag

No it does not. It says you cannot use it here (i.e. where you have used it).

You cannot put block elements inside inline elements.

Hope this helps,
Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
In the page you show, either change the divs (block) to spans (inline) - and style them back to divs using CSS... or replace the spans (inline) with divs (block).

Oh... that'll be the 4.01 doctype (there is no 4.1 doctype *grin*).

There are two other ways to solve this... either remove the doctype completely or switch to using a custom doctype. If you can't do anything else (because it's SAGE output) then I suggest removing the doctype.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
i've removed the DOCTYPE & converted all <span> tags to <div> tags but i still have the same display issue.

isn't this fun!!!!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
the reason it looks like that is because you have all the divs positioned, change the numbers around and it'll go wherever you want it to.

-> LuckySyringe
 
that's the whole point I can't - it comes out of SAGE. unless you know a way of hacking sage code so i can alter the HTML it generates.

or does anyone know of a good PERL HTML parser, that might do the job.

I'm already playing with s/X/Y/gi; to alter the input. Now that i'm placing it in a DIV on the same page rather than an iframe, i need to remove the HTML/BODY/HEAD etc tags.

it still doesn't answer why it looks fine in I.E but not FF or Opera.

and the irony is, I went through this process to change it to one page with no iframes and no tables (ok i still got two [noevil]) because Opera doesn't handle iframes correctly and the final result is worse, it looks rubbish in FF & Opera and fantastic in I.E, so i've now got a final page thats less cross browser compatible than I started with - lol

I will crack this, i'm even going to release the new version fixed ot not, as ALL our members seem to be using I.E. so no real problem there for the moment.

Would be nice to get this finally finished and working in all browsers though.

Any ideas from anyone is always appreciated.





"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
I can't - it comes out of SAGE. unless you know a way of hacking sage code so i can alter the HTML it generates.

If Sage is a professional package that you / your company / your client have purchased, and it is not outputting correct markup, then I suggest talking to their technical support people. There is no excuse for a professional product (again, I'm assuming Sage is) to output invalid markup like this. It's a basic HTML error - block elements inside inline ones. They should know better.

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Then again, if it's the same Sage that have their website at it's little wonder they have bad Firefox support - their own website appears to have a Firefox version of the "peekaboo" IE rendering bug, and many badly displayed pages.

I guess they don't really care too much about their public facing image or user base if they're not at least attempting to supporting Firefox.

Dan

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks for the confirmation Dan, unless someone like you who understands the DOM and heirachy of elements tells me this, i'd never have know.

It is a professional package it's our Accounting Package Sage (Line 50) that runs the whole company's sales, bought, nominal ledgers and we also have the payrol module.

SAGE has been around as long as computers have, originaly in IBM DOS format, i'm suprised you haven't heard of it.

However I think i've found the 2 lines I was removing with my substitute that might be a quick fix, athough as you say the SPAN/DIV invalid syntax is still wrong for a so called professional company.

I'm just trying my changes and i'll let you know how i get on.

as always thanks for the help



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
If you can insert the following into the file, it will solve the problem. You are using some h1 and h2 tags that have different default values... and they need to be reset so both browsers appear the same.

Code:
h1,h2 {margin:0;}
Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
lol - you know i just said I'd worked it out, guess what i'm putting in
Code:
H1	{ font-family:Verdana,sans-serif; font-size:medium; font-weight:bold; text-decoration:underline; margin-bottom:0%; margin-top:0%} 
H2	{ font-family:Verdana,sans-serif; font-size:x-small; font-weight:bold; text-decoration:underline; margin-bottom:0%; margin-top:0%}

i'd worked out that it was the H1, H2 that needed sorting, I tested and it worked, but I prefer your syntax, so i'll use that. - thanks Jeff

just one more problem to go and i've cracked it, shall I post here or start a new thread ?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top