Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Media Queries

Media Queries

Scheduled Pinned Locked Moved Web Development
cssdatabasetutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    EvScott
    wrote on last edited by
    #1

    I'm having trouble getting my media queries to work. No matter what media query I write in the CSS file, it just seems to be ignored. An example is as follows:

    @media only screen and (min-width: 320){
    header nav ul li{
    display:block;
    }
    }

    I've got lots of other CSS code in the file but not in media queries. Does everything need to be in a media query?

    W 1 Reply Last reply
    0
    • E EvScott

      I'm having trouble getting my media queries to work. No matter what media query I write in the CSS file, it just seems to be ignored. An example is as follows:

      @media only screen and (min-width: 320){
      header nav ul li{
      display:block;
      }
      }

      I've got lots of other CSS code in the file but not in media queries. Does everything need to be in a media query?

      W Offline
      W Offline
      Wombaticus
      wrote on last edited by
      #2

      Shouldn't your min-width value have a px appended?

      min-width: 320px

      E 1 Reply Last reply
      0
      • W Wombaticus

        Shouldn't your min-width value have a px appended?

        min-width: 320px

        E Offline
        E Offline
        EvScott
        wrote on last edited by
        #3

        Thank you. That solved it. Another problem that I'm finding is that I can't get my menu items centered in the middle of the

        header nav

        and be consistently centered for popular device types. It looks fine of the iPad, but on a Macbook Pro Retina it's more left justified. My base code centers it up nicely on an older LCD DELL 1024 x 768 monitor but the base code has no effect on the Retina. I've coded media queries for iPad min and iPad portrait and landscape and it's all good. Can't figure out what I'm doing wrong.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups