为了账号安全,请及时绑定邮箱和手机立即绑定

你好,CSS中 前面带#的style和普通的带.的style有啥区别?

/ 猿问

你好,CSS中 前面带#的style和普通的带.的style有啥区别?

蝴蝶刀刀 2021-02-21 17:13:03

.trackback {width:100%; padding:8px 0; background:#F9FCFE; border-bottom:#666666 1px solid}

#noComment {width:500; line-height:30px; border:#a5cdff 1px dashed; margin:0; padding-left:8px}

例如这个的下面那个

查看完整描述

3 回答

?
慕工程1480053

TA贡献248条经验 获得超2个赞

https://dribbble.com/sfhjk/shots

https://dribbble.com/DFR552/shots

https://dribbble.com/govcn/shots

https://dribbble.com/govcom/shots

https://dribbble.com/govcc/shots

https://dribbble.com/govii/shots

https://dribbble.com/govcm/shots

https://dribbble.com/govct/shots

https://govcn.jimdofree.com

https://govsh.jimdofree.com

https://hzgov.jimdofree.com



https://dribbble.com/govpp/shots

https://dribbble.com/govss/shots

https://dribbble.com/govqq/shots

https://dribbble.com/govgz/shots

https://dribbble.com/govxm/shots

https://dribbble.com/govhz/shots

https://dribbble.com/govcd/shots

https://dribbble.com/govcq/shots

https://dribbble.com/govtj/shots

https://dribbble.com/hzgov/shots

https://dribbble.com/govnj/shots

https://dribbble.com/govjn/shots

https://dribbble.com/govqd/shots

https://dribbble.com/govdl/shots

https://dribbble.com/govnb/shots

https://dribbble.com/xmgov/shots

https://dribbble.com/cdgov/shots

https://dribbble.com/govwh/shots

https://dribbble.com/govheb/shots

https://dribbble.com/govsy/shots


https://dribbble.com/govxa/shots

https://dribbble.com/ccgov/shots

https://dribbble.com/govca/shots

https://dribbble.com/govfz/shots

https://dribbble.com/govzz/shots

https://dribbble.com/govsjz/shots

https://dribbble.com/govsz/shots

https://dribbble.com/govfs/shots

https://dribbble.com/govdg/shots

https://dribbble.com/govwx/shots

https://dribbble.com/govyt/shots

https://dribbble.com/govty/shots

https://dribbble.com/govhf/shots

https://dribbble.com/govnc/shots

https://dribbble.com/govnn/shots

https://dribbble.com/govkm/shots

https://dribbble.com/govwz/shots

https://dribbble.com/govzb/shots

https://dribbble.com/govts/shots

https://dribbble.com/govgy/shots



https://dribbble.com/xagov/shots

https://dribbble.com/govhk/shots

https://dribbble.com/govlz/shots

https://dribbble.com/govyc/shots

https://dribbble.com/govxn/shots

https://dribbble.com/govqz/shots

https://dribbble.com/govbt/shots

https://dribbble.com/govnt/shots

https://dribbble.com/govdq/shots

https://dribbble.com/govxz/shots

https://dribbble.com/govwf/shots

https://dribbble.com/govcz/shots

https://dribbble.com/govzx/shots

https://dribbble.com/jngov/shots

https://dribbble.com/ycgov/shots

https://dribbble.com/govhd/shots

https://dribbble.com/govly/shots

https://dribbble.com/lygov/shots

https://dribbble.com/govdy/shots

https://dribbble.com/govyz/shots



https://dribbble.com/govtz/shots

https://dribbble.com/govjx/shots

https://dribbble.com/czgov/shots

https://dribbble.com/govyl/shots

https://dribbble.com/tzgov/shots

https://dribbble.com/govzj/shots

https://dribbble.com/govks/shots

https://dribbble.com/sovjy/shots

https://dribbble.com/govzjg/shots

https://dribbble.com/govyw/shots

https://dribbble.com/govjh/shots

https://dribbble.com/govbd/shots

https://dribbble.com/govjl/shots

https://dribbble.com/govas/shots

https://dribbble.com/govta/shots

https://dribbble.com/gocyc/shots

https://dribbble.com/govxy/shots

https://dribbble.com/govzs/shots

https://dribbble.com/govhui/shots

https://dribbble.com/govny/shots


https://dribbble.com/whgov/shots

https://dribbble.com/govdz/shots

https://dribbble.com/govyy/shots

https://dribbble.com/govlc/shots

https://dribbble.com/govde/shots

https://dribbble.com/zzgov/shots

https://dribbble.com/govbz/shots

https://dribbble.com/govmm/shots

https://dribbble.com/govha/shots

https://dribbble.com/govjm/shots

https://dribbble.com/govwu/shots

https://dribbble.com/zjgov/shots

https://dribbble.com/govlf/shots

https://dribbble.com/govhe/shots

https://dribbble.com/lzgov/shots

https://dribbble.com/govbj/shots

https://dribbble.com/govzh/shots

https://dribbble.com/govmy/shots

https://dribbble.com/govzhu/shots

https://dribbble.com/govlyg/shots


查看完整回答
反对 回复 2021-03-25
?
摇曳的蔷薇

TA贡献1617条经验 获得超9个赞

id选择器并不是在html页面中只能使用一次
你喜欢的话可以把多个标签设置为同一个id
而影响的是其他的问题很多,给你个例子吧
比如你在页面里添加 锚<a>
咱们先添加2个锚点 本来应该这么写<a name="t1" /> <a name="t2" />
咱们现在把name改成id,效果是一样的 那么就变为<a id="t1" /> <a id="t2" />
接下来咱们把两个锚的id都设置为t1 <a id="t1" /> <a id="t1" />
然后添加个连接来跳到锚点处<a href="#t1" />这是跳至t1处的 那么咱们结合css里的id选择器的话 问题就出来了 你#t1的样式设定锚点的样式 这没问题 两个锚点都是用同样的样式
但是你得链接呢 跳到哪个锚点呢 所以这个问题很关键 id的针对性就这么体现出来了 建议是用类选择器 class 在css中 .

查看完整回答
反对 回复 2021-03-17
?
白猪掌柜的

TA贡献1678条经验 获得超10个赞

#是id选择选择器
.的是类选择器
就那你上面例子来说
选#的就要这样选<p id="noComment">
选.的就这样<p class="trackback">
这样才能运用上相对应的style
id选择器只能在html页面使用一次,针对性更强

查看完整回答
反对 回复 2021-03-17

添加回答

回复

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信