css - firefox 中 css 保留 id 名称的限制

标签 css firefox

<分区>

我创建了一个 id 为“descriptions”的 div,它无法识别位置声明。这是 Firefox 中的错误,还是我在这里遗漏了什么。我正在使用最新版本的 Ubuntu。

CSS

#descriptions
{
    position: absolute:
    top: 20px;
    left: 190px;
    height: 500px;
    width: 100px;   
    background-color: blue; 
}

HTML

<div id="descriptions"></div>

这是一个事件副本:http://jason-rubenstein.com/testCss/test.html

我知道它可以在某些浏览器中运行,但请确认这不是编码问题而是错误。

当我更改名称但保持代码不变时它确实有效。

最佳答案

您在属性 position: absolute;

的行尾使用了冒号而不是分号

这是正确的CSS代码:

#descriptions
{
    position: absolute;
    top: 20px;
    left: 190px;
    height: 500px;
    width: 100px;   
    background-color: blue; 
}

关于css - firefox 中 css 保留 id 名称的限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10277121/

上一篇:css - 在另一个 div 中 float 一个移动的 div, overflow hidden ,css 修复?

下一篇:css - 有没有办法定义别名并在 Sass 或 Less 中使用它的 CSS 定义

相关文章:

html - 高度等于 100% 不适用于 IFrame

javascript - Firefox keydown退格问题

c# - 像 VS2010 一样的 mac 的 css builder

css - 在 IE/Chrome/Firefox 中打印预览(或打印)时不显示图像

html - 调整窗口大小时,跨度元素未获得其宽度

javascript - Firefox 的全局热键

firefox - 为什么我的 CSS3 Transition 在 Firefox 中不起作用?

javascript - react - flex 容器外的 flex 元素

html - 我的高度属性在 firefox 中显示的结果与所有其他浏览器(safari、chrome act)不同。为什么?

javascript - 如何跨浏览器显示通知