Results 1 to 5 of 5

Thread: 'Narrow' stylesheet

  1. #1
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default 'Narrow' stylesheet

    I've designed a website which is having issues at 800x600. I'm using a 'handheld' stylesheet for PDAs and phones, and I was hoping to find a similarly quick and easy way to modify any screen res under 1024x768. I know that uk.yahoo has a 'narrow' style, as my Q1 tablet picks it up; anyone know how they do this?
    Last edited by marynorn; 02-25-2008 at 12:54 PM.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    You can assign a different CSS stylesheet to different types of "media"

    for a list of media types see http://www.w3.org/TR/REC-CSS2/media.html#media-types

  3. #3
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Yep, I know all about those. I'm using handheld and print stylesheets already. I'm interested in knowing how to have an alternate stylesheet load on detection of an 800x600 screen resolution. I can put in a link saying 'narrow layout', but I'd rather have the page load as narrow.

    Now I come to think about it, that's probably not a CSS problem.

  4. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by marynorn View Post
    Now I come to think about it, that's probably not a CSS problem.

    I guess not...
    You could fix it with CSS though by making your layout fluid.

    DD has some fluid layouts if you need help with the CSS.

    Otherwise, javascript:

    Code:
    <SCRIPT language="JavaScript">
    <!--
    if ((screen.width>=1024) && (screen.height>=768))
    {
     regular css
    }
    else
    {
      narrow css
    }
    //-->
    </SCRIPT>

  5. The Following User Says Thank You to Medyman For This Useful Post:

    marynorn (02-26-2008)

  6. #5
    Join Date
    Oct 2007
    Posts
    43
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Oh, nifty! I hadn't thought of javascript. Thanks.

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
  •