Multiple Style Sheet Selection??

admin

Administrator
Staff member
i am writing separate style sheets for explorer and safari and eventually for other popular browsers. how can i make the user's browser choose the proper style sheet? i am pretty sure this can be done with javascript but there is no forum for that on here so . . .You really shouldn't do that. There should be a way to fix your CSS so it works with all.
But if you need to do a browser check, then your best to use PHP. Ask in the PHP forum. :)You really shouldn't do that. There should be a way to fix your CSS so it works with all.
But if you need to do a browser check, then your best to use PHP. Ask in the PHP forum. :)

all of the stuff i have read about css told me that i would need "work-arounds" for some browsers. i would love to just write the css once. is this really possible? if so, how, whenever i change something to make it work in explorer, it messes up the appearance in safari and vice versa.<!-- m --><a class="postlink" href="http://css-discuss.incutio.com/?page=CssHack">http://css-discuss.incutio.com/?page=CssHack</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.thesitewizard.com/css/excludecss.shtml">http://www.thesitewizard.com/css/excludecss.shtml</a><!-- m -->

Don't bother making your pages pixel-perfect across multiple browsers.<!-- m --><a class="postlink" href="http://css-discuss.incutio.com/?page=CssHack">http://css-discuss.incutio.com/?page=CssHack</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.thesitewizard.com/css/excludecss.shtml">http://www.thesitewizard.com/css/excludecss.shtml</a><!-- m -->

Don't bother making your pages pixel-perfect across multiple browsers.

well, they need to be presentable though . . .Can we see your site? Then maybe we can help you fix your CSS to work in all browsers.Of course they need to be presentable. You don't want any gaps that obviously shouldn't be there.

The good thing is that it is fairly easy to give IE/Win, IE/Mac, and other browsers different rules. Giving different rules to KHTML browsers (like Safari), Mozilla Gecko browsers (like Firefox and Netscape 6+), and Opera 7+ can be tricky.here is the site (best viewed with ie6/win) it is my first css so be gentle ;) it is very basic because my cousin wanted something quickly but learning this is taking longer than i expected.

<!-- w --><a class="postlink" href="http://www.champpestcontrol.com">www.champpestcontrol.com</a><!-- w -->

and the css is attached below. any help would be greatly appreciated.Ugh. Please use .txt instead of .doc in the future.

It is better to design in Firefox and then go back and fix things in IE.

Please validate your HTML. (<!-- m --><a class="postlink" href="http://validator.w3.org/check?verbose=1&uri=http%3A//www.champpestcontrol.com/">http://validator.w3.org/check?verbose=1 ... ntrol.com/</a><!-- m -->)

Difference between box models, doctype switching, etc. (<!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnie60/html/cssenhancements.asp">http://msdn.microsoft.com/library/defau ... ements.asp</a><!-- m -->)
The Box Model Problem (<!-- m --><a class="postlink" href="http://www.communitymx.com/content/article.cfm?cid=E0989953B6F20B41">http://www.communitymx.com/content/arti ... 53B6F20B41</a><!-- m -->)

<!-- m --><a class="postlink" href="http://www.hut.fi/u/hsivonen/doctype">http://www.hut.fi/u/hsivonen/doctype</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.alistapart.com/articles/doctype/">http://www.alistapart.com/articles/doctype/</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.juicystudio.com/choosing-doctype/">http://www.juicystudio.com/choosing-doctype/</a><!-- m -->
<!-- m --><a class="postlink" href="http://www.w3.org/QA/2002/04/valid-dtd-list.htmlplease">http://www.w3.org/QA/2002/04/valid-dtd-list.htmlplease</a><!-- m --> calrify for me the useage of !DOCTYPE. i am under the impression that i can choose which !DOCTYPE to comply with and then write the html/css to fit. is this the case? also, this is the first i've heard of the validating thing. i see what the results are and psuedo-understand them. the strange thing is that it gives me results about lines that are not in the html (at least none that i can find) and it says they are at the bottom of the document. what is that all about?Yes, you can choose which doctype to use and write your markup to fit it, however you should make an informed choice. HTML 4.01 Strict is a good choice if you don't want to use <iframe>s and other deprecated elements and attributes.

Your server is adding this to the bottom of your page.
<!-- text below generated by server. PLEASE REMOVE --><!-- Counter/Statistics data collection code --><script language="JavaScript" src=http://www.webdeveloper.com/forum/archive/index.php/"http://hostingprod.com/js_source/geov2.js"></script><script language="javascript">geovisit();</script><noscript><img src="http://visit.webhosting.yahoo.com/visit.gif?us1123101814" alt="setstats" border="0" width="1" height="1"></noscript>
<IMG SRC=http://www.webdeveloper.com/forum/archive/index.php/"http://geo.yahoo.com/serv?s=76001405&t=1123101814" ALT=1 WIDTH=1 HEIGHT=1>HTML 4.01 Strict is a good choice if you don't want to use <iframe>s and other deprecated elements and attributes.

Your server is adding this to the bottom of your page.


ok thanks. so does that mean that most browsers will read it properly or do i still have to fix certain things? if so, is there a resource that will list specific probs or do i just have to find them and figure them out? one last question, how did youfind that code that the server is adding? normally i edit with GoLive which won't ever tell me that it's there but i even logged into my webhost server and looked at the page with the built-in editor and i still couldn't see it.

thanks for all of your help kravvitz (and others)You're welcome :)

Lose the WYSIWYG editors.

I viewed the page's source and that was at the very bottom.

Unfortunately browsers have so many wierd bugs that valid X/HTML and CSS aren't enough. You will need to test in as many browsers as you can to assure that your page doesn't look like abstract art.You're welcome :)

Lose the WYSIWYG editors.

I viewed the page's source and that was at the very bottom.

Unfortunately browsers have so many wierd bugs that valid X/HTML and CSS aren't enough. You will need to test in as many browsers as you can to assure that your page doesn't look like abstract art.

so, what should i use to edit? just a simple text editor? GoLive seems to be pretty inoccuos since you can code as you like with it and it also allows me a very simple ftp upload function. is there a reason why you say not to use them? and finally, i am brought back to my initial problem. which is, how do i make my page look nice in as many browsers as possible? right now it looks fine in ie/win but not in safari. i figure i should at least cover the machine standard browsers.WYSIWYG editors tend to produce low quality code.

I recommend the editors in the first section of this page (not the "graphical web page generators" (WYSIWYG) ones listed near the end of the page) (<!-- m --><a class="postlink" href="http://css-discuss.incutio.com/?page=CssEditors">http://css-discuss.incutio.com/?page=CssEditors</a><!-- m -->) and my current editor of choice, Syn Text Editor (<!-- m --><a class="postlink" href="http://syn.sourceforge.net/">http://syn.sourceforge.net/</a><!-- m -->).

Before worrying about Safari, make sure that Firefox and Opera display your page the way you intend it to look. Making complicated cross-browser tableless layouts takes experience.I would say, design for Firefox, then improve in Opera. After that, it should work in Safari, and if you're lucky, in Netscape too.
Then, you'll have to do workarounds for IE, and IE for mac. But don't worry, these are easy to do.
Don't hesitate to post here, we'll help you.most of the people in my "audience" are using "stock" browsers. so i figured if i cover ie and safari i would be fine. please tell me if i am wrong but i am pretty sure that the general public is not buying alternate web browsers.Why do you want to buy them ???
I have Opera, Maxthon, Netscape and FF, and I didn't buy them !!!for some reason i thought they were not free. anyhow, does ff/mac work the same as ff/win (same question for opera)? in otherwords, if i verify them on my mac and they look fine in ff will they look the same on a pc in ff?Almost always the different OS versions of Firefox and Opera will render the same. They don't use different engines like IE/Win and IE/Mac do.

The free version of Opera is Adware, but it's well worth being able to use a browser that is better than IE for free, though I prefer Firefox myself and only use Opera for testing.

Safari has some wierd bugs, so it's good to make sure that it's not an IE vs. W3C specs issue by checking in Firefox and Opera.I would say the worst of all is IE for mac.
Even if your site works in every existing browser, it will never work on IE for mac...
 
Back
Top