how do i amend css to optmise for mobile devices

Discussion in 'CSS' started by green4rrow, Jun 30, 2012.

  1. #1
    hi

    how do i change the following css script to show a background image on computers but not on mobile devices? thanks in advance


    BODY {color:#111017;margin:0px;background:#fff;min-width:940px;}
    .bg2_body {height:auto !important;min-height:100%;}
    html, body {height:100%;background:url(../images/skin.jpg) fixed center top;}

    @media screen and (max-width: 1024px)
    html, body {background-image: none;}
     
    Solved! View solution.
    Last edited: Jun 30, 2012
    green4rrow, Jun 30, 2012 IP
  2. sarkar1990

    sarkar1990 Member

    Messages:
    37
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Use media queries in your <head>

    That'll fix it!
     
    sarkar1990, Jun 30, 2012 IP
  3. #3
    You're missing some brackets.

    
    @media screen and (max-width: 1024px) [COLOR="#B22222"][B][SIZE=3]{[/SIZE][/B][/COLOR]
      html, body {background-image: none;}
    [COLOR="#B22222"][B][SIZE=3]}[/SIZE][/B][/COLOR]
    
    Code (markup):
     
    deathshadow, Jun 30, 2012 IP
  4. green4rrow

    green4rrow Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    perfect. thanks deathshadow
     
    green4rrow, Jul 1, 2012 IP
  5. bdkreddyatp

    bdkreddyatp Peon

    Messages:
    136
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think you have missed some brackets. check them thoroughly.at last you must keep close brackets and check for all closed and open brackets.
     
    bdkreddyatp, Jul 8, 2012 IP