CSS #fff 或 #FFF 哪个更好?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3733172/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which is better, #fff or #FFF?
提问by Jeaf Gilbert
Which is better to define color?
哪个更好定义颜色?
color:#fff;
or
或者
color:#FFF;
?
?
I like #FFF because it catch your eyes' focus faster than #fff. But PS returns lowercase, so I was wondering if lowercase hexadecimal is better than uppercase. Why this thread closed? o.Oa
我喜欢#FFF,因为它比#fff 更快地吸引你的眼球。但是 PS 返回小写,所以我想知道小写的十六进制是否比大写更好。为什么这个线程关闭?o.Oa
采纳答案by Williham Totland
Neither;
两者都不;
color: white;
In all seriousness, tho', it doesn't matter so long as it matches the general design of your site. (For example, SO or FB should use #FFF
, while, say, Apple would use #fff
. Matches the rounded corners better, you see?)
严肃地说,只要它与您网站的总体设计相匹配,这并不重要。(例如,SO 或 FB 应该使用#FFF
,而 Apple 会使用#fff
。更好地匹配圆角,你明白吗?)
回答by Joe
It depends what colour you want. #fff is 'white' and #FFF is 'WHITE'. Your choice.
这取决于你想要什么颜色。#fff 是“白色”,#FFF 是“白色”。你的选择。
回答by Mauro
The convention for Hex in CS has always been uppercase (as far as I know), with web designers it tends to be lowercase - the only thing that is "better" is sticking to one scheme and using it only. Switching back and forth just looks messy.
CS 中 Hex 的约定一直是大写的(据我所知),对于网页设计师来说,它往往是小写的——唯一“更好”的是坚持一种方案并只使用它。来回切换看起来很混乱。
回答by Louis
Pff I prefer
噗我更喜欢
color: rgb(255,255,255)
回答by Naveed
If you are talking about case sensitivity then it does not effect.
如果您在谈论区分大小写,那么它不会产生影响。
http://en.wikipedia.org/wiki/HTML_color_names
http://en.wikipedia.org/wiki/HTML_color_names
In HTML, documents using 4.01 specifications colors can be specified by name. Names are defined in this context to be case-insensitive. Using colors in HTML has been deprecated in favor of CSS.favor of CSS.
在 HTML 中,可以通过名称指定使用 4.01 规范颜色的文档。名称在此上下文中定义为不区分大小写。在 HTML 中使用颜色已被弃用,取而代之的是 CSS.favor of CSS。
回答by Pranay Rana
Between below two there is no difference.
以下两者之间没有区别。
color:#fff;
or
color:#FFF;
Go for : #FFFFFF this kind of hexa color than rather than short hand.
去:#FFFFFF 这种六边形颜色而不是短手。
In CSS, you define a color using either the hexadecimal color code, the RGB color code, or the actual color name. A benefit of using hexadecimal and RGB color codes is that you have many more options than just supplying a color name.
在 CSS 中,您可以使用十六进制颜色代码、RGB 颜色代码或实际颜色名称来定义颜色。使用十六进制和 RGB 颜色代码的一个好处是您有更多的选择,而不仅仅是提供颜色名称。
The color picker and chart on this page provide you with the hexadecimal color codes. The color picker also provides the RGB color code.
此页面上的颜色选择器和图表为您提供了十六进制颜色代码。颜色选择器还提供 RGB 颜色代码。
Hexadecimal color codes are often referred to as "hexadecimal colors", "hex colors codes", "color values" and a few other terms. "Hexadecimal color values" is probably the most accurate term as they are made up of hexadecimal numbers.
十六进制颜色代码通常被称为“十六进制颜色”、“十六进制颜色代码”、“颜色值”和一些其他术语。“十六进制颜色值”可能是最准确的术语,因为它们由十六进制数字组成。