Topic: StyleSheet per browser? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=22174" title="Pages that link to Topic: StyleSheet per browser? (Page 1 of 1)" rel="nofollow" >Topic: StyleSheet per browser? <span class="small">(Page 1 of 1)</span>\

 
templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 06-14-2004 06:54

Seriously I am fed up with CSS cross-browser issues!! I've tried everything I could, I fix something for IE Opera's mushed up, fix that IE's mushed and to top it all of I fix Mozilla well I don't know why but IE dissappears!! That's why I was wondering if like using JavaScript we can redirect a page according to browser there was a way we could do that with CSS you know like call the appropriate stylesheet according to the user's browser??

I know that would mean some extra work but at least I'll be free of this problem! My client wants me to make a full CSS site and he wants complete cross-browser/platform thingy...

If anyone knows how to do this or if you guys know of any place I go for pointers on cross-browser please do tell me. Oh one more thing what the hell is a meta tag? What's it used for?


Online Portfolio

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-14-2004 09:20

Well... I usually do this with server side scripting, like via php.
There are more than enough php-browser detection scripts on google,
and I assume most browsers (opera at least) won't execute javascript within style sheets.

So long,

->Tyberius Prime

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 06-14-2004 11:36

I can sympathize with your plight, and I'm sure many other inmates can, too. I am curious, though--what exactly are you having difficulties with? It may be that there is a hack that will allow you to get around the problem. Hacks may be a bit distasteful to purists, but we live in an imperfect world, and they're certainly better than having different style sheets for each browser.

Of course, if it is not something that can be sidestepped with a hack, you can always go the php browser detection route mentioned by TP. But before you go looking, let's hear about the problem.

___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup | "Hooray for linguistic idiots and yak milk!"

(Edited by Suho1004 on 06-14-2004 14:55)

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-14-2004 12:32

I'd rather have slightly different style sheets depending on browser than css hacks... you can only conditionally print those parts of the stylesheet that need changing, and this is actually how the grail does it.
Saying something like
if ($browser=="opera")...
is way much cleaner than some obscure css hack that the next guy won't know about.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 06-14-2004 13:07

Separate stylesheets are a possible solution (esp. if you generate it from one server-side file) but it does create more work and nearly all CSS problems are fixable. If you post the offending pages here then we can take a look at them - it may be an easy fix or your whole approach may need tweaking

___________________
Emps

The Emperor dot org | Justice for Pat Richard | FAQs: Emperor | Site Reviews | Reception Room

templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 06-14-2004 14:12

I don't know where to begin with the problems. I know netscape and mozilla don't support div backgrounds but opera too!! I've been through like fifteen layouts for this guy he finally likes one and I can't seem to get it on the web!!! I've been working till late in night trying to get this darn thing to work. other than that it's positioning, doesn't matter what I do I'm bound to mess up somewhere in positioning. It looks a ok on IE boom opera shifts it to the right looks great on opera whoa what a surprise IE shifts it to the left!!! And don't get me started on Mozilla... I view the page in it and it looks like the browsers drunk!

I realize that too many style sheets might be a hassle but what else can guy do! I've read like 50+ positioning and CSS articles and no luck at all.

I'm starting to lose hope in CSS... tables were so nice


Online Portfolio

(Edited by templar654 on 06-14-2004 14:16)

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-14-2004 14:51

I don't know what you mean that netscape mozilla don't support div backgrounds, because they do.

div { background: url('bg.jpg') white no-repeat top left; }

would work in all the browsers I know of, you would then customize them with id or class attributes.

The main problems you will have with the browser being drunk is that you are not specifying your doctype correctly which has the browsers then render the page in quirks mode, which makes things hard to work with.

You will also have the shifting problem though a IE's mishandling of the box model. Do a search on "tantek box model hack" and you will find a solution. Also post a link to the site, that is an easy way to have people offer help.

Using a script to direct to different style sheets is almost never needed. You shouldn't do this as CSS offers a means away from browser detections, they all display so close to dead on that it doesn't make sence to server multiple style sheets.

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 06-14-2004 14:57

Yep, give us a link or something. We'll be better able to help you out if we can see exactly what is going wrong.

___________________________
Suho: www.liminality.org | Cell 270 | Sig Rotator | the Fellowship of Sup | "Hooray for linguistic idiots and yak milk!"

templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 06-15-2004 07:15

Ahh ferget it, I gave it back. Just took the money for the layout. I think the bast***s did it from a friend of mine... using tables!! you can check the site although I doubt you'll be able to see it outside of the country it was hosted in

http://www.metacorps.co.pk/

That table hack was nice though... useful.


Online Portfolio

templar654
Bipolar (III) Inmate

From: Aiur, the Tarsonian Galaxy
Insane since: Apr 2004

posted posted 06-15-2004 15:50

Oh well now that this is done with I neeed to ask, does anyone know how to make a CSS gallery. I've had success with IE, the page looks excellent on it but not on other browsers. Here's what I have, 4 columns like so

[image] [caption] [image] [caption]

here's the link to the page (note I didn't have time to upload the images but you can still see the difference)

http://www.angeltowns.com/members/contours/extras/canvas.htm
(sorry but you'll have copy paste it into the address bar, it's my host)

and here's the stylesheet
http://www.angeltowns.com/members/contours/extras/style.css

any suggestions?


Online Portfolio



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu