Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Adding Styles

  1. #1
    Regular Coder
    Join Date
    Mar 2006
    Thanked 0 Times in 0 Posts

    Adding Styles

    Ok this realy comprises of two questions.
    Is it possible to create new styles using javascript? So for example a user could enter a custom name and define the properties?
    ie "TEXT1" and then set the background colour to pink and the border to 1px solid, black.

    and is it possible using a loop, to read each style that has been created or modified in to a string or something to send back to an asp page?


  • #2
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Thanked 110 Times in 109 Posts
    I would do that with a php usually i make a script called config.php. This file is a list of all the attributes for the css selectors and some html attributes. This allows me to edit the styles centrally. This is a great solution if all the users of the site are to use those settings.

    However if you are intending on having individuals have different settings then you could achieve this other ways maybe SESSION data or somethings.
    Building a JS solution would work for this solution but not well for a universal config file
    You can not say you know how to do something, until you can teach it to someone else.


    Posting Permissions

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