CGI.pm & MSIE box model

V

valid-till-end-Aug

Sent this to c.i.w.a.c but didn't get any replies (perhaps all
MSIE-philes there!). It's also relevant here as it concerns a perl
module.

Using CGI.pm with default settings generates xhtml with an XML
declaration at the top of page. This apparently puts MSIE 6 into quirks
mode (emulating MSIE 5.x) which has a broken box model.

Unfortunately I have to allow users with this 'browser' to access my
pages, so my choices are:

1) allow MSIE 6 to wreck the precise positioning,
2) fudge the css using Tentek's hack,
3) load CGI with the '-no_xhtml' switch (produces HTML 4.01)
4) write the dtd stuff manually without an XML declaration

Alternatively I can try separating the padding and border attributes.
Currently I have:

input.textbox {
padding: 3px 4px;
border: 1px solid #bdcebb;
}

I don't specify a textbox height here, as MSIE and the Mozilla-class
browsers interpret this differently, such that forcing the height so
that MSIE 5.x (and 6 in quirks mode) displays correctly makes it much
too large for Mozilla. So I have a separate style sheet specifying
'height: 22px' for MSIE 5 & 6, which I would rather not do.

My preferred option would be to switch off the XML declaration in CGI.pm
but retain xhtml and add the charset back using a meta tag. Is it
possible to switch off the XML declaration? Or are there better options
I have missed?
 
J

James Willmore

My preferred option would be to switch off the XML declaration in CGI.pm
but retain xhtml and add the charset back using a meta tag. Is it
possible to switch off the XML declaration? Or are there better options
I have missed?

If you decided to go with standard HTML, you can do so by doing ...
use CGI qw/:standard/;

The section of the CGI documentation has other settings listed in the
"Using the Fuction-Oriented Interface" section. You can also set the
script NOT to output XHTML using ....
use CGI qw/:standard -no_xhtml/;

You can also 'create' your own tags. The author gives direction on
this in the documentation.

As far as making your script browser independent, good luck. Even
though there are standards for what good HTML and CSS are suppose to
be and what is suppose to be supported, vendors still try to slip in
thier own brand of 'stuff' into the mix.

HTH

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top