html - 最小宽度不适用于任何浏览器

标签 html css width min

我正在尝试设置 min-width: 800px 但它不起作用,我在其他元素上做了完全相同的事情并且效果很好,我在 chrome 和 ie 上都试过了但没有区别。我看到很多人在 ie 中对此有问题,但由于它在 chrome 中不起作用,我也被卡住了。

下面是它的试用版:http://zimxtrial.ukbigbuy.com/

HI 也做了一个 fiddle :

http://jsfiddle.net/4wDGG/

一些 JS 无法正常工作,但我怀疑这是否重要,它在我的浏览器测试中有效,所以不用担心。

我还将在此处包含 CSS:

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    min-width: 800px;
}

.navigation {
    width: calc(100% - 120px);
    height: 50px;
    margin: 0px 60px;
    position: fixed;
    background-color: #f27009;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

.light-menu {
    width: 100%;
    height: 50px;
    background-color: rgba(255, 255, 255, 1);
    position: fixed;
    background-color:rgba(4, 180, 49, 0.6);
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
}

#nav-center {
    width: 100%;
    height: 40px;
    background-color: #f27009;
    margin: 4px 0px;
    text-align: center;
    border-bottom: dashed 1px #000000;
    border-top: dashed 1px #000000;
    left: 70px;
    margin-left: auto;
    margin-right: auto;
}

#nav-center ul {
    margin: 0;
}

#nav-center ul li {
    list-style: none;
    margin: 0 40px 0 0;
    display: inline;
}

#nav-left {
    width: 70px;
    height: 60px;
    background-image: url(images/banner_left.png);
    margin: 0px 0px;
    top: 0px;
    left: 0px;
    position: fixed;
}

#nav-right {
    width: 70px;
    height: 60px;
    background-image: url(images/banner_right.png);
    margin: 0px 0px;
    top: 0px;
    right: 0px;
    position: fixed;
}

.active {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 16px;
    color: #FFFFFF;
    text-decoration: none;
    line-height: 40px;
}

a {
    font-family:Georgia, "Times New Roman", Times, serif;
    font-size: 16px;
    color: #000000;
    text-decoration: none;
    line-height: 40px;
}

#home {
    background-color: #FFFFFF;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background-image: url(images/home-bg2.png);
}

#section1 {
    background-color: #1899d6;
    height: 100%;
    width: 100%;
}

#section2 {
    background-color: #CF0;
    height: 100%;
    width: 100%;
}

#section3 {
    background-color: #ff0000;
    height: 100%;
    width: 100%;
}

任何帮助都会很棒。

最佳答案

也将 min-width:800px 添加到 navigation 类中,看看 fiddle .

关于html - 最小宽度不适用于任何浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22835894/

相关文章:

html - 防止空格与单词换行

html - 隐藏带有向右浮动的长文本

HTML & CSS : Positioning and/or Float Issue?

css - 如何根据它所在的 div 改变表格行边框的颜色

html - 无法获得页面的完整宽度和图像 div 的大小不正确

css - 为什么容器在 body 的外面

html - CSS 左侧固定,右侧流动,在固定宽度内居中

html - Li 内容呈现在 ul 容器边界之外

html - CSS:边框比 div 容器高

html - 位置 : sticky adds some space around element in Chrome