NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page JavaScript: Conditional Firefox CSS

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 06-21-2005, 09:45 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jun 2005
Posts: 15
Albatross is an unknown quantity at this point
 



JavaScript: Conditional Firefox CSS


I have a site that looks fine in Safari and IE6 but suffers from a 1-pixel misalingment in Firefox and Camino. To fix this, I want the page to use a different CSS file if it's Firefox or Camino. I don't know JavaScript myself, though I've done programming in other languages. I got most of this from a book I have, but right now Firefox doesn't load any CSS file at all.
????: NamePros.com http://www.namepros.com/programming/100705-javascript-conditional-firefox-css.html

I have this script before my closing </head> tag:
Code:
<script type="text/javascript">
    var isKHTML = sUserAgent.indexOf("KHTML") > -1
         || sUserAgent.indexOf("Konqueror") > -1
         || sUserAgent.indexOf("AppleWebKit") > -1;'
    var isMoz = sUserAgent.indexOf("Gecko") > -1
         && !isKHTML;
    if(isMoz)
         document.writeIn(<link href="home.css" rel="stylesheet" type="text/css" />);
    else
         document.writeIn(<link href="homecopy.css" rel="stylesheet" type="text/css" />);
</script>
Albatross is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox CSS Problem MasterB Programming 6 06-20-2005 11:23 AM
Portable Firefox dgridley Free Resources 2 04-03-2005 11:34 AM
Wierd FireFox problem! HELP! ChrisK76 Web Design Discussion 8 03-24-2005 07:32 AM
CSS Problems: IE vs. Firefox richid Programming 4 02-01-2005 12:15 PM

Liquid Web Smart Servers  
All times are GMT -7. The time now is 08:29 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger