css选择器\数字代表什么
 .\39 {  
    background-color: #ccc;
    color: red;
}
.unicode\5c {
    background-color: #666;
    color: white;
}
.8 { 
    background-color: #DDD;
    color: blue;
}

之前看到这种css样式,有什么意义,怎么得来的,如何使用

css

2个回答

当css class类名是数字开头或者包含特殊字符的话,在写CSS样式的的类名的时候要进行Unicode转换
DEMO

 <style id="jsbin-css">
.\39 {  
    background-color: #ccc;
    color: red;
}
/* \ 的unicode码是5c */
.unicode\5c {
    background-color: #666;
    color: white;
}
.8 { 
    background-color: #DDD;
    color: blue;
}
</style>
<div class="9">9</div>
<div class="unicode\">unico</div>
  <div class="8">8未转义无效</div>
ElvisSZQ
shzh_Q 不是很明白
接近 2 年之前 回复

ast login: Fri Feb 23 10:22:00 on ttys000
fangjindeMBP:~ fangjin$ redis-server
27763:C 23 Feb 14:50:19.165 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
27763:M 23 Feb 14:50:19.167 * Increased maximum number of open files to 10032 (it was originally set to 256).
.

.-__ ''-._
_.-
.
. ''-._ Redis 3.2.11 (00000000/0) 64 bit
.-.-.\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.
-._|'_.-'| Port: 6379
|
-._ ._ / _.-' | PID: 27763
-._ -._-./ .-' _.-'

|-._-.
-.__.-' _.-'_.-'|
|
-._-._ _.-'_.-' | http://redis.io
-._ -._-.__.-'_.-' .-'

|-._-.
-.__.-' _.-'_.-'|
|
-._-._ _.-'_.-' |
-._ -._-.__.-'_.-' .-'

-._-.
_.-' .-'

-._ _.-'
-.
_.-'

27763:M 23 Feb 14:50:19.174 # Server started, Redis version 3.2.11
27763:M 23 Feb 14:50:19.174 * DB loaded from disk: 0.000 seconds
27763:M 23 Feb 14:50:19.174 * The server is now ready to accept connections on port 6379
27763:M 23 Feb 15:50:20.071 * 1 changes in 3600 seconds. Saving...
27763:M 23 Feb 15:50:20.073 * Background saving started by pid 28031
28031:C 23 Feb 15:50:20.075 * DB saved on disk
27763:M 23 Feb 15:50:20.178 * Background saving terminated with success
27763:M 24 Feb 21:06:05.764 * 1 changes in 3600 seconds. Saving...
27763:M 24 Feb 21:06:05.766 * Background saving started by pid 30253
30253:C 24 Feb 21:06:05.769 * DB saved on disk
27763:M 24 Feb 21:06:05.869 * Background saving terminated with success
27763:M 24 Feb 22:06:06.070 * 1 changes in 3600 seconds. Saving...
27763:M 24 Feb 22:06:06.071 * Background saving started by pid 30395
30395:C 24 Feb 22:06:06.074 * DB saved on disk
27763:M 24 Feb 22:06:06.171 * Background saving terminated with success
27763:M 25 Feb 15:33:48.208 * 1 changes in 3600 seconds. Saving...
27763:M 25 Feb 15:33:48.209 * Background saving started by pid 31881
31881:C 25 Feb 15:33:48.212 * DB saved on disk
27763:M 25 Feb 15:33:48.312 * Background saving terminated with success
27763:M 25 Feb 16:33:49.026 * 1 changes in 3600 seconds. Saving...
27763:M 25 Feb 16:33:49.027 * Background saving started by pid 32178
32178:C 25 Feb 16:33:49.028 * DB saved on disk
27763:M 25 Feb 16:33:49.129 * Background saving terminated with success
27763:M 25 Feb 17:33:50.075 * 1 changes in 3600 seconds. Saving...
27763:M 25 Feb 17:33:50.076 * Background saving started by pid 32428
32428:C 25 Feb 17:33:50.079 * DB saved on disk
27763:M 25 Feb 17:33:50.180 * Background saving terminated with success
27763:M 25 Feb 20:36:14.182 * 1 changes in 3600 seconds. Saving...
27763:M 25 Feb 20:36:14.182 * Background saving started by pid 33175
33175:C 25 Feb 20:36:14.185 * DB saved on disk
27763:M 25 Feb 20:36:14.284 * Background saving terminated with success

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问