1

所以那里有一个简单的网站:JsFiddle 链接!我很难理解为什么这些代码不等于:另一个 jsFiddle 链接

这两个链接之间唯一改变的是:在#2中有

#panel{
    width:100%;
min-width: 960px;
}

首先,相同的代码在

    960f{

width:100%;
    min-width: 960px;
}

但它不是从课堂上读到的。我很困惑。你怎么看?写入每个面板的代码浪费我希望在每个 div id 中宽度为 100% 和最小 960px - 每次都使用相同的类更好。

4

2 回答 2

6

Class names can't begin with numbers. It can begin only with dash, underscore or a letter. See here.

(And I guess that if the first character is a dash, the second must be letter or underscore.)

于 2013-03-30T18:03:25.243 回答
1

你不能用这样的数字开始一个类名。

"In CSS2, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [A-Za-z0-9] and ISO 10646 characters 161 and higher, plus the hyphen (-); they cannot start with a hyphen or a digit."

Quote from W3C.

于 2013-03-30T18:01:47.853 回答