并非所有 CSS 样式类的属性都被应用 [英] Not all attributes of CSS style class are applied
问题描述
我在 CSS 文件中写了以下内容.
I have following written in a CSS file.
span.hoverhelp
{
border:double;
border-width:3;
border-color:#000000;
background-color:#eeffcc;
padding:5;
font-size: 11;
font-family:Verdana, Arial;
position: absolute;
top: 80;
left: 170;
visibility: hidden;
}
现在,我正在创建一个跨度并将类 hoverhelp 应用于它.以下是标签:
Now, I am creating a span and applying the class hoverhelp to it. Following is the tag:
<span id="help" class="hoverhelp">
Some text
</span>
当它被渲染时,边框宽度、填充、字体大小、顶部和左侧样式不会被应用.在 chrome dev 工具栏中打开时,这些值是笔划的,左侧会出现一个小的黄色警告三角形,上面写着无效的属性值".
When this gets rendered then, border-width, padding, font-size, top and left styles do not get applied. When opened in chrome dev toolbar, these values are stroke through and a small yellow warning triangle appears on the left side saying 'Invalid property value.'
我可能犯了一个愚蠢的错误.有人能注意到这里的任何陷阱吗?
I might be making a silly mistake. Can anyone notice any pitfall here?
推荐答案
CSS 长度需要单位.您可能需要 px
用于其中的大多数.
CSS lengths require units. You probably want px
for most of them.
使用验证器.
这篇关于并非所有 CSS 样式类的属性都被应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!