473,387 Members | 1,585 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to use JavaScript to select a particular CSS file depending on the browser

Hi does anybody know how to use JavaScript to detect a browser, and as a result, select the appropriate CSS file to match with that browser?

I know an if statement can be used for Internet Explorer like so..

Expand|Select|Wrap|Line Numbers
  1. <!--[if IE]>
  2.     <link rel="stylesheet" type="text/css" href="ie.css" />
  3. <![endif]-->
  4.  
But I would like to use JavaScript to detect I.E, Firefox and Chrome as I have created three separate CSS files for these three different browsers for my website.
Apr 26 '11 #1
1 1903
Dormilich
8,658 Expert Mod 8TB
I don’t see a need to differentiate between FF & Chrome …

on the other hand side you can use the CSS modifyers for Mozilla (-moz-) and Webkit (-webkit-) to feed specific CSS. e.g. -moz-border-radius
Apr 27 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: JeffFinnan | last post by:
Is there a way Netscape 4.x can be forced to select a particular file extension other than the default .html? =============================== <form name=form1> <input type=file name="fileN">...
7
by: Roger Withnell | last post by:
I would like to check that an image file, selected by a user using fileUpload, is within certain parameters (width, height, filesize) and to display the image file so that the user can see the...
1
by: Dan Kean | last post by:
Hi all, how can I bring a file browser up to select a file then send the path to a textbox and display it (will be image file) also can I limit extensions to *.bmp etc? thanx for any help!...
1
by: Mei Qin | last post by:
Hello, I created a csv file on the server. I want to display it in the browser and user can download the file to local machine. Then I will delete the file from the server. Here is my code:...
2
by: rinku | last post by:
Hi, I am using smarty but I am unable to write javascript in tpl file ..If i write javascript then it gives error. How can i do it and how can i define a variable in .tpl file.
8
by: VinayKumarParakoti | last post by:
Hi all, I am new to this site and this is my first post. But this issue is of high priority. I am trying to print pdf file in browser using perl script. Onclick on hyperlink a child window...
5
by: skyy | last post by:
Hi.. I am trying to create a perl-cgi script to make a upload page such that when the user select a file using the "Browse" button, the filename will appear on another textbox. i understand...
0
by: Jason Huang | last post by:
Hi, In my C#.Net 2.0 web application, the web ServiceWeb application is running on the C:\Inetpub\wwwroot\MyWeb folder. I have another file server which store the files for downloading, through...
0
by: krishnaneeraja | last post by:
Hi, In my application,user not allow to de select particular row in gridview.Already i set a property allowusertoaddrows to false,selectionmode to fullrowselect.But in gridview,highlight row hold...
1
by: madhuriks | last post by:
hi, i developed xml file..i want to view that xml file in browser...but im unable to do..it is showing in console..but i need is in browser..can any one help me out..here is my code..its urgent....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.