本文介绍了是否有理由将大写字母用于十六进制CSS颜色值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我看到CSS属性值中的颜色通常以大写形式书写:

I see that colors in CSS properties values are commonly written in the uppercase form:

.foo .bar {
  background-color: #A41B35;
  color: #FFF;
}

但是您也可以使用:

/* Same same */
.foo .bar {
  background-color: #a41b35;
  color: #fff;
}

看起来像使用小写字母值一样,并且颜色的CSS值也一样。许多图形设计软件也使用大写形式。在源代码中找到大写表示法是很常见的,看起来好像是一种传统。

It looks like using lowercase values does the same, and, CSS values for colors are not case-sensitive. Lots of graphic design software also use the uppercase form. And it is very common to find uppercase notations in source code, it looks like there is something like a tradition.

我了解一致性的问题,应该是在您的软件中到处都是相同的,但是由于标准并不能很好地表明这一点,人们会想要被告知要做的

I understand about the consistency thing, that it should be the same everywhere in you software, but as the standard doesn't give a good indication, people do what they want or what they are told to do.

是否有合理的原因,例如历史,兼容性,旧的IE6黑客行为,性能还是实际原因?

Is there rational reasons for this, like historic, compatibility, old IE6 hacks, performances or practical reasons?

推荐答案

除了个人喜好外,我没有其他区别。就个人而言,我更喜欢小写字母,因为它可以更快地读取,尽管在CSS颜色值之类的非常短的字符串中,其优势可能微不足道。 真的,我认为这只是因为我认为小写看起来更好。

I am not aware of any differences other than personal preference. Personally, I prefer lowercase since it's quicker to read, although in very short strings such as CSS color values, the benefit is probably negligible. Really, I think it's just because I think lowercase looks better.

十六进制,但是,通常是用编写的大写,所以严格来说-也许我是在'错误'内。

Hexadecimal, however, is traditionally written in uppercase, so maybe I'm - strictly speaking - in the 'wrong'.

这篇关于是否有理由将大写字母用于十六进制CSS颜色值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 23:37