表单中的背景色 [英] Background color in forms

查看:80
本文介绍了表单中的背景色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为HTML表单标签设置背景颜色,但这不起作用吗?!我以为这是一个简单的任务!

I'm trying to set a background color to the HTML form tag, but it doesn't work?! I thought it was a simple task!

#form {
    background-color: #000;
    padding: 10px;
}


推荐答案

我们能看到HTML吗您的表格代码?也许有一个您正在使用的类与您的#form声明冲突。

Can we just see the HTML code of your form? Maybe there's a class you're using that conflicts with your #form declaration.

此外,如果您希望 form block具有背景,请将其放在div和背景。

Also, if you want the "form block" to have a background, put it inside a div and background it.

如果要为表单输入提供背景,则应为输入对象提供样式

If you want to give a background to the form inputs, you should give a style to the input objects

#form input{
  background-color: #000;
}

#form input .submit{ ... }

#form label { ... }

以此类推。

这篇关于表单中的背景色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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