html - 流体宽度在 Firefox 中不起作用

标签 html css firefox width

晚上好,对网页设计世界还很陌生,但到目前为止我很喜欢它,这个网站对我帮助很大,但我遇到了 Firefox 问题。

在 Safari、IE、Chrome 和 Opera 中,我的布局按预期工作。但仅在 Firefox 中,min-width 属性不起作用!布局不断压缩,15px 的右边距不断向左移动而不是停止(就像在其他 4 个浏览器中一样!)

<html>
<head>
    <meta charset="utf-8"> 
    <link rel="stylesheet" type="text/css" href="IL_new.css">
        <title>Name here</title>
</head>

<body>
<header>
<div id="header-text">Name here</div>

<nav>
    <ul>
        <li>item 1</li>
        <li>item 2</li>
        <li>item 3</li>
        <li>item 4</li>
        <li>item 5</li>
    </ul>
</nav>
</header>
<div id="margin">
<div id="shell">

</div>
</div>


</body></html>

带有样式:

header {
background: -webkit-linear-gradient(top,       #19cad5 0%,#0066b5 100%);
background: -moz-linear-gradient(top,       #19cad5 0%,#0066b5 100%);
background: linear-gradient(to bottom, #19cad5 0%,#0066b5 100%); 
border: solid black; border-width: 1 0 1 0;
height: 125px;
margin: 0 0 0 0;
position: relative;
min-width: 900;
}



#header-text {
    border: 1px solid black;
    color: #610079  ;
    height: 125;
    position: absolute; left:0px; bottom:0px;
    padding:0 0 0 30;
    font-family: "verdana"; font-size: 48px; font-weight: bold;
}



/* START DROP DOWN NAV MENU */

nav {
    position:absolute; right:0px; bottom:0px; 
    padding:0 30 0 0;
}
nav ul li {
    float: left;
    padding: 0 15;
    list-style: none;
}

/* END DROP DOWN NAV MENU */

/* END HEADER */

/* START CONTAINERS */

#margin {
border: 1px solid red;
height: 300;
margin: 10 15;
min-width: 870;
}

#shell {
border: 1px solid green;
height: 300;
min-width: 870;
}


/* END CONTAINERS */

作为新手,我毫不怀疑我的标记中存在一些错误/反向实践,但如前所述,它在 Opera、Safari、IE 和 Chrome(但不是 FIREFOX)中的工作方式完全符合我的要求!

边框等是我的设计引用

我使用的是所有浏览器的最新版本

非常感谢您的宝贵时间。 谢恩

最佳答案

在宽度、填充、高度声明的末尾添加“px”

关于html - 流体宽度在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21760096/

相关文章:

javascript - 如何更改数据表中标题单元格的内容?

jquery - 检查 jquery(js) 中的字段是否为空?

html - li 元素的背景图像在 firefox 中不显示

css - 更正内联 base64 图像的 css 语法

html - 在 div 中定位文本

javascript - 以 json 或 html 形式返回数据库结果

html - 创建类似分数的元素的最佳方法?

firefox - 无法在 Firefox 中显示我的 svg 图像?

c# - 在 WPF/C# 中嵌入 Firefox/Gecko

javascript - 如何直接将createNSResolver与lookupNamespaceURI一起使用?