rh-penguin Posted April 29, 2007 Share Posted April 29, 2007 Can someone please tell me if there is a way of having different css for IE and FF in the same css file, for the same div? (Opera too maybe) I have a navigation bar which in IE gets displayed a bit higher and a bit more to the right then it should be. Maybe there is some other way to fix this?; Any fix would help really ....... Thanks! Quote Link to comment Share on other sites More sharing options...
yellowepi Posted April 29, 2007 Share Posted April 29, 2007 I'm still fairly new to programming, but have monkeyed around with css a little. To me it would be easier to seperate the files out so they are specific to the browser and then use browser detection with if else function to reference to the correct css sheet. That way if you want to make a change you go to the browser you want to change and change it instead of working your way through all of the code that is intermixed. I think it would be a little laborious to work through using the css divs-i think you could potentially do it with if functions, but all individually and would take longer in my opinion. Quote Link to comment Share on other sites More sharing options...
rh-penguin Posted April 29, 2007 Author Share Posted April 29, 2007 Ye i guess i could do that. The only downside to that is, sometimes the browser maybe not be detected correctlly or detected at all. Its a good idea and ill keep that in mind, thanks! Anyone else think of something different? Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 29, 2007 Share Posted April 29, 2007 Stick with a single CSS file. Anything else is going to be a maintenance headache. Solve browser-specific issues by conditional CSS if you can't code to make appearances identical(ish). Quote Link to comment Share on other sites More sharing options...
rh-penguin Posted April 29, 2007 Author Share Posted April 29, 2007 Solve browser-specific issues by conditional CSS if you can't code to make appearances identical(ish). I found an article which suggests something like this: .ie .example { background-color: yellow; } But it dont seem to work...... can you see anything wrong in that code? Quote Link to comment Share on other sites More sharing options...
AndyB Posted April 29, 2007 Share Posted April 29, 2007 Try here -> http://www.quirksmode.org/css/condcom.html Quote Link to comment Share on other sites More sharing options...
rh-penguin Posted April 30, 2007 Author Share Posted April 30, 2007 Nice! Thanks ofr that! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.