SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS margin not changing for device

    The ul list does not reduce its margin value even when I declare in the @media section.

    Code:
    <div id="featured" class="grid col-920">
            
            <div class="grid col-460">
    
                <h1 class="featured-title">My Daily Schedule</h1>                    
                <h2 class="featured-subtitle"></h2> 
                <ul class="mid">            
                <li> walk and feed the dog</li> 
                <li> take out trash  </li>  
                <li>go to school </li>   
                </ul>
    Code:
    #featured ul.mid {
    list-style:square;	
    float:left;
    margin-left: 120px;
    position:relative;
    }
    
    /* smaller devices below */
    
     #featured ul.mid {
        list-style:square;	
        float:left;	 
         margin-left: 5px!important;
        }    
    
    #widgets  {width: 766px;
       }
    	
    }
    
    
    @media and (min-width: 481px) and (max-width: 650px) {
    
      #featured ul.mid {
          display:none;
        }
    
     #widgets {display:none;}
    	
    }

  2. #2
    SitePoint Mentor bronze trophy
    ronpat's Avatar
    Join Date
    Jun 2012
    Location
    NJ, USA
    Posts
    2,469
    Mentioned
    61 Post(s)
    Tagged
    2 Thread(s)
    Delete the "and" from the media query:
    Code:
    @media and (min-width: 481px) and (max-width: 650px) {
    although you probably intended to include "screen" or some other restriction:
    Code:
    @media only screen and (min-width: 481px) and (max-width: 650px) {
    There are several other issues to sort out, but I hope this helps with one.

    lukkas, please click on the link at the bottom of my post and read the part about setting up your example code in a working page. That would be very helpful to both of us.

    Thanks

  3. #3
    SitePoint Addict
    Join Date
    May 2007
    Location
    West Coast
    Posts
    339
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks that worked.
    However, it brought up other problems which I will try and sort out.

    It would be too much code to post.


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
  •