表单元素的不同的背景颜色

时间:2021-05-11 23:54:36

Should I have background color for a form input? Or this is really a subjective matter?

我应该为表单输入设置背景颜色吗?或者这真的是一个主观问题?

For me personally I thought having background color for a form, kind of makes it more organized and clean.

对我个人而言,我认为有一种形式的背景颜色,使它更有条理和干净。

What are your views on this?

你对此有何看法?

4 个解决方案

#1


2  

Two techniques that I don't see often enough are highlighting input fields with a background color when they are focused while filling out a form and when a validation error occurs after a form submission. You can use these two techniques in conjunction with a subtle style for normal inputs to match the rest of your website design.

我经常看不到的两种技术是在填写表单时以及在表单提交后发生验证错误时突出显示具有背景颜色的输入字段。您可以将这两种技术与正常输入的微妙样式结合使用,以匹配您网站设计的其余部分。

#2


1  

To complete the other answers, you should also take into account accessibility issue, especially if the color you choose for the form input somehow risks to blend in with other colors you might use, such as:

要完成其他答案,您还应考虑辅助功能问题,尤其是如果您为表单输入选择的颜色有可能与您可能使用的其他颜色混合,例如:

  • color from the input fields
  • 输入字段中的颜色

  • characters colors (if the value is incorrect and you put the character in red, for instance)
  • 字符颜色(如果值不正确,并且您将字符设置为红色,例如)

  • colors of icons or warnings you might display when the data is incorrect...
  • 数据不正确时可能会显示的图标颜色或警告...

  • and so on
  • 等等

A border (meaning 'a graphical way of delimiting your input form) might also be a good way to isolate that form, without having relying solely on color.

边框(意为“分隔输入表单的图形方式”)也可能是隔离该表单的好方法,而不仅仅依赖于颜色。

In short, you might consider always using a combination of both: color and graphical ways to emphasize a GUI element.

简而言之,您可以考虑始终使用两者的组合:颜色和图形方式来强调GUI元素。

#3


0  

It really depends on the layout of the rest of the site. In my opinion it's good to have the form offset somehow, even if just with top/bottom borders - often you can make the whole thing a small box within the page. For something like a registration system, though, you might as well make the entire page the form - the less distractory extra-content the better.

这实际上取决于网站其余部分的布局。在我看来,以某种方式使表单偏移是好的,即使只是顶部/底部边框 - 通常你可以使整个页面内的小盒子。但是,对于像注册系统这样的东西,你也可以将整个页面作为形式 - 不那么令人讨厌的额外内容越好。

#4


0  

It's quite subjective.

这是非常主观的。

The importance with colors is that a) they should NOT be disruptive and distracting, and b) you should be very, very consistent with their use.

颜色的重要性在于:a)它们不应该具有破坏性和分散注意力,并且b)你应该非常非常符合它们的使用。

Same rule applies for all other visual elements, e.g., graphics, fonts, what not.

同样的规则适用于所有其他视觉元素,例如图形,字体,不适用。

#1


2  

Two techniques that I don't see often enough are highlighting input fields with a background color when they are focused while filling out a form and when a validation error occurs after a form submission. You can use these two techniques in conjunction with a subtle style for normal inputs to match the rest of your website design.

我经常看不到的两种技术是在填写表单时以及在表单提交后发生验证错误时突出显示具有背景颜色的输入字段。您可以将这两种技术与正常输入的微妙样式结合使用,以匹配您网站设计的其余部分。

#2


1  

To complete the other answers, you should also take into account accessibility issue, especially if the color you choose for the form input somehow risks to blend in with other colors you might use, such as:

要完成其他答案,您还应考虑辅助功能问题,尤其是如果您为表单输入选择的颜色有可能与您可能使用的其他颜色混合,例如:

  • color from the input fields
  • 输入字段中的颜色

  • characters colors (if the value is incorrect and you put the character in red, for instance)
  • 字符颜色(如果值不正确,并且您将字符设置为红色,例如)

  • colors of icons or warnings you might display when the data is incorrect...
  • 数据不正确时可能会显示的图标颜色或警告...

  • and so on
  • 等等

A border (meaning 'a graphical way of delimiting your input form) might also be a good way to isolate that form, without having relying solely on color.

边框(意为“分隔输入表单的图形方式”)也可能是隔离该表单的好方法,而不仅仅依赖于颜色。

In short, you might consider always using a combination of both: color and graphical ways to emphasize a GUI element.

简而言之,您可以考虑始终使用两者的组合:颜色和图形方式来强调GUI元素。

#3


0  

It really depends on the layout of the rest of the site. In my opinion it's good to have the form offset somehow, even if just with top/bottom borders - often you can make the whole thing a small box within the page. For something like a registration system, though, you might as well make the entire page the form - the less distractory extra-content the better.

这实际上取决于网站其余部分的布局。在我看来,以某种方式使表单偏移是好的,即使只是顶部/底部边框 - 通常你可以使整个页面内的小盒子。但是,对于像注册系统这样的东西,你也可以将整个页面作为形式 - 不那么令人讨厌的额外内容越好。

#4


0  

It's quite subjective.

这是非常主观的。

The importance with colors is that a) they should NOT be disruptive and distracting, and b) you should be very, very consistent with their use.

颜色的重要性在于:a)它们不应该具有破坏性和分散注意力,并且b)你应该非常非常符合它们的使用。

Same rule applies for all other visual elements, e.g., graphics, fonts, what not.

同样的规则适用于所有其他视觉元素,例如图形,字体,不适用。