Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 945 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     HTML/XHTML/DHTML/CSS :

Calling Stylesheets for specific browsers

Thread title: Calling Stylesheets for specific browsers
Closed Thread    
    Thread tools Search this thread Display Modes  
06-28-2005, 03:28 AM
#1
mmorales is offline mmorales
Status: Senior Member
Join date: Jul 2004
Location: Vegas
Expertise:
Software:
 
Posts: 929
iTrader: 1 / 100%
 

mmorales is on a distinguished road

Send a message via AIM to mmorales

  Old  Calling Stylesheets for specific browsers

anyone wnat to show me how to define a specfic style sheet for IE or if someone is using a Mozilla one it defaults to another stylesheet?

06-28-2005, 09:27 AM
#2
Geert is offline Geert
Geert's Avatar
Status: Junior Member
Join date: Mar 2005
Location: Belgium
Expertise:
Software:
 
Posts: 67
iTrader: 0 / 0%
 

Geert is on a distinguished road

Send a message via Skype™ to Geert

  Old

Loading an IE only stylesheet is easy: http://www.quirksmode.org/css/condcom.html

06-28-2005, 10:32 AM
#3
Koobi is offline Koobi
Koobi's Avatar
Status: Member
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 312
iTrader: 0 / 0%
 

Koobi is on a distinguished road

  Old

I know a way around PHP.

get_browser() is an easy choice assuming you have browscap.ini installed (see that link for more info.)

if you don't have that file, we can always use regular expressions...but like I said, can you use PHP in the first place and do you have browscap.ini installed?

07-03-2005, 07:05 AM
#4
Travis is offline Travis
Status: Member
Join date: Jul 2004
Location:
Expertise:
Software:
 
Posts: 445
iTrader: 0 / 0%
 

Travis is on a distinguished road

  Old

Unless you specifically want to have mozilla users to see something completely different to IE users and your intention is to make a site work in all browsers you should be able to do this without specifying one or the other.

07-03-2005, 10:21 AM
#5
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Regarding the original post, it is certainly possible but I'm not going to tell you how (there are lots of ways anyway). It is very bad practice to serve up completely different stylesheets depending on the browser being used.

How will you be sure that you've styled all browsers?

Making x number of stylesheets is much more work than making one which works for all browsers (with css hacks, etc).

Why should IE look different from Firefox from Safari from ... .

07-10-2005, 04:30 AM
#6
accessibilitygnu is offline accessibilitygnu
accessibilitygnu's Avatar
Status: I'm new around here
Join date: Jul 2005
Location: South Korea
Expertise:
Software:
 
Posts: 5
iTrader: 0 / 0%
 

accessibilitygnu is on a distinguished road

Send a message via MSN to accessibilitygnu

  Old  Not the best way to skin a cat...

I totally agree with Salathe, when serving up css the only differences should be in the media - screen, print and handheld.

The man hours involved in coding specific stylesheets for different browsers in not cost effective, efficient or desirable. The BEST way to do it is to learn all the best ways to get around the differences in each browsers interpretation of the css and build one screen.css file accordingly.

There are plenty of great examples of standards compliant, non-browser specific css at the awesome http://www.csszengarden.com.

hope that helps,

Ian

07-10-2005, 03:40 PM
#7
moped is offline moped
moped's Avatar
Status: Junior Member
Join date: Jun 2005
Location: Kansas
Expertise:
Software:
 
Posts: 44
iTrader: 0 / 0%
 

moped is on a distinguished road

  Old

All

Though I agree that it is not best practice to call up different CSS per browser, mmorales asked for some assistance. I think it would be best for all of us to provide the answer to the question, then give advice and opinion as to why this is a good/bad idea.

That way he can learn two things and grow as a developer rather than just learn what we think he should learn.

Having said that, I don't know what the best method is since I don't know what your dev environment is.

07-11-2005, 11:57 AM
#8
Koobi is offline Koobi
Koobi's Avatar
Status: Member
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 312
iTrader: 0 / 0%
 

Koobi is on a distinguished road

  Old

Originally Posted by moped
All

Though I agree that it is not best practice to call up different CSS per browser, mmorales asked for some assistance. I think it would be best for all of us to provide the answer to the question, then give advice and opinion as to why this is a good/bad idea.

That way he can learn two things and grow as a developer rather than just learn what we think he should learn.
i agree.
i think sometimes to know the good side of things, you have to know the bad side of things also so that you can compare them and understand for yourself why it is actually good

07-20-2005, 10:09 AM
#9
Ioana is offline Ioana
Ioana's Avatar
Status: Member
Join date: Jul 2005
Location: Cluj-Napoca, Romania
Expertise:
Software:
 
Posts: 202
iTrader: 0 / 0%
 

Ioana is on a distinguished road

  Old

#header {margin-bottom:10px} /* IE */
html>body #header {margin-bottom:20px} /* other browsers */

OR

<style type="text/css">@import url(cssfile.css);</style>

Netscape 4 will display a non-styled version of the site as it can't understand this @import directive.


OR


div#example {

width: 50px !important; /* Firefox */

padding: 2px;

border: 1px solid #FFFFFF;

margin: 10px;

width: 56px; /* IE */

}

This means that internet explorer picks up the width of 56 pixels and firefox will pick up the 50 pixel width giving both the
same appearance.

Closed Thread    


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed