SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2011
    Location
    Trinidad and Tobago
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Testing screen size

    I want to use css 3 to use smaller images once the screen size is less than 800px x 600px how can I do that in css3?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,203
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    You can't really, unless perhaps you are setting them as background images. Otherwise, you'll have to use something like JavaScript.

  3. #3
    SitePoint Zealot
    Join Date
    Aug 2011
    Location
    Trinidad and Tobago
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found what am looking for online here http://www.ilovecolors.com.ar/detect...ize-css-style/ you are correct I need some sort of javascript to test the screen size to switch css3 files

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,203
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Switching CSS3 files is a different issue from swapping images, though. You could use CSS3 media queries to change the styling of the page based on screen size, but not change the images in the HTML (apart from setting them to display: none or something, which is a rotten idea, because mobile users still have to download them.

    There are some scripts out there that load different images based on screen size, such as:

    http://adaptive-images.com/
    http://filamentgroup.com/lab/respons..._image_sizing/
    http://css-tricks.com/which-responsi...hould-you-use/
    http://adactio.com/journal/4997/
    http://www.alistapart.com/articles/r...-what-we-need/

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2011
    Location
    Trinidad and Tobago
    Posts
    194
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    excellent 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
  •