HighDots Forums  

Stylesheet question

alt.html alt.html


Discuss Stylesheet question in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Samuël van Laere
 
Posts: n/a

Default Stylesheet question - 11-02-2003 , 08:15 AM






Currently i offer 4 stylesheets,
the user can use the php based style switcher to select a different
stylesheet. (code was found on this group )

Do i also need to link the stylesheets in the html as alternate stylesheet?

Or isn't there any need, since i allready offer a way of picking a different
stylesheet?



--
With regards,
Samuël van Laere
the Netherlands
http://www.fortron.net




Reply With Quote
  #2  
Old   
Fabian Neumann
 
Posts: n/a

Default Re: Stylesheet question - 11-02-2003 , 09:11 AM






Am 02.11.2003 14:15 schrieb Samuël van Laere:
Quote:
Do i also need to link the stylesheets in the html as alternate stylesheet?

Or isn't there any need, since i allready offer a way of picking a different
stylesheet?
There is no need for that in technical sense. But Mozilla(Firebird)
users will be happier, since their browsers offer to change style sheets
based on the <link>-tag in your HTML code, without having to use your
PHP script.

So if you can offer it, do it.

Fabian



Reply With Quote
  #3  
Old   
Lauri Raittila
 
Posts: n/a

Default Re: Stylesheet question - 11-02-2003 , 09:13 AM



In article Samuël van Laere wrote:
Quote:
Currently i offer 4 stylesheets,
the user can use the php based style switcher to select a different
stylesheet. (code was found on this group )
OK.

Quote:
Do i also need to link the stylesheets in the html as alternate stylesheet?
It wouldn't do much harm.

Quote:
Or isn't there any need, since i allready offer a way of picking a different
stylesheet?
Not with current implementions of browsers, on normal situations.

I don't think multible stylesheets for same media are usefull exept maybe
when there is some idiot boss somewhere that demands bells and whisles,
and only way to get reasonable style is to do it using alternate
stylesheet (and then look server logs in hope alternate stylesheet will
be used more than default).

Of course, there is exeptions.


Of course, if one aim is to learn how to make stylesheets, it doesn't
hurt to put them in use. But for webpage, it usually is more usefull to
add more content.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Saapi lähettää meiliä, jos aihe ei liity ryhmään, tai on yksityinen
tjsp., mutta älä lähetä samaa viestiä meilitse ja ryhmään.



Reply With Quote
  #4  
Old   
Toby A Inkster
 
Posts: n/a

Default Re: Stylesheet question - 11-02-2003 , 12:03 PM



Fabian Neumann wrote:

Quote:
There is no need for that in technical sense. But Mozilla(Firebird)
users will be happier, since their browsers offer to change style sheets
based on the <link>-tag in your HTML code, without having to use your
PHP script.
Ditto regular Mozilla, ditto Opera, ditto Konqueror[1].

*However* a PHP style switcher is in many ways *better* than just relying
on rel="alternate stylesheet", as browsers don't[2] carry over the choice
of an alternate stylesheet when you go on to the next page :-(

Of course, *best* is to offer both. (Which I do)

[1] Konqueror 3 does funny things with alternate style sheets. When a list
of alternate stylesheets is given, it uses the first one by default! I
have yet to add a workaround to my site, although I do plan to do so[3].
Safari does not suffer from this bug. More details here:
http://bugs.kde.org/show_bug.cgi?id=54335

[2] Except Konqueror.

[3] I generally don't work around bugs in browsers, but the fix should be
pretty easy.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132



Reply With Quote
  #5  
Old   
Michael Wilcox
 
Posts: n/a

Default Re: Stylesheet question - 11-02-2003 , 05:42 PM



Fabian Neumann <news.for.pporg (AT) spamgourmet (DOT) org> wrote:
Quote:
But Mozilla(Firebird)
users will be happier, since their browsers offer to change style
sheets based on the <link>-tag in your HTML code
What exactly is this code?
--
Michael Wilcox
mjwilco at yahoo dot com
Essential Tools for the Web Developer - http://mikewilcox.t35.com




Reply With Quote
  #6  
Old   
Samuël van Laere
 
Posts: n/a

Default Re: Stylesheet question - 11-02-2003 , 05:55 PM




"Toby A Inkster" <UseTheAddressInMySig (AT) deadspam (DOT) com> schreef in bericht
newsan.2003.11.02.17.02.58.928783 (AT) goddamn (DOT) co.uk...
Quote:
Fabian Neumann wrote:

There is no need for that in technical sense. But Mozilla(Firebird)
users will be happier, since their browsers offer to change style sheets
based on the <link>-tag in your HTML code, without having to use your
PHP script.

Ditto regular Mozilla, ditto Opera, ditto Konqueror[1].

*However* a PHP style switcher is in many ways *better* than just relying
on rel="alternate stylesheet", as browsers don't[2] carry over the choice
of an alternate stylesheet when you go on to the next page :-(

Of course, *best* is to offer both. (Which I do)

[1] Konqueror 3 does funny things with alternate style sheets. When a list
of alternate stylesheets is given, it uses the first one by default! I
have yet to add a workaround to my site, although I do plan to do so[3].
Safari does not suffer from this bug. More details here:
http://bugs.kde.org/show_bug.cgi?id=54335

[2] Except Konqueror.

[3] I generally don't work around bugs in browsers, but the fix should be
pretty easy.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

Fabian and Toby,
thanks for the answers they are mosy usefull.
What kind of workaround could i use?
I wonder if i should bother anyhow, the next build/version is likely to
solve that isue right?



--
With regards,
Samuël van Laere
the Netherlands
http://www.fortron.net




Reply With Quote
  #7  
Old   
Samuël van Laere
 
Posts: n/a

Default Re: Stylesheet question - 11-02-2003 , 06:01 PM




"Toby A Inkster" <UseTheAddressInMySig (AT) deadspam (DOT) com> schreef in bericht
newsan.2003.11.02.17.02.58.928783 (AT) goddamn (DOT) co.uk...
Quote:
Fabian Neumann wrote:

There is no need for that in technical sense. But Mozilla(Firebird)
users will be happier, since their browsers offer to change style sheets
based on the <link>-tag in your HTML code, without having to use your
PHP script.

Ditto regular Mozilla, ditto Opera, ditto Konqueror[1].

*However* a PHP style switcher is in many ways *better* than just relying
on rel="alternate stylesheet", as browsers don't[2] carry over the choice
of an alternate stylesheet when you go on to the next page :-(
--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132

I'm using the script you wrote Toby (i think) it works great



--
With regards,
Samuël van Laere
the Netherlands





Reply With Quote
  #8  
Old   
David Graham
 
Posts: n/a

Default Re: Stylesheet question - 11-04-2003 , 07:48 AM



Quote:
I'm using the script you wrote Toby (i think) it works great

Any chance of making it available for me.

thanks
David




Reply With Quote
  #9  
Old   
Toby A Inkster
 
Posts: n/a

Default Re: Stylesheet question - 11-04-2003 , 02:19 PM



Owen Jacobson wrote:
Quote:
Samukl van Laere wrote in alt.html:
Hello David,
This is the code as it was published by Toby:
============================ example.php =============================
!DOCTYPE whatever
?php
$s = $_GET['style'];
if (!($s)) { $s = 'red'; }
?
[snip]
link rel="stylesheet" type="text/css" media="screen,projection"
?php echo ' href="styles/' . $s . '.css"'; ?
[snip]
One might note that there's a potential security issue with allowing
the user to put anything they want in the $s variable.
There is no security issue. So what if the user puts something odd in $s?
It's not like I did an "include($s)".

[newsgroups set back to include alt.html, as I don't read comp.lang.php --
PHP sucks]

--
Toby A Inkster BSc (Hons) ARCS
Contact Me - http://www.goddamn.co.uk/tobyink/?id=132



Reply With Quote
  #10  
Old   
R. Rajesh Jeba Anbiah
 
Posts: n/a

Default Re: Stylesheet question - 11-05-2003 , 12:08 AM



Toby A Inkster <UseTheAddressInMySig (AT) deadspam (DOT) com> wrote


<snip>

Quote:
[newsgroups set back to include alt.html, as I don't read comp.lang.php --
PHP sucks]
Then why stay here? Just get lost out of PHP.

---
"If there is a God, he must be a sadist!"
Email: rrjanbiah-at-Y!com


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.