SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    change CSS class/id for resolution

    Is it possible to change the class/id of an element based on browser resolution?

    I'm trying to increase or decrease padding values depending on resolution.
    Last edited by isotope235; Jun 20, 2001 at 21:13.

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could set up a browser resolution detector, then give the user a certain stylseheet based on that resolution.

    function detectRes
    if (res == 800x600) {
    document.write("800x600.css")
    } else if (res == 1024x768) {
    document.write("1024x768.css")
    }

    and so on. Just a note, the above is not valid code. I just whipped it up to show you how it might work. I would recommend though against maintaining more than one stylesheet if you can help it. It really defeats the whole purpose of CSS.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes


Bookmarks

Posting Permissions

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