Q: Hi. I'm coding with Ruby On Rails (I don't know if that is relavent though), and currently my site looks completely messed up in Firefox. It only looks normal in IE 7. I plan to fix this in the near future, but for the time being, I don't want it to be even viewable in the other browsers at all. I want a little message to say "Currently only supports IE7" when the website is accessed in some other browser. How do i go about doing this? Thank you for your time.
A: Add this little bit of Javascript to the end of your page: All this does is: if the browser type is not internet explorer, the page is filled with nothing and the user is alerted to the issue. It is also possible to get the browser version as well. So, if it is just IE7 you want, you'll have to add that in as well (google 'javascript navigator version'). Have you tried it with IE6? I'm surprised you say it wont work in Firefox, usually it's IE that messes absolutely everything up. Ask any proffesional web designer. But, here's a tip if you would like it to use all browsers: IE processes normal CSS like 'height:10px;' but it will also process something like '_height:20px;' but Firefox won't. So, if you build your stylesheet with the positionings for Firefox (Opera & other Netscape types) first, and then somewhere after that put the IE values using the underscore hack, you should be able to get the page working. Here's an example. If an absolutely positioned DIV is 10px lower than it should be in IE, you could either set _top as 10px less, or, set _margin-top as -10px -- that way, you can change the other values without having to change this one all the time, making life easier: CSS: #divname{ position:absolute; top:200px; /*which is too low in IE*/ _top:190px; /*this will move it up for IE only*/ } OR: #divname{ position:absolute; top:200px; /*which is too low in IE. It can also be changed any time and IE will follow*/ _margin-top:-10px; /*this will move it 10px up for IE only*/ } It's important to note that the undersored CSS must be after the normal stuff, and, it only applies to IE. Try making a copy of the file to use with firefox only and make it look right, then add all the stuff that's different for IE with underscores in the way mentioned above. Then you should have a fully working stylesheet. Hope that helped, if you need any more, just ask. Google 'CSS tricks' or something and you'll find loads of tips for this sort of thing.
Related items
- Should Websites be held accountable for accessibility levels for physically challenged people?
- How to order the data base on the sequence I want using sql?
- forum customization question?
- what is adobe image ready?
- I Like the FONT within the standard "Text" Documents, what is the name so I can use it in Mic. Works ? ? ? ? ?