tags:

views:

142

answers:

8

I am trying to make my own website and it was coming along quite nicely. It looked beautiful in Firefox when opened and worked wonderfully. But then I run it in any other browser and it does not work. How can I fix this? Interner Explorer especially hates it =[

You just got to see it to know what I'm talking about so here is the link:

http://opentech.durhamcollege.ca/~intn2201/brittains/chatter/

Please give solutions that don't involve JavaScript.

A: 

It looks the same in Firefox 3.6.2 as in Internet Explorer 8. However the old browsers are the evil ones: search the web for Internet Explorer + margin, because thats where Internet Explorer fails.

Simple trick: do not use margin.

position:absolute;
top: 80%
left: 100px;

And then... google for specific stuff :)

dube
first hit, boom: http://www.positioniseverything.net/explorer/floatIndent.html
dube
I dont want position absolute as absolute has the same problem =[
MrEnder
its absolute but using percentages, what means it's still relative :)
dube
+5  A: 

Rendering differences between Firefox and Internet Explorer are really the daily trade of everyone who designs web pages.

You should start identifying which elements exactly cause the problem(s) and then formulate a question regarding exactly that. (or do a Google search, all those incompatibilities and how to fix them are documented somewhere on the net in some form.)

Also, I'd recommend you download a Tool like IETester and check out which versions of IE the site fails in. It looks pretty OK in IE8, but the inline frame looks bad in 7.

Then, really make sure your page is valid. (It probably shouldn't be XHTML, but have a HTML doctype.) This is not to conform with some rules, but because validation catches an awful lot of errors like unclosed tags that screw up the rendering. This isn't the case in your case right now, but still I'd recommend doing it.

On the long run, these tools are going to be very helpful:

  • Firebug in Firefox (Right-click any element on your page and choose "Inspect element..." it gives you heaps of useful information

  • The Web Developer Toolbar in IE8 (press F12 to open it) that is similar to, if not as powerful, as Firebug.

Pekka
I tried getting the web developer toolbar for IE and the site is down =[ and I already have firebug and firebug shows no errors.
MrEnder
@MrEnder this isn't about actual *errors* that a browser can detect and show you. You will need to inspect every element carefully and look which CSS property leads to the funny behaviour. I hardly think anybody can do that for you - it's a lot of work. The first step is making the document valid, and then extracting *one problem at a time* (like, the header is 100% tall in IE7). If you post that as a single question, you may get specific help in regard to that. Mention this question as a reference so people know where you're coming from.
Pekka
what do you mean the header is 100% tall? did u find another error I can't even see 0.0 ???
MrEnder
@mrEnder sorry, that is in IE6. There, the red "chatter" header takes up the full height of one page. I took a quick look but couldn't manage to find out why, however probably one of the `height: 100%` instructions in the style sheet is the culprit. (That's why IETester is a good thing, it can show pages as they look like in IE5.5, IE6, 7 and 8. You can ignore 5.5 though.)
Pekka
oh thanks ive been wondering what people use to test older versions
MrEnder
ok i got IETester and I can't figure out how to make it display older versions...
MrEnder
@MrEnder click around, there is a tab saying "New IE5", "New IE6" etc. somewhere.
Pekka
Ok I finally found that lol but I click on it and it says IETester is not installed... =\
MrEnder
@MrEnder don't know about that, sorry. If you can't get it to work, ask a question on superuser.com.
Pekka
thanks will do.
MrEnder
The Firebug Add-on is at https://addons.mozilla.org/en-US/firefox/addon/1843 - your link leads to the Web Developer Add-on.
mkj
A: 

Your page declares an XHTML doctype, yet it is not valid XHTML:

http://validator.w3.org/check?uri=http%3A%2F%2Fopentech.durhamcollege.ca%2F~intn2201%2Fbrittains%2Fchatter%2F&charset=%28detect+automatically%29&doctype=Inline&group=0

Furthermore, it's returned with a content-type header "text/html", which is wrong for something that's supposed to be XHTML. Unfortunately, the correct content type will not work either.

So there are two things you have to do:

  • Don't use XHTML
  • Make your HTML validate

Then you can start thinking about actual browser incompatibilities.

Michael Borgwardt
MrEnder
@MrEnder nope, it's not a valid XHTML page.
Pekka
well i can click validate all day long and it comes up green -_- and I want it XHTML not HTML because I sometimes need to make my own tags.
MrEnder
@MrEnder: It validates now, but it definitely didn't before. Did you make any changes in the last 10 minutes? IIRC the validation errors concerned text and text markup occuring outside a block element.
Michael Borgwardt
Last uploade of page according to my PC was 46 mins ago
MrEnder
@MrEnder: Read the document I linked to. Basically, you can forget about ever having it render consistently across browsers if you use XHTML; simply not possible, at least until Microsoft releases one that accepts a application/xhtml+xml content type. And your motivation sounds strange. Why do you need to make up your own tags?
Michael Borgwardt
@MrEnder: hm, perhaps your college uses a proxy to serve the pages, and it had an older version cached?
Michael Borgwardt
@MrEnder please stop doing crazy things if you want help here. Otherwise, it's really just a waste of everyone's time. You want to use XHTML and create own *tags* when you can't even do basic web site debugging yet? Come on. Choose a sane HTML doctype and get on with it. (However, the document *does* now seem valid.)
Pekka
I use XML for displaying database output... I will have database output on screen so to mix XML and HTML I went with XHTML. It will be for use later on in the project and I want all of my pages to follow the same standards.
MrEnder
@Pekka I can do my own debugging but I got stuck... I've yet to see a single other person fully figure out the issue either so its not just me@michael it is quite possible the server does that. But I do know that before I posted on here it was validating for me. I never post code unless its validating to avoid this sort of post
MrEnder
@MrEnder I see, all right. The page was not valid earlier but it was nothing important. Plus I can confirm it's a tough issue. Still, as Michael says, you probably really need to switch to a HTML doctype. You can't mix XML into a HTML document anyway, it will cause endless issues.
Pekka
I've been using that doctype for years without an issue and I have mixed my XML into my HTML for a while now with no issue. Takes time to set it up but it looks a lot smoother then plain XML. Besides I can run JS and CSS in HTML easier then I can XML. I run a Ajax type print out to keep track of my databases information in the past and I rather like it so I stick with it.
MrEnder
@MrEnder: Is it a strong requirement of your project to use XML directly? If not, it would be much better to switch to HTML and convert the database output, possibly using XSLT on the server. If it is a requirement, serve the pages as application/xhtml+xml and accept that they will not be rendered correctly on IE.
Michael Borgwardt
the DTD stays -_- and it is NOT the error or any error I can 100% guarantee that.
MrEnder
@MrEnder: have you read the document I linked to? As long as you serve your XHTML as "text/html" you are effectively serving invalid tag soup and depending on the browsers' quirks mode.
Michael Borgwardt
Ya that document just confirmed I have to add my CDATA lines back into my code. I knew there was a reason I've been using them after all these years ^.^ you finally answered to me why I'm supposed to use them ^.^ I only stopped using them recently as I was told they were no good you just proved to me they were wrong and my original argument was right so yes I read the document it made me happy and I'm still guna use XHTML
MrEnder
oh and they had a complex way of doing it for JS I have a much easier fashion //<![CDATA[ //]]> as posted by O'Reilly ^.^
MrEnder
A: 

Ok I fixed 2 errors finally figured them out

changed

#loginForm {

    float: right;

}

#loginTable {

    margin: 20%;
    margin-top: 14%;

}

to

#loginForm {

    float: right;
    margin-right: 5%;
    margin-top: 2.5%;

}

#loginTable {



}

and added

<!--[if lte IE 7]>
    <style type = "text/css">
        #loginForm{margin-top:-157px}
    </style>
<![endif]-->

not a solution I like but one I will have to deal with.

Ok still leaves the issue of I hear there is a 100% height problem and my horizontal borders wont stay the correct width.

MrEnder
A: 

First, make both your HTML and CSS to validate:

Then, if your valid code still fails in particular browser, find the problematic HTML element using the browser's debugging / inspection tools:

As long as you use valid CSS 2.1, differences between modern browsers should be minimal or almost non-existent. Yes, modern browsers do very good job in implementing standards, especially if you avoid bleeding-edge not-yet-fully-standardized techniques (CSS3, HTML5). (We are forgiving and count IE8 as "modern" here despite its CSS 2.1-only support, PNG issues, slow JS speed, etc.)

Oh, one thing not related to validness: always remember that many UI elements (fonts, buttons, etc.) are not rendered in exactly equal sizes in different browsers / platforms. Also screen sizes may vary largely due to popularity of mobile browsing. That's why you should prefer elastic / fluid layouts and not rely on pixel-perfect rendering.

Most IE 6/7 bugs are the same old common ones repeating and there are plenty of resources about fixing them. Create separated stylesheet(s) for IE(s) and include them by using conditional comments.

As a final comment, as long as open standards / technologies are used, personally I couldn't care less supporting a decade old browser, except in form of graceful degration, unless I'm paid generously for that. Browsers are free to upgrade, there are no reasons not to do that. No excuses. World is not static, show must go on, you won't see HD with your old tube telly, etc.

I also think it's our responsibility as web developers to force the big masses to adopt new (open) technologies, because they save huge amount of our time, makes possible to create better end-user experience, etc., the list of benefits is endless. Again comparison to other industry: consumer electronics companies keep pushing out new things, although most people would happily use 20 years old tech unless forced to upgrade their (naturally conservative) mindsets.

jholster
my html and css do validate -_- and you have to consider how many people in the world use 6 and 7 still... I personally don't even know how to get IE 8 =\ then again ive never tried either...
MrEnder
"you have to consider how many people in the world use 6 and 7 still" – apparently you didn't get / agreed with my point :-)
jholster
I understood your point and I agree there is no point supporting dinosaurs. But IE6 and 7 are not dinosaurs yet
MrEnder
Oh yes they are. Their popularity doesn't reverse that. No mean to argue, we can disagree.
jholster
A: 

The messed-up borders around the ‘welcome’ box and the wonky centering is because you're using ‘auto layout’ tables for page layout. This leaves you at the mercy of the auto table layout algorithm, which is complicated, unreliable, and a bit broken in IE.

For places where you must use tables for anything more complicated than simple data, set table-layout: fixed on the <table> and add explicit width styles on either the first row of <td>​s, or on <col/> elements just inside the table. Columns you leave without a width style will share the remaining spare width between them. Set an explicit height on the rows containing fixed size images to stop them sharing the table height.

However, for the main page layout here you would be much better off using CSS positioning or floats rather than tables. You can use nested divs (each with a separate background image) to achieve the image border effect without resorting to tables.

bobince
followed all that but not quite sure what u ment by"Set an explicit height on the rows containing fixed size images to stop them sharing the table height."
MrEnder
+2  A: 

OK, I had a look at the page in IE6.

Some tips.

  1. Try to avoid tables for layout. I admit that putting the fancy border around the "welcome" area, is much easier using a table than any other way, but the other tables are completely unnecessary, and the cause of your much of your problems, because browsers, particularly IE6 and IE7 like to do their own thing when deciding how to lay them out.

  2. As bobince says, table-layout:fixed on the signupTable1 will help a lot

  3. Also, for IE6, giving the td containing "welcome" a height of 100% helps.

  4. The margin widths of the items in the cells in the signupTable1 are percentages of the cell width in FF, but percentages of the screen width in IE6. You should add some IE6 targeted css to compensate for this.

Finally, as far as I can see, your markup is immaculate polyglot HTML/XHTML and serving it as text/html and using an XHTML doctype should not cause any problems.

Alohci
very helpful its almost fixed now just a little issue... table went bigger then the div...
MrEnder
ok set it to 94% instead of 100% and it worked out ^.^
MrEnder
A: 

If I were you, I would not bust my guts trying to make the site work for ancient browsers like IE 6.

Indeed, one could argue that you would be doing the world a favor if you made your site refuse to work with IE6. Anything that can help to push IE6 into the grave is a good thing.

If Google can say that IE6 is no longer supported ... so can you.

Now if you were building this site as a money-making exercise, and demographic included a significant percentage of IE6 users, maybe the pain of supporting ancient non-standards-compliant browsers would be worth it. But otherwise, I'd say it is not.

Stephen C
I'm attempting to pretty much make a red facebook so ya... it has to support all the noobs who use IE6 as those are the type of users who use facebook lol I want to be competition for facebook ;) they dont have enough competition
MrEnder