473,405 Members | 2,294 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,405 software developers and data experts.

Mulriple CSS files for multimple browsers - your comments

Hello all

A new standards based and CSS designed site I recently completed is
soon to go live.

After much testing and tweaking I have fianlly managed to get the site
to look as it should on most browsers on PC, Mac, Unix and Linux
systems. The downside was that I had to use PHP (to detect browser/CSS)
and many CSS files which were tweaked - one for each browser on each
platform and it resulted in quite a few CSS files.

This was the only sensible approach/solution at the time.

I am just interested to know what other peoples views are on this? Im
sure many of you have had to do the same thing as no matter
how hard you try to limit the number of CSS files it just isnt
realistic at this present time.

Have any of you done similar things? Any alternative solutions that
worked or which were effective?

Please discuss.

Many thanks
Chris

Jul 21 '05 #1
19 2855
On 31 Jan 2005 08:07:01 -0800, Chris <ab****@bangor.ac.uk> wrote:
I am just interested to know what other peoples views are on this? Im


If you want a similar rendering il most popular browser, I think it's the
only way.

You can create one single file for both Opera, Gecko, IE 5.5 and IE 6.
Then you'll need a separate file for KHTML-based browsers (Safari,
Konqueror, etc.) if you have a quite complex layout. Purists will always
find a way to have just one CSS file :)

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Discover Opera: http://members.surfeu.fi/jerkku/
http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #2
It's an interesting idea. I've considering using this idea, but have
been able to hack around with CSS to get a *good enough* result in the
major browsers.

Jul 21 '05 #3
On 31 Jan 2005 10:18:04 -0800, ^demon <in************@gmail.com> wrote:
It's an interesting idea.

What is an interesting idea?
I've considering using this idea,

Which idea?
but have
been able to hack around with CSS


What the hack for ;-) ?

What are you talking about / replying to?

--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
Jul 21 '05 #4
On 31 Jan 2005 08:07:01 -0800, Chris <ab****@bangor.ac.uk> wrote:
A new standards based and CSS designed site I recently completed is
soon to go live.

After much testing and tweaking I have fianlly managed to get the site
to look as it should on most browsers on PC, Mac, Unix and Linux
systems. The downside was that I had to use PHP (to detect browser/CSS)
and many CSS files which were tweaked - one for each browser on each
platform and it resulted in quite a few CSS files.

This was the only sensible approach/solution at the time.


