Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2013
    Location
    Serbia
    Posts
    29
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Rules in Media Querie have no effect

    Hi everybody,

    I'm doing some research on media queries, and I'm having issue with repeated selectors. They don't seem to have effect if they are already set in a given div ID. What do I mean by that?

    Let's say we have a div named "wrapper", its background is set to red, in media query I want it to be blue under specific res, but it has no effect. Color remains red when res changes. I'm beginning to wonder why is that? A tip on how to solve this would be great, thanks in advance!

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,438
    Thanks
    23
    Thanked 630 Times in 629 Posts
    What the hell is res?

    Code:
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  <!--MAYBE YOUR MISSING THIS-->
    <title>Guide</title>
    <style type="text/css">
    #wrapper{
    	background-color: blue;
    }
    @media (min-width: 500px) {
    #wrapper{
    	background-color: red;
    }
    }
    </style>
    <body>
    <div id="wrapper">I start out red</div>
    </body>
    </html>
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • Users who have thanked sunfighter for this post:

    cluster381 (09-26-2013)

  • #3
    Regular Coder
    Join Date
    Mar 2013
    Posts
    262
    Thanks
    4
    Thanked 67 Times in 67 Posts
    "res" is probably resolution. Lol. But there are a million reasons why it might not be working. We need some code.
    My signature :)

  • #4
    Regular Coder Nerevarine's Avatar
    Join Date
    Jan 2013
    Location
    Phendrana Drifts, Tallon IV, W-Class
    Posts
    285
    Thanks
    0
    Thanked 17 Times in 17 Posts
    Code or a live link to your page is necessary in order to receive help. You may want to look at this as well.

    http://www.codingforums.com/showthread.php?t=233356
    Time kills us in our sleep and we watch it happen in our dreams. -K.K.
    THE END-ALL PROGRAMMING REFERENCE: CLICK HERE (Courtesy of Major Payne)
    My username was previously L0adOpt1c. :: Please read this before posting in the HTML/CSS forum.
    Validate your HTML here and your CSS here. :: Need basic HTML/CSS tutorials? Click here, don't post about it.

  • #5
    New Coder
    Join Date
    Jun 2013
    Location
    Serbia
    Posts
    29
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Yes, res stands for resolution. Sorry about that...
    You were right in your html comment, I did miss meta tag line. Everything works now, thanks very much!


  •  

    Tags for this Thread

    Posting Permissions

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