!重要的是不被考虑[关闭]

问题描述 投票:-3回答:1

我实际上是试图做一个网站的移动友好。该网站是在2列布局和我说高度左栏(侧菜单),但它并不优先。

@media only screen and (max-width: 700px) {
.landing_container .side_menu{
    width:170px;
    height:300px !important;
}
.landing_container {
    float: none  !important;
    width: 100%  !important;
}
.main_content {
    float: none  !important;
    width: 100%  !important;
}

身高不占先,它消除了开发者工具和高度:4658px; (从element.style)弹出。我看到在项目定义为我的身边菜单高度的地方。我缺少的东西吗?

P.S特异性是准确和宽度似乎没有问题需要解决。

文章编辑:我是分号的问题抱歉。我没有复制粘贴,但颇有点写在赶时间。我有在合适的地方的分号。这应该是别的东西。

html css css3 responsive
1个回答
1
投票

你应该尝试,如果你能避免!important。它增加了复杂性,特别是如果你的特异性准确了。但是如果你必须你必须这样做。

它看起来像你有一个语法错误。删除第一个分号。

@media only screen and (max-width: 700px) {
  .landing_container .side_menu{
     width:170px;
     height:300px !important;
  }
  .landing_container {
     float: none !important;
     width: 100% !important;
  }
  .main_content {
     float: none !important;
     width: 100% !important;
  }
} 
© www.soinside.com 2019 - 2024. All rights reserved.