I would love to see the site that is so complex it needs several style sheets to
accomodate all kinds of browsers. What's the URL for a sneek preview of your
miracle site?
--
,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
| weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
| webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
|zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
`-------------------------------------------------- --<--@ ------------'
Jul 21 '05 #5
I was talking about the idea of using multiple CSS files for different
browsers. I said that I've been wanting to try it myself, but I'm
usually able to hack around some glitches in CSS to get what I want.

Jul 21 '05 #6
^demon wrote:
I was talking about the idea
Please learn to quote what you are replying to.
http://oakroadsystems.com/genl/unice.htm
of using multiple CSS files for different browsers. I said that
I've been wanting to try it myself, but I'm usually able to hack
around some glitches in CSS to get what I want.


How will you know what browser I am using? No, I am not using
Internet Exploiter, and you will not be able to sniff what I *am*
using. What will your page do then?

Browser sniffing is doomed to failure.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #7
On 31 Jan 2005 10:18:04 -0800, ^demon <in************@gmail.com> wrote:
It's an interesting idea. I've considering using this idea, but have
been able to hack around with CSS to get a *good enough* result in the
major browsers.


Actually there is always a way to have just one CSS file for most
browsers. I've just done a page that renders fine in Opera, IE 5.5 & 6
Win, Mozilla, Konqueror and Firefox. I have only one CSS file, but it take
hell of a time to do the hacks. The whole page with the CSS file are 10KB.
A table-based version of the page is 18KB.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Discover Opera: http://members.surfeu.fi/jerkku/
http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #8
Beauregard T. Shagnasty wrote:
^demon wrote:
I was talking about the idea
of using multiple CSS files for different browsers.
How will you know what browser I am using? No, I am not using
Internet Exploiter, and you will not be able to sniff what I *am*
using. What will your page do then?


Worse yet, what will happen when you get the page from a cache server
instead of from the host server? Or does this browser sniffing business
mean the pages cannot be cached?
Browser sniffing is doomed to failure.


Indeed, it only creates problems, not solves them.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #9
In article <11**********************@c13g2000cwb.googlegroups .com>, absc04
@bangor.ac.uk enlightened us with...

A new standards based and CSS designed site I recently completed is
soon to go live.

After much testing and tweaking I have fianlly managed to get the site
to look as it should
As it *should*?

I bet I break the layout in 3 seconds by increasing the font size on you. ;)
If I can't increase the size as large as I need to, your site is no good to
the visually impaired.
Oh, and you don't *know* what browser I'm using. The string I send to the
server (user_agent) is very fragile and easily modified. Heck, I can fool
Google into thinking I'm using IE when I'm not even using a browser (it won't
let you go right to seach without a user_agent). Opera regularly makes other
sites think it is IE.

I am just interested to know what other peoples views are on this?
If you need that many style sheets for different browsers, you're (or your
client is) expecting too much for the web. Perhaps Flash or an applet would
be more what was in mind. Something that only works for people with browsers
and looks the same every time. Too bad it also doesn't index -- so search
engines won't find it. Not to mention all the other problems with Flash and
applets.

People can use their own style sheets if they don't like yours.
If your site breaks with CSS turned off, you're in trouble when users with
disabilities (or just a strong hatred of the color yellow or something) try
to use your site.
Some sites (personal pages, like LiveJournal) don't have to worry about that.
Most either do or should (but aren't).

Keep in mind that browsers are not the only user agents that can access the
web.
Have any of you done similar things? The only time I needed a separate sheet for a browser was back when I had to
support netscape 4. And what I did was to not give that browser a sheet at
all.
Javascript is a whole 'nother can of worms.
Any alternative solutions that
worked or which were effective?


Make an HTML page of pure markup with no formatting AT ALL. No style. No CSS.
No font tags. Nothing.
That's how it might "look" to someone, including search spiders, PDAs, speech
browsers for the blind, and when someone is surfing with their own CSS sheet.
When it works like that, THEN make it pretty. :)

Oh -- and some of us surf with images turned off and/or with ads redirected
through 127.0.0.1 with Firefox. *heh*

--
--
~kaeli~
A boiled egg in the morning is hard to beat.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 21 '05 #10
On Mon, 31 Jan 2005 14:30:15 -0600, kchayka <us****@c-net.us> wrote:
Browser sniffing is doomed to failure.


Indeed, it only creates problems, not solves them.


I agree, but what will happen when next year Microsoft releases IE7 with
the new release of Windows?
What if the box-model bug is solved and IE treats the box model properly?
Then the box model hack will turn web sites ugly? These are just some
thoughts...

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Discover Opera: http://members.surfeu.fi/jerkku/
http://www.auriance.com - http://www.auriance.net
Jul 21 '05 #11
"Unknown User" <me@privacy.net> wrote:
On Mon, 31 Jan 2005 14:30:15 -0600, kchayka <us****@c-net.us> wrote:
Browser sniffing is doomed to failure.
Indeed, it only creates problems, not solves them.


I agree, but what will happen when next year Microsoft releases IE7 with
the new release of Windows?


Current bets are mostly on their being little improvement to the CSS
support...

Hacks that distinguish between latest versions and older versions
(i.e. the box model hack that distinguishes between IE5 and IE6)
should be safe.

Hacks that distinguish between latest versions of different browsers
are more problematic. e.g. using attribute selectors to distinguish
between IE5/6 and Mozilla, etc. If IE7 supports attribute selectors
but still doesn't support height/min-height properly then a lot of
pages will break.
What if the box-model bug is solved and IE treats the box model properly?


It already does. IE6 gets the box model correct unless you trigger
quirks mode.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #12
Unknown User wrote:
On Mon, 31 Jan 2005 14:30:15 -0600, kchayka <us****@c-net.us>
wrote:
Browser sniffing is doomed to failure.
Indeed, it only creates problems, not solves them.


I agree, but what will happen when next year Microsoft releases IE7
with the new release of Windows? What if the box-model bug is
solved and IE treats the box model properly?


Do you really think they can do that?
Then the box model hack will turn web sites ugly? These are just
some thoughts...


So design your sites so they do not depend on pixel-perfect layout.
<g> My sites all seem to work just fine in your graphical browser,
your text browser, your speech browser, your PDA or mobile phone, and
yes, even in a Redmondian operating system component.

--
-bts
-This space intentionally left blank.
Jul 21 '05 #13
On 31 Jan 2005 08:07:01 -0800, "Chris" <ab****@bangor.ac.uk> wrote:
A new standards based and CSS designed site I recently completed is
soon to go live.
After much testing and tweaking I have fianlly managed to get the site
to look as it should on most browsers on PC, Mac, Unix and Linux
systems. The downside was that I had to use PHP (to detect browser/CSS)


IF you are using server side PHP to "sniff" for browsers, your method is
dead from the start.

There _is_no_way_ to reliably separate one browser request from another
when said request appears at the server.

--
Rex
Jul 21 '05 #14
On Mon, 31 Jan 2005, Chris wrote:
After much testing and tweaking I have fianlly managed to get the
site to look as it should on most browsers on PC, Mac, Unix and
Linux systems. The downside was that I had to use PHP (to detect
browser/CSS)
I'm sorry to have to say this, but that was a completely
counterproductive waste of time. Not only does it not work (in any
real sense), but it'll have serious effects on cacheability.
and many CSS files which were tweaked - one for each browser on each
platform and it resulted in quite a few CSS files.
Painful. And when the dozens of different browsers on the campus of
..gla.ac.uk all access your site via the campus web cache, what's going
to happen?
This was the only sensible approach/solution at the time.


It never was, at any time. You'd have done much better to ask here
first, than to waste all that effort on a dead-end and only then to
ask the group's opinion. So sad.

There are recognised tricks to capitalise on bugs in old browsers and
thus protect them from harming themselves. Beyond that, you can and
should rely on techniques of flexible design to adapt to different
browsers. Is the best advice that I can offer you.

Try http://w3development.de/css/hide_css_from_browsers/ for a start.

Good luck
Jul 21 '05 #15
"Chris" wrote in comp.infosystems.www.authoring.stylesheets:
The downside was that I had to use PHP (to detect browser/CSS)
and many CSS files which were tweaked - one for each browser on each
platform and it resulted in quite a few CSS files.

This was the only sensible approach/solution at the time.


I'm speechless.

If your design is so elaborate that it doesn't look decent in
the major browsers, IMHO it's too elaborate. I don't say it
will look the same in all -- even if it did on your machine it
wouldn't on others because users choose different fonts and
text sizes. But it's a reasonable goal that it look decent
in all.

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
Jul 21 '05 #16
Thanks to all who have provided your imput and comments. Some useful
and some not so...but all appreciated.

Chris
Stan Brown wrote:
"Chris" wrote in comp.infosystems.www.authoring.stylesheets:
The downside was that I had to use PHP (to detect browser/CSS)
and many CSS files which were tweaked - one for each browser on eachplatform and it resulted in quite a few CSS files.

This was the only sensible approach/solution at the time.


I'm speechless.

If your design is so elaborate that it doesn't look decent in
the major browsers, IMHO it's too elaborate. I don't say it
will look the same in all -- even if it did on your machine it
wouldn't on others because users choose different fonts and
text sizes. But it's a reasonable goal that it look decent
in all.

--

Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/


Jul 21 '05 #17
I'm sorry to have to say this, but that was a completely
counterproductive waste of time. Not only does it not work (in any
real sense), but it'll have serious effects on cacheability.

No it wasnt - I learn along the way. :)

t never was, at any time. You'd have done much better to ask here
first, than to waste all that effort on a dead-end and only then to
ask the group's opinion. So sad.

Sad?!!

There are recognised tricks to capitalise on bugs in old browsers and
thus protect them from harming themselves. Beyond that, you can and
should rely on techniques of flexible design to adapt to different
browsers. Is the best advice that I can offer you

yes i understand - but the main reason I had to do separate css files
was due to the way different browsers render the box-model! Im not
alone is this and certainly nort sad!

Jul 21 '05 #18
Chris wrote:

the main reason I had to do separate css files
was due to the way different browsers render the box-model!


If you checked the archives, you would have seen this subject come up
numerous times over the past few years. There is no reason for separate
CSS files. There are many ways to hide CSS from selected browsers by
taking advantage of unsupported features or parsing bugs.

<URL:http://www.dithered.com/css_filters/css_only/index.php>
<URL:http://centricle.com/ref/css/filters/>
<URL:http://w3development.de/css/hide_css_from_browsers/>

And I suggest you get yourself a real newsreader and quit using google
groups to post. Your manual method of quoting leaves a lot to be
desired. If your ISP's news service sucks, then sign up at:
<URL:http://news.individual.net/>

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Jul 21 '05 #19
Browser sniffing is doomed to failure. Indeed, it only creates problems, not solves them.
I agree, but what will happen when next year Microsoft releases IE7
with the new release of Windows? What if the box-model bug is
solved and IE treats the box model properly?
Beauregard T. Shagnasty wrote:
Do you really think they can do that?
Of course, they can do that. They can do it right, just as well as, they
can do it wrong. ;-)

Truth is, there will be NO Internet Explorer 7. Not even any
fixes/enhancements to IE 6. They have broken up their Internet Explorer
development team and spead them out to various parts of the company.

Longhorn will handle web browsing with a new improved product. I believe
they have drawn a line in the sand and will handle browsing from
Longhorn in a responsible, web standards adhering, way. All they need do
is allow an old version of IE run in Longhorn to handle all the kludgie
stuff so if someone absolutely... positively... has to have the the old
crap they can have it. But for the vast majority... the new 'integrated
browser' will be more than adaquate. Also if there are sites which need
to be tweaked to run 'correctly enough' to work in Longhorn... they will
be tweaked to run in Longhorn.
Then the box model hack will turn web sites ugly? These are just
some thoughts...


The box model hack will be handled seamlessly. (just my prediction)
So design your sites so they do not depend on pixel-perfect layout. <g>
My sites all seem to work just fine in your graphical browser, your text
browser, your speech browser, your PDA or mobile phone, and yes, even in
a Redmondian operating system component.


As, well as they will run in Longhorn... (Am I not right???) ;-)

Thanks...

Rich
Jul 21 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
11
by: Dan Rubin | last post by:
HI everyone, lurking for a long time here, since I can usually solve my own problems, but here is one I'm stumped by. I've got a valid XHTML 1.0 Transitional layout, and all the CSS is valid as...
4
by: Jan Steffen | last post by:
Hello everyone, I want to make all links to external sites or special resources (pdf, mailto-links, etc) easily recognizable for all users. Currently I use markup like <a href=".."...
5
by: joaopedrogoncalves | last post by:
Hi, I want to load an external javascript file, get its results and stick them inside a <div> block. I also want to do this in several places on a web page. This way the browser doesn't have...
6
by: Jamal | last post by:
I am working on binary files of struct ACTIONS I have a recursive qsort/mergesort hybrid that 1) i'm not a 100% sure works correctly 2) would like to convert to iteration Any comments or...
2
by: John C | last post by:
I understand how to comment C# source with XML comments, and generate these to an output file. There must be a set of available tools to then take all these XML files and generate a fully...
77
by: VK | last post by:
Randy Webb wrote: > VK said the following on 5/2/2006 9:48 AM: > > If you mean "trying to render it" then FF behavior is the same as for > > all other UA's willing to be in use (and not W3C...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
18
jhardman
by: jhardman | last post by:
Have you ever wanted to upload files through a form and thought, "I'd really like to use ASP, it surely has that capability, but the tutorial I used to learn ASP didn't mention how to do this."? ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.