Media queries keep overwriting eachother

I have a created two media queries. However when I edit one, the other is over written with the previous media query's properties. I have noticed that the primary html div holds the class of whatever the most recently edited media query is.  Can someone please give me some idea of what is happening?
Here is an example of the html:
<div class="mainGraphic">
<img src="images/home_scholarship.jpg" alt="" class="mainGraphic" /></div>
<div class="mainContent">
<div class="bannerHome"><img src="images/banner_iphone6.png" alt="" class="bannerSmall750" /></div>
<div class="bannerHome"><img src="images/banner_tv.png" alt="" class="bannerSmall750-2" /></div>
<div class="bannerHome"></div>
<div class="bannerHome"><img src="images/banner_internet.png" alt="" class="bannerSmall750-3" /></div>
<div class="bannerHome"><img src="images/banner_tvonmyside.png" alt="" class="bannerSmall750-4" /></div>
  </div>
Here is an example of the CSS:
@media screen and (max-width:750px){
.mainContent {
  padding-top: 5px;
.bannerSmall750 {
  width: 182px;
  margin-left: -15px;
.bannerSmall750-2 {
  width: 172px;
  margin-left: -10px;
.bannerSmall750-3 {
  width: 177px;
  margin-left: -15px;
.bannerSmall750-4 {
  width: 173px;
  margin-left: -15px;
.mainBanner750 {
  width: 750px;
#container {
  width: 750px;
  height: auto;
  margin-top: 1px;
  margin-right: auto;
  margin-left: auto;
  text-align: left;
  padding-left: 1px;
  background-color: rgba(255,255,255,1.00);
  -webkit-box-shadow: 0px 0px 18px hsla(0,0%,14%,1.00);
  box-shadow: 0px 0px 18px hsla(0,0%,14%,1.00);
.mainGraphic {
  width: 750px;
  height:
@media only screen and (max-width:480px){
.mainContent {
  padding-top: 5px;
.mainBanner480 {
  width: 380px;
  height:170px;
#container {
  width: 480px;
  height: 780px;
  margin-top: 1px;
  margin-right: auto;
  margin-left: auto;
  text-align: left;
  padding-left: 1px;
  background-color: rgba(255,255,255,1.00);
  -webkit-box-shadow: 0px 0px 18px hsla(0,0%,14%,1.00);
  box-shadow: 0px 0px 18px hsla(0,0%,14%,1.00);
.headerLogo {
  margin-bottom: 10px;
  margin-top: -16px;
  padding-left: 113px;
  padding-top: px;
  padding-bottom: 15px;
.headerLinks a {
  text-decoration: none;
  color: rgba(208,208,208,1.00);
  padding-left: 0px;
  font-size: 14px;
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, sans-serif;
  padding-right: 34px;
  right: -69px;
  bottom: -92px;
  position: relative;
  margin-right: 7px;
  margin-left: -42px;
.mainGraphic {
  width: 480px;
  height:
.mainContent .bannerHome img1 {
.mainContent .bannerHome img2 {
  width: 200px;
  margin-left: 50px;
.mainContent .bannerHome img3 {
    width: 200px;
  margin-left: 20px;
.mainContent .bannerHome img4 {
width: 200px;
  height:286px;
  margin-left: 40px;
.smallBanner480-1 {
  width: 200px;
  height:296px;
  margin-left: 30px;

Wow, had I known I wouldn’t have updated either. I always thought updates were good.
Okay, so I already have my overall html codes and divs completed.
So I go to the CSS Designer panel, select my primary css file under ‘Sources’. 
I select the ‘@Media panel and select the ‘plus’ sign to add new media queries. I define my media queries of screen and (max-width:768px) and screen and(max-width:480px).
Once that’s done and they show up under the  ‘@Media’ panel, I go back to select my primary css file under the ‘Sources’ panel. Select ‘global’ under the ‘@Media’ panel and choose the selector I want to target.
I select .mainGraphic and right click to select ‘Duplicate into media query’ then choose my first target of ‘screen and  (max-width:768px)
Once I see that selector in my ‘screen and (max-width:768px) query I begin to apply different properties to it to make it adjust as desired.
I follow the same procedure with duplicating into the ‘screen and (max-width:480px)’ query and adjusting to properties as desired.
This is when I notice from switching back to my first designed query that the changes made in the 480px are now on the 768px query and vice versa.

Similar Messages

  • Responsive Background Images with Media Queries

    Hello,
    I'm creating a mobile website in Dreamweaver and would like to use an image which will change with different device widths.  I'm using media queries with background images.  My problem is that in order for the background images to display, I need to assign a height to the div.  When the image is scaled down the height stays static, leaving white space beneath it.  There will be content below the image so the white space will push it down and look wrong.  Is there a way to use multiple images with media queries keeping the height responsive?  Thank you!
    @media screen and (max-width: 1024px) {
    #mainImage {
              background-image: url(../images/mainImageLarge.jpg);
              background-repeat: no-repeat;
              background-position: center top;
              background-size: 100%;
              height: 272px;
              border-top-width: 3px;
              border-top-style: solid;
              border-top-color: #FFF;
    @media only screen and (max-width : 480px) {
    #mainImage {
              background-image: url(../images/mainImageMed.jpg);
              background-repeat: no-repeat;
              background-position: center top;
              background-size: 100%;
              height: 107px;
              border-top-width: 3px;
              border-top-style: solid;
              border-top-color: #FFF;
    @media only screen and (max-width : 320px) {
              #mainImage img {
              background-image: url(../images/mainImageSmall.jpg);
              background-repeat: no-repeat;
              background-position: center top;
              background-size: 100%;
              height: 150px;
              border-top-width: 3px;
              border-top-style: solid;
              border-top-color: #FFF;

    Like this example:
    http://alt-web.com/FluidGrid/Fluid-4.html
    METHOD:
    Insert 2 images -- one for desktops and one for mobile.  Assign classes to each image. 
    <img id="banner" class="desktop" src="desktop_image.jgp" />
    <img id="banner" class="mobile" src="mobile_image.jpg"/>
    In your CSS, use display:none and display:block to show/hide.
    .desktop {
        display:block;
    .mobile {
        display:none;
    /* Special Rules for mobiles */
    @media only screen and (max-width: 480px) {
        .desktop {display:none}
        .mobile {display:block}
    Feel free to set your break points however you wish.
    Nancy O.

  • Dreamweaver CC How to edit styles across media queries and sizes

    I am creating a fulid grid/responsive website, using the standard Media queries offered by Dreamweaver CC when I start a new document.
    I have creative several DIVs to sturcture my page.
    I don't understand how to apply changes between the various media queries.
    Frist, I see you can drag the width of the boxes to adust how wide you want the portions to be. That I get. But what I don't understand is to apply different formatting/styles in the different screen sizes. There used to be a box that would pop up when you wanted to create a new class. Now I can't figure out which version of the screen to work in and how to make changes ONLY to one screen size.
    Here's an example of what I want to do:
    The main portion of my website has 4 categories, that I would like the user to be able to choose from to click on.
    On the mobile view, I want the image align left, text to the right of that, aligned left, and for the  background of each category to be the same color so that it looks like one big button on mobile.
    On tablet and desktop view, I want the image centered within the DIV, then the text centered under each image. I want the graphic image (which is in a circle) to stand out on a white background.
    In the tablet view, I have it organized by 2 rows and 2 columns.
    In the tablet view, I have it organized by 1 row and 4 columns.
    I hope this make sense.
    How do I signifyand create these changes? I have tried entering it in the code. That just seems to center it every image in every DIV (remember I want it aligned left in mobile) Or I tired entering it on the code in another way and that centered the image across the whole page, not just the DIV. HOw do I work around these problems? Do I need to make them all a class instead of a DIV? I am really confused....
    Please be nice as I am obviously a bit of a beginner and struggling with this basic concept. I appreciate any guidance or help that anyone has to offer.

    #1 Build mobile first.  Everything else is based on that primary layout.  Don't worry so much about content yet.  Just get your mobile layout in order.  Then build tablet and finally desktop.
    #2 Do not tamper with code in your FluidGrid.css or Boilerplate.css files.  These files are temperamental.  Use a separate external style sheet for your content styles.   That way if you do something wrong, it won't break the whole layout.
    #3 Keep your layout structure simple and uncomplicated.  No tables, no positioned elements.
    #4 Everything needs to be inside the <gridContainer> div.  If it's not, it won't be responsive.
    Nancy O.

  • Change the order of boxes in different media queries

    How can I change the order of boxes in different media queries?
    Is the only work around to copy one box to the other order position and switch the Display attribute in the different media queries?

    Hi, thanks for your question. Reflow follows the rules of CSS and HTML. There is not a way to swap or move objects in the DOM without using something like Javascript. We've avoided that, and only focus on CSS and HTML with Reflow.
    Yes, you can use multiple boxes in different places and change their display as needed. But I might caution against doing this as it may add work for both you and anyone else that may take this design and put it into production. I might take a look at why you want to move the boxes around, and maybe find a simpler or more efficient design pattern to follow to get a result you would be happy with. Hope that doesn't sound preachy, you should try it if you want and don't listen to me. Either way, let me know how it goes!

  • IPhone Not Recognizing Media Queries

    http://www.sandiegohomegrown.com/testSDTG/
    This is my first RWD site and is a work in progress.  I have been testing it on emulators, google's "view responsive layouts", ipad, and it all works - albeit it's not done.  I tried it finally on my iPhone and it seems to not be recognizing my media queries.  I can dsplay:none in the media queries and it makes no difference.  This has to be an easy fix!  I have viewport set up and again it works on iPad just fine as well on desktops when you minimize the screen but on the actual iPad it shows a horrible version of the full site.
    Thanks for taking a look at this!
    Gary
    PS:  I will clean up the code - this is a work in progress.

    I figured out a few things but not all.  It seems to work on iPhone 5 but not with new Galaxy or my older iPhone.  I can guess that the issue with the iPhone is similar to why it doesn't render correctly on my old iPad but works fine with my new one, but baffled why the Galaxy doesn't recognize the media queries and viewport.  Will do some research on this but if anyone knows post it here!

  • Where is the mobile style sheet for media queries?

    When I create a new document in Dreamweaver CC, I get the following @media queries:
    GLOBAL
    only screen and (min-width : 481px)
    only screen and (min-width : 769px)
    Where is the mobile style sheet?
    I thought the fluid grid layout option in DW would create 3 screen sizes.
    Do I have to create another special style sheet to only apply to the mobile version?
    When I click on the mobile icon at the bottom of Dreamweaver's CC screen, I see the mobile page with the 4 column grid.
    But how do I make changes to just one screen size, say mobile?
    When I have the mobile view on my screen, and have GLOBAL @Media selected, the changes I make go across all screen sizes. I want some styling to only be applied to mobile. I don't understand how to do this. Could somone please claify if I am missing a @Media sheet and how to create it if needed. Thanks.

    FGLayouts are built on the mobile first scheme.  There's nothing you have to do.
    Nancy O.

  • Media Queries:  Works on Mac but not Windows

    http://www.sandiegohomegrown.com/testSDTG/
    I have been coding this site on my Mac and it works with Firefox, Safari, and Chrome.  I fired up the old Windows machine and it doesn't work with Safari, Firefox, or IE10.  It just ignores the media queries completely.  This has to be something really simple but I am baffled.  Help!!  Gary

    Alt attributes on images are not significant for rendering.  Did you fix the duplicate ID problems? Those are important.
    Windows OS doesn't ignore media queries but some browsers will if they see code errors they can't reconcile.
    Make sure IE is NOT running in Compatibility Mode which is practically the same as IE7.
    If you want to ensure IE always opens in standards mode, add this meta tag to the <head> of your HTML pages.
    <!--[if IE]>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <![endif]-->
    Nancy O.

  • Android Browser Landscape View Media Queries in Dreamweaver CS5.5

    Hey Guys !!!!!
    I Have a Problem
    In regards to the media queries working on android browser. I Use Dreamweaver CS5.5. When I tested there was no change .
    When I tested in landscape view it takes the default web browser screen width it is not device screen width.

    HI
    Thanks for your Kind Reply.
    But there is No device Issue.
    I m Using ONE HTML (ONE URL) For Web View and Mobile View. ( Multi Screen View Feature In Dreamweaver CS 5.5 )
    It is look Fine in Multi Screen View Preview in Dreamweaver CS 5.5.
    My media query is simple :
    For Desktop :
    <link href="style/desktop.css" rel="stylesheet" type="text/css">
    For Mobile :
    <link href="style/phone.css" rel="stylesheet" type="text/css" media="only screen and (max-width:320px)">
    And My Meta Tag is :
    <meta name="viewport" content="width=device-width">
    when my phone device is in vertical position it is called the phone.css But When my phone device rotate in horizontal ( landscape View ) it is called desktop.css

  • Im trying to reorder divs when in the mobile version of my site, is it possible to do it with media queries?

    Im trying to reorder divs when in the mobile version of my site, is it possible to do it with media queries? Here is the layout in desktop view, red being what would be images. And when i rescale, the content stacks together to place two of the same boxes together, like so;
    Is it possible to apply a rule so when scaled the boxes reorder to show red, black, red, black, red, black?

    <div class="productcontainer3">
    <div class="product3"></div>
    </div>
    <div class="productcontainer4">
    <div class="product4"><h6>Manta Soledo</h6><p1>In here will be the Manta blurb! Not too much technical info, save that for product page. Make it sleek and elegant. </p1></div>
    </div>
    <div class="productcontainer1">
    <div class="product1"><h6>Manta Soledo</h6><p1> In here will be the Manta blurb! Not too much technical info, save that for product page. Make it sleek and elegant.</p1> </div>
    </div>
    <div class="productcontainer2">
    <div class="product2"></div>
    </div>
    <div class="productcontainer5">
    <div class="product5"></div>
    </div>
    <div class="productcontainer6">
    <div class="product6"><h6>Manta Soledo</h6><p1>In here will be the Manta blurb! Not too much technical info, save that for product page. Make it sleek and elegant. </p1></div>
    .productcontainer1 {
      float: left;
      clear: both;
      max-width: 604px;
      width: 49%;
      margin-right: 1%;
      margin-bottom: 4%;
      margin-top: 1%;
    @media all and (max-width: 600px) {
    .productcontainer1 {
      width: 100%;
    .productcontainer2 {
      float: left;
      max-width: 604px;
      width: 49%;
      margin-bottom: 4%;
      margin-top: 1%;
    @media all and (max-width: 600px) {
    .productcontainer2 {
      width: 100%;
    .productcontainer3 {
      float: left;
      clear: both;
      max-width: 604px;
      width: 49%;
      margin-right: 1%;
      margin-bottom: 4%;
    @media all and (max-width: 600px) {
    .productcontainer3 {
      width: 100%;
    .productcontainer4 {
      float: left;
      max-width: 604px;
      width: 49%;
      margin-bottom: 4%;
    @media all and (max-width: 600px) {
    .productcontainer4 {
      width: 100%;
    .productcontainer5 {
      float: left;
      clear: both;
      max-width: 604px;
      width: 49%;
      margin-right: 1%;
    @media all and (max-width: 600px) {
    .productcontainer5 {
      width: 100%;
    .productcontainer6 {
      float: left;
      max-width: 604px;
      width: 49%;
    @media all and (max-width: 600px) {
    .productcontainer6 {
      width: 100%;
    .product1 {
      Width: 100%;
      padding-bottom: 50%;
      float: left;
      background-position: center;
        background-size: cover;
        background-repeat: none;
    .product2:hover {
      background-image:url(../Graphics/iMod-rollover.jpg);
    .product2 {
      Width: 100%;
      background-image:url(../Graphics/iModindex.jpg);
      padding-bottom: 50%;
      float: left;
      background-position: center;
        background-size: cover;
        background-repeat: none;
      -webkit-transition: background-image .8s ease-in-out;
      -moz-transition: background-image .8s ease-in-out;
      -ms-transition: background-image .8s ease-in-out;
      -o-transition: background-image .8s ease-in-out;
      transition: background-image .8s ease-in-out;
    .product3 {
      Width: 100%;
      padding-bottom: 50%;
      float: left;
      background-position: center;
        background-size: cover;
        background-repeat: none;
      background-image:url(../Graphics/Ilanoindex.jpg);
      -webkit-transition: background-image .8s ease-in-out;
      -moz-transition: background-image .8s ease-in-out;
      -ms-transition: background-image .8s ease-in-out;
      -o-transition: background-image .8s ease-in-out;
      transition: background-image .8s ease-in-out;
    .product4 {
      Width: 100%;
      padding-bottom: 50%;
      float: left;
      background-position: center;
        background-size: cover;
        background-repeat: none;
    .product3:hover {
      background-image:url(../Graphics/Ilano-rollover.jpg);
    .product5 {
      Width: 100%;
      background-image:url(../Graphics/Soledoindex.jpg);
      padding-bottom: 50%;
      float: left;
      background-position: center;
        background-size: cover;
        background-repeat: none;
      -webkit-transition: background-image .8s ease-in-out;
      -moz-transition: background-image .8s ease-in-out;
      -ms-transition: background-image .8s ease-in-out;
      -o-transition: background-image .8s ease-in-out;
      transition: background-image .8s ease-in-out;
    .product5:hover {
      background-image: url(../Graphics/Soledorollover.jpg);
    .product6 {
      Width: 100%;
      padding-bottom: 50%;
      float: left;
      background-position: center;
        background-size: cover;
        background-repeat: none;

  • Upgraded to v10 and now media queries aren't working.

    I upgraded to version 10 and the media queries are not working on a new site I'm working on . They worked fine on 9.01 and still are working fine on another machine that has 9.01. But not in 10.0.
    It doesn't matter if its a <link> Media query or a @media screen. They are not working!
    I tried to reinstall and I'm getting the same result.

    I have test my site and queries in all the browsers and Firefox is the only one acting up. It worked in v 9. It's like they are being ignored. Here's an example of a media query.
    I'm testing by resizing the browser window and also by loading a site through an iframe.
    @media screen and (max-width: 800px) {
    body { background: #ddd; }
    Can someone please get this fixed. Mobile designs rely heavily on css media queries.

  • "Add media queries" button disabled

    Hi,
    I've downloaded the pack and everything else seems to work fine, but when I enter in the multiscreen preview window, the add media queries button is disabled (the viewport sizes is active) and I can't find any other way to bring up the menu for the css selection based on screen width.
    Am I  missing something? Or is there some  incompatibility when using the pack in English while having the main software in Spanish?
    Thanks.

    The HTML5 Pack should work fine with the Spanish version of DW.  What OS are you using?  What language is your OS (English, Spanish)?
    There is a known issue where the Add Media Queries button is sometimes disabled if you are in Live View and the URL in the Browser Navigation toolbar Address field starts with "http://".  If you close the file and then re-open it a few times, the Add Media Queries button should eventually become enabled.  It's kind of a random problem.
    Please let us know if this helps or not to enable the Add Media Queries button.
    Thanks,
    David Alcala
    Dreamweaver QE

  • Media Center Keeps playing audio when connected to HDMI

    I have LCD TV connected to may laptop.
    The media center keeps playing audio sound when the HDMI sound output is enable.
    Laptop: CQ35-214TX
    OS: Windows 7

    This is one of the BIGGEST reasons why I would want to take my PC and chuck it into the nearest heavily traveled lane of traffic and watch it get completely destroyed by any vehicle that runs over it then go buy a MAC. The idiocy involved in doing such a simple task is revolting.
    FIrstly, and in no way am I directing my ire at you specifically, I have already performed almost everything you have listed for me to try... PREVIOUS to me posting this cry for help.
    Secondly, I included a screen shot of the sound devices in my first post and indicated that my display driver/device is  Intel(R) HD Graphics 4000. Beyond that, I don't know what you are looking for.
    Thirdly, and most frustrating, the document you told me to "follow every single word of instruction" (which I have previously done) doesn't even tell me to connect the laptop to the TV. It talks about the different kinds of connections but never actually TELLS me to connect the laptop to the TV and WHEN to do it.
    When I connected my laptop to my TV for the first time it never tried to load ANY drivers. HOWEVER, it does show "PANASONIC TV" (the brand of my TV) and the monitor type in the resolution dialog. But it also show no other type of monitor.
    The biggest issue I can see is that there is NO DRIVER LISTED FOR THE HDTV AUDIO in the sound devices. Therefore how could it transmit audio via the HDMI cable since it doesn't seem to even recognize it?
    I am at my wits end. And I have NO INTENTION OF PAYING SOMEONE TO MAKE THIS WORK!!!! There is NO reason why it should not work upon conection of the HDMI cable.
    What the hell is wrong with HP (or any other PC manufacturer - and Microsoft, as well) when the simple task of connecting a laptop to a TV is so complex and convoluted. And, by the way, I am an electrical engineer with multiple degrees... And this doesn't make sense to me!!! For pity's sake, can someone please give me a simple solution to what should be a simple issue??!!
    Alex...

  • Can we have two media queries about width(both same) of display in phone-tablet-pc mode design

    can we have two media queries about width(both same) of display in phone-tablet-pc mode design, one in css.file of template file and one in particular file embedded css style?

    Yes.

  • I am using media queries and div will not centre on desktop version

    Hi,
    I am building a site for the first time using media queries. My problem is that I cannot get the header div (#layoutDiv1) to centre on the desktop version.
    I have pasted my code below, am I missing something?
    Any help would be great.
    Thanks, Alex.
    /* Mobile Layout: 480px and below. */
    .gridContainer {
      margin-left: auto;
      margin-right: auto;
      width: 100%;
      color: #FFF;
      background-color: #000;
    #LayoutDiv1 {
      clear: both;
      float: left;
      margin-left: 0;
      width: 90%;
      display: block;
      padding-top: 20px;
      padding-left: 20px;
      padding-right: 20px;
      padding-bottom: 20px;
    /* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */
    @media only screen and (min-width: 481px) {
    .gridContainer {
      width: 100%;
    #LayoutDiv1 {
      clear: both;
      float: left;
      margin-left: 0;
      width: 90%;
      display: block;
      padding-top: 20px;
      padding-left: 20px;
      padding-right: 20px;
      padding-bottom: 20px;
    /* Desktop Layout: 769px to a max of 1232px.  Inherits styles from: Mobile Layout and Tablet Layout. */
    @media only screen and (min-width: 769px) {
    .gridContainer {
      width: 100%;
      text-align: left;
    #LayoutDiv1 {
      width: 1000px;
      padding: 20px;
      margin-right: auto;
      margin-left: auto;

    Because you don't have max-width to constrain the responsive design attributes from the tablet and phone are also then applied to the desktop because they are true.  Have you tried either setting a max-width or setting the clear and float to none in the desktop CSS?

  • Action keeps overwriting previous file in auto batch run

    Hi..I have been experiencing a frustrating problem. When running an automated batch action which ends with a 'save as' command to a 'action completed' folder, the files keeps overwriting the previous files in the batch and retains name of the first file processed by the action.
    Other actions I have created never had this problem, but all of a sudden it simply refuses to save the individual files without overwriting the previous one.
    Any help or suggestions would be most welcome. I have tried deleting the preferencs and .plist files. I am running CS3 on a MacPro with OS X 10.5.4
    Cheers,
    David

    PDFs and EPS files that need to be rasterized have this problem, IIRC. But JPG files should be fine. I would try image processor, and make sure to strip out any save commands in your action, instead using the image processor script to save the images. If the files are overwriting with that setup, you have real problems!

Maybe you are looking for