Basic Web Question
I have a home page for my game, that I thought worked fine. I asked some people to look at it and here is what happened. All the people using Internet Explorer see nothing. People using Firefox (like me) see the web page normally.
Here is the url:
I know this isn't a web page forum, but I have realized this is a huge problem that I was completely oblivious to and may be due to something really obvious.
OK I found the problem, sorry to bother anybody.
I just posted about a problem I was having with my web page, but I figured it out. I had a mismatched </script> <script> tag. Firefox accepted the page, IE would not.
Here is a lesson for dumb newbies like me: try your web page on multiple browsers to make sure it works.
Sorry to waste anyones time. I would delete this thread if I knew how.
When in doubt validate. Validate often. If its not valid the browsers have to guess around, which is even worse than having to deal with slightly wrong interpretations of the standards (hello IE).
Since you're using firefox... get the web developer plugin and the validator plugin for quick checks. But you should still use the w3c validator occassionally. Its directly accessible through tools->validate html (or validate local html)... well, that is if you have the web developer plugin installed.
Thanks - that is a good idea. I never thought about trying a validator since I use vanilla html. But I used a script for google analytics, so I guess I am starting to get a little fancy.
I go to (http://validator.w3.org/) to validate my pages. Then you add this line to your page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
I've also read this helps your Google rating a bit.
I'd also download various browsers and tweak your code a little (there are a few hacks that allow some browsers to see code and others not, easy enough to find on google) as browser interpretation differs even when your code is validated.
Uhm... I dont use css hacks anymore. They are only calling for trouble.
The easiest, quickest and future proof way is to get it working in the good browsers (moz/ff/opera) first. Ensure that its valid. And for specific IE versions you can use seperate override style sheets.
<style type="text/css" media="all">@import "style.css";</style>
<!--[if lt IE 5.5000]><style type="text/css">@import "IE50Fixes.css";</style><![endif]-->
The first line is interpreted by all browsers and the second line is only interpreted by IE. The stylesheet in question (IE50Fixes.css) is only loaded if the version is less then 5.5.
The benefits are that you keep your stylesheet clean, all workarounds are at one specific place and the most important thing is that browsers which are released after your page gone life wont start to interpret the hacks (because there arent any) thus breaking the layout.
Oh and I'm using the xhtml 1.0 strict doctype myself.
I think most users are using IE so if you are using IE compotible css it's OK.
If it happens to look ok-ish with this IE version? Uhm... no, that doesnt do the trick. Usually that means that its more or less broken in 30+% of the browsers. And that it will be likely broken in newer IE versions, too.
Originally Posted by kay.altos
Its the proper way and also the fastest way. Seriously.
Alternatively you can use "oldschool" (dated) table layouts, which are very compatible, but they are damn annoying whenever you need to do some updates. Doing some layout changes often means that you need to redo the markup in several places. Additionally the loading times increase, which may have a negative impact on the first impression. Search engines also may scan your pages less often because your puny little server takes so damn long (relatively) to respond (most spiders are trying to be nice to your resources).
Well, its up to you. I'm using clean markup, because tables are a maintenance nightmare (better loading times are just a nice bonus).