I am the webmaster for SPX.com, which uses the content manager Zope to maintain the site. Most of the pages have straight HTML written into the console for the content.
One problem I've been having is that Divs will not display reliably between Firefox and IE. For instance: if I get the tags working in one, they look strange in the other.
Here is the code for a page I am working on at the moment... just the content HTML, the header and footer are in another file:
<table cellpadding="8px" cellspacing="0px">
<tr>
<td>
<div id="text">
<h3>Welcome to the Career Center</h3>
At SPX, our people are the strongest part of our organization. We strive to find the most talented and driven individuals to fill positions throughout all of our many businesses. The Career Center has the information you need to learn about the opportunities SPX has to offer!
<ul>
<li>View current job listings at <a href="https://spxss.usi.net/psp/P89HSPX_APP_1/APPLICANT/HRMS/c/HRS_HRAM.HRS_CE.GBL">Career Search</a></li>
<li>Examine the SPX <a href="http://www.spx.com/Careers/RewardsandBenefits">Rewards and Benefits</a></li>
<li>Experience our culture with <a href="http://www.spx.com/Careers/Life%20at%20SPX">Life at SPX</a></li>
<li>Learn more about our company at <a href="http://www.spx.com/Careers/Our%20Organization">Our Organization</a></li>
</ul>
<h3>Opportunities At Every Level</h3>
We believe in developing and advancing the careers of both university graduates and experienced professionals. If you are a student, check out our <a href="http://www.spx.com/Careers/College%20Recruiting">College Recruiting Schedule</a> and unique <a href="http://www.spx.com/Careers/College%20Recruiting">Rotational Programs</a>. These aggressive programs are designed for individuals seeking a position upon graduating with careers targeted towards engineering, human resources and accounting or finance.
Candidates interested in applying for a current opportunity with SPX, please visit our Career Search, register to create an account and begin your search.
</div>
</td>
<td>
<img src="img" width="100%">
<br />
<div style="background-color:#eeeedd; padding: 8px;" id="text">
Want a career in accounting or finance? Learn about our <a href="Internal Audit’s Leadership Development Program.
</div>
<div id="text" style="background-color: #FFDB63; padding: 8px;" width="100%">
<font size="2"; color="maroon">
<b>Diversity</b>
</font>
<br />
<br />
<b>Our commitment to diversity</b> is a commitment to individuals and to the team. It’s about creating an environment in which all associates can fulfill their potential without artificial barriers, and in which the team is made stronger by the diverse backgrounds, experiences and perspectives of individuals. It’s about giving all of us – individually and together – the best possible chance to succeed.
</div>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<span style="background-color:#ff9900; padding:8px;" id="text">Questions? Contact Us at <a href="mailto:recruiter@spx.com">recruiter@spx.com</a>.</span>
</td>
</tr>
</table>
Some examples you can see on the site:
http://www.spx.com/Careers/LearningAndDevelopment/LearningAndDevelopment
When I render in IE, the picture and caption box line up... in FF, the caption box extends to the right a bit.
http://www.spx.com/Careers/Life%20atSPX/Lifeatspx
When I render in IE, the boxes line up and are fully displayed.... in FF, they're shorter and the gray box doesn't display all of it's contents.
Unfortunately I was not the original coder of this website, so I don't know the ins and outs of how it was designed... but I do know that the coder I picked the job up from was a lazy coder (he never closed tags. :mad: ) and never checked compatibility across popular browsers.
Any thoughts on how I might fix this? I'm not required to enforce browser compatibility, but because I want to do my job well, I prefer to.
felgall
07-23-2007, 02:52 PM
1. Do you have a valid and complete DOCTYPE as the first statement?
2. Have you set a default value for margins and padding to override the different defaults used by different browsers?
drhowarddrfine
07-23-2007, 04:14 PM
As mentioned, without a proper doctype, IE will never perform like modern browsers do.
Ferret
07-23-2007, 06:40 PM
1. Do you have a valid and complete DOCTYPE as the first statement?
2. Have you set a default value for margins and padding to override the different defaults used by different browsers?
Wow, that's such a basic thing (and is contained in the header files I don't edit very often) that I overlooked it. Thank you so much for pointing out the fact that there is no DocType on the site. The lazy coder who's name I will not mention strikes again!
Ferret
07-24-2007, 08:13 AM
Still no good. I added a DOCTYPE, and it changed nothing so far (probably because I was making the site work around IE's shortcomings without a DOCTYPE without realizing it).
Here's some screenshots of the different browsers: First is FF, second is IE.
I understand that IE is most likely at fault here, forcing whoever designed this site originally to work within the limits of IE's lack of standardization... because of this is there hope for me to get the site to work in both IE and FF in it's current state?
WebJoel
07-24-2007, 12:23 PM
There are a number of small errors that could be cleaned up that would contribute to the whole. Immediately I noted:<ul><li>....</li><br>
<li>.....</li><br>
<li>....</li><br>
<li>....</li><br>
(etc.
etc.
etc. link text and more edited out for brevity)
</ul The "<br>"s are not required, as this <ul> will form a vertical listing anyway. Using line-breaks is superfluous and bloat. And upon validation, you will get a missing "<li>" warning, as in an UL, any "</li>" expects ONLY another opening "<li>" OR a closing "</ul>".
Any other tag (including any way you could insert text), will throw a validation error (a "warning" actually, that is a "minor error" that most browsers probably would overlook).
This site is not that complicated and could be easily re-done in updated code that would make it faster, leaner, more x-browser and compliant. :)
ray326
07-24-2007, 12:53 PM
The "<br>"s are not required,Not only not required, they're invalid there.
is there hope for me to get the site to work in both IE and FF in it's current state?Looks like a big redo to me.
Ferret
07-24-2007, 02:05 PM
Thank you for your input. I'll continue working on the site and see if I can fix it.
This is the first site I've had to work on that I didn't participate in the design of, so it's more difficult for me to try to work the layout in the manner of the site and still try to be standards compliant when it wasn't designed to be that.
Thanks again! I'll continue on.
Ferret
07-24-2007, 02:08 PM
Not only not required, they're invalid there.
Which page has the line break tags? The code I wrote doesn't. One of the problems I run into is that whitespace line breaks are enforced in the output by the python parser that reads the HTML (the Zope content manager I mentioned in the first post)... so when I actually post the page into the Zope console I have to remove all of the line breaks that I don't want converted to <br>, which I do do before I update the pages.
And I suppose I have to laugh about closing the <li> tags, as I originally didn't do that, but was instructed to by someone I asked for advice.
There is a planned rebuilding of the site (using Vignette, for those of you who know what that is), so I won't be redoing the site from scratch just to get the site to work in Firefox.... I suppose I'll have to ignore my incompatibility errors if there are no relatively quick fixes.
WebJoel
07-24-2007, 05:31 PM
Do you have Firefox? If so, also get "HTML Validator" by TIDY. If there are no bona-fide "errors" but only "warnings", you can use the 'click button' to clean-up the code. This can remove dozens or more 'minor errors'. Often tough, so doing will make the page not do so well in some browser(s). But getting rid of the bad code is the first step towards getting the correct code in there. :)
Ferret
07-25-2007, 08:51 AM
Do you have Firefox? If so, also get "HTML Validator" by TIDY. If there are no bona-fide "errors" but only "warnings", you can use the 'click button' to clean-up the code. This can remove dozens or more 'minor errors'. Often tough, so doing will make the page not do so well in some browser(s). But getting rid of the bad code is the first step towards getting the correct code in there. :)
I do use firefox, and I've been using the w3 validation tool linked above. At the moment I get 2 errors which I attribute to the parser misunderstanding the javascript toward the end of the page.
Here's the code for the main page that I've been working on... note that the DOCTYPE has been commented out, as if I don't, then the result is like the image posted above: http://img516.imageshack.us/img516/1845/homepagedoctypeffxy9.jpg
Please forgive the nested tables... I don't like it either.
Also, if you need the stylesheets, you can access them by changing the IP to be 212 or 214, which are the load balancing live boxes, rather than 210, which is my staging box.
<!-- DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" -->
<script language="JavaScript" type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
<table id="home-main-middle-ad-table" cellspacing="0" cellpadding="0">
<tr>
<td>
<A HREF="javascript:VideoPopUp('http://www.exin.tv/mini/cplayer1.html?1,6%20Jun%2007,a,b%20c,U11900-6,0')"><img border="0" src="Images/home-middle-news-title.jpg" alt="SPX CEO appears on CNBC's Street Signs"></a>
</td>
<td id="home-main-middle-ad-image" rowspan="2">
<A HREF="javascript:VideoPopUp('http://www.exin.tv/mini/cplayer1.html?1,6%20Jun%2007,a,b%20c,U11900-6,0')"><img border="0" src="Images/home-middle-news-image.jpg" alt="News Releases"></a>
</td>
</tr>
<tr>
<td id="home-main-middle-ad-text">
Erin Burnett of CNBC's "Street Signs" interviewed SPX Chairman, President and CEO Chris Kearney about SPX, our growth drivers and our end-market business outlook.
<A HREF="javascript:VideoPopUp('http://www.exin.tv/mini/cplayer1.html?1,6%20Jun%2007,a,b%20c,U11900-6,0')">go></A>
</tr>
<tr>
<td id="home-main-middle-news-text">
Spend less? Sure. But supply chain management is also about how to create more value throughout the process.
<a href="Newsroom/Feature_Story" class="home-news-link">go></a>
Which page has the line break tags?I don't know. I was just looking at what Joel highlighted.
Ferret
07-26-2007, 08:43 AM
I don't know. I was just looking at what Joel highlighted.
Heh, I was responding to both of you, I was just confused is all. ^^
I still don't know why adding a DOCTYPE throws Firefox for a loop... and only on my index page: I added a DOCTYPE to the standard header of the rest of the site without any trouble at all.
webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved.