我正在为我的网站使用左栏。基本上,leftbar 由三个 div
元素和 id="profile"
组成。
此外,我已将 child div
元素向左浮动。
我面临的问题:
我在mozilla firefox中用firebug分析了这个问题,每个元素的宽度都等于父元素,但我不知道如何。
其次,子 div
元素的高度不等于父元素。我尝试将 div
元素的 height
设置为 100%
或 34px
,这并没有解决问题.
第三,我添加了渐变作为左栏的背景,但背景显示为一些纯色。我在正常渐变背景之前添加了供应商前缀。但我真的不知道为什么会这样。
我正在为 this 添加一个 jsbin 演示例子
最佳答案
Firefox 的 CSS 语法必须更改为:
-moz-linear-gradient(bottom, rgb(213,213,213) 0%, rgb(237,237,237), rgb(213,213,213) 100%);
高度只是设置为图像容器,而不是 leftbar,将 leftbar 设置为高度 34(和/或使用 line-height 使其垂直居中):
.leftbar{
widh:70%;
color:#000;
font-family:Calibri;
font-size:12px;
font-weight:700;
text-decoration:none;
text-align:center;
height:34px;
line-height:34px;
float:left;
}
关于html - 左栏的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14302019/