CSS - “#”前面的标志 [英] CSS - "#" sign before property

查看:91
本文介绍了CSS - “#”前面的标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:


我试图在这里查找Stackoverflow.com,但找不到任何与我的问题相关的。开放的网络没有任何更好的,虽然有一个答案雅虎答案'答案'没有真正说任何除了[ is for IDs](当然不需要发布链接)。



这是更高级的。



在查看同事的CSS代码时,我发现他在几个CSS属性之前使用了



符号之前的属性是什么?



例如:

 <$> c $ c> .selector {#property:value; } 

或者:

  .headings {#margin-top:10px; } 

我以为我对CSS有很多了解,但是这让我感到惊讶,特别是



非常感谢任何有关这方面的信息。



感谢。

解决方案

更新 b
$ b

事实证明, #property 适用于IE7或更低版​​本,引用 Paul Irish


更新2009.11.10 - 值IE <= 7hack。我更喜欢
少于* prop。







c $ c>#之前的属性必须是一些黑客的浏览器。其他类似的hacks包括 _ (对于IE6及以下版本), * p>

有关详情,请参阅:




Possible Duplicate:
Is a CSS property starting with a hash (#) valid?

I tried looking around here on Stackoverflow.com but couldn't find anything related to my question. The open web wasn't any better either, although there was an answer on Yahoo! Answers the 'answer' didn't really say anything other than "[# is for IDs]" (no need to post the link of course).

This is a bit more advanced.

When reviewing the CSS code from a co-worker I found he used the # sign before several CSS properties.

What does the # sign before property do? That's gotta be some IE targeting hack I'm assuming.

For example:

.selector { #property:value; }

or well:

.headings { #margin-top:10px; }

I thought I knew a lot about CSS but this one caught me by surprise, especially that there's isn't any documentation of this case out there on the open web other than that answer in Yahoo! Answers.

Any info about this is greatly appreciated.

Thanks.

解决方案

Update

It turns out that #property is for IE7 or less, quoting from Paul Irish:

Update 2009.11.10 – Added #prop: value IE<=7 hack. I prefer it much less to *prop.


Putting # before properties must be a hack for some browser. Other similar hacks include _ (for IE6 and below), * (for IE8 and below), etc.

For more info, see:

这篇关于CSS - “#”前面的标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