There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer bios black screen blue screen blue screen of death boot computer connection crash css dell display driver drivers email error excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking outlook outlook 2003 outlook express partition password printer problem router slow software sound startup trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Different CSS For Firefox And Internet Explorer


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
TW.87's Avatar
Senior Member with 308 posts.
 
Join Date: Dec 2005
Location: Canberra, Australia
Experience: Intermediate
13-Sep-2006, 01:25 AM #1
Arrow Solved: Different CSS For Firefox And Internet Explorer
If I have a tag like this:
Code:
<div class="Box1">Content</div>
Is there a way to have it use the "Box1" class from the CSS differently depending on the Internet browser? For example, is there a way to have the "<div>" use the "Box1" class if the Internet browser is Internet Explorer, while it would use the "Box2" class if it was Firefox?

The reason I need this is that I have a "<div>" element that is being displayed slightly different in the two Internet browsers, and with a small adjustment in the CSS, it can look identical. The problem is that the small adjustment does not remedy the issue unless I can find a solution like I have described above.

Any help would be appreciated.
watchintv's Avatar
Computer Specs
Senior Member with 128 posts.
 
Join Date: May 2005
Location: The Left-Coast
Experience: Web Designer
13-Sep-2006, 04:13 AM #2
Well, you could use a CSS hack I suppose, but I don't reccommend using one becuase it will probably break in IE 7. Another alternative is to use two stylesheets, one for IE and one for Firefox. While this does make broswer compatibility easier, it also means that if you are changing your code or doing CSS work, you will need to apply the changes to each stylsheet. Which may or may not be a hassle to you unless your working with a large stylesheet. The other downside is this will also require more HTTP requests, but this is usually not a problem. These are just the two ways I know to correct browser compatibility issues, there may be more ways though.
thecoalman's Avatar
Computer Specs
Distinguished Member with 2,503 posts.
 
Join Date: Mar 2006
Location: Pennsylvania
Experience: What's the shiny red button for? <click>
13-Sep-2006, 04:36 AM #3
Adding a nderscore before a property will hide it from everything but IE.

Quote:
DIV
{
_width: auto;
}
There's probably one for FF too but I never looked. I get things working right in FF first then fix IE. If you post your code it might be something simple to fix.
TW.87's Avatar
Senior Member with 308 posts.
 
Join Date: Dec 2005
Location: Canberra, Australia
Experience: Intermediate
24-Sep-2006, 09:14 AM #4
Okay, thank you! I'll give that a go and see where it takes me.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 03:48 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.