Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Mar 2004
    Location
    Durham, UK
    Posts
    62
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Server-side scripted CSS?

    So I'm sure it should be possible to build your style sheets using asp/php/jsp.... just as you do a normal webpage. So if someone clicks on 'large text' or 'high contrast' you don't have to have loads of css files for every combination but can just change the text size/colour in the stylesheet dynamically.[list=1][*]Is this in fact possible?[*]Is it used much?[*]Is it recommended?[/list=1]
    Cheers

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes it's possible - just make sure you send the right content-type header:
    Code:
    <?php 
    header("Content-type: text/css"); 
    ?>
    "Why bother with accessibility? ... Because deep down you know that the web is attractive to people who aren't exactly like you." - Joe Clark

  • #3
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    for asp you can just change the extention of the css file and do
    <style><!--#include file="style.asp" --></style>
    im not sure if you can just leave it as css and put asp inside it, as it is only writing the contents of the file to an asp page anyway. this works the same as the link tag but the generated html has the style generated into it not just linked in client side


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •