Only certain elements responding to media queries

て烟熏妆下的殇ゞ 提交于 2019-12-12 04:37:24

问题


I'm working on a site and I'm trying to use multiple media queries: big screens, medium screens, small screens. I have a single stylesheet for the page and following the overall styling I enter the media queries:

@media only screen and (min-width: 1135px)
@media only screen and (min-width: 751px) and (max-width: 1134px)
@media only screen and (max-width: 750px)

Certain elements from the 751->1134 respond while others do not (they follow the default styling). Nothing from the <750 changes

The elements in questions are a div with display: inline-block and elements being floated within:

// Default styling
div.image {
  width: 50%;
  float: left;
}

div.text {
  width: 50%;
  float: left;
}

// Media query #2
div.image {
  width: 40%;
  float: left;
}

div.text {
  width: 45%;
  float: left;
  margin-left: 5%;
}

Any ideas?

来源:https://stackoverflow.com/questions/25950360/only-certain-elements-responding-to-media-queries

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!