css输入框里的默认背景字怎么设置

html-css010

css输入框里的默认背景字怎么设置,第1张

在css中,可以color属性来设置文本框内的文字颜色,操作方法如下。

设备:联想电脑

系统:win10

代码编辑器:zend studio 10.0

1、首先新建一个html文件,命名为test.html,在test.html文件内,使用input标签创建一个输入框。

2、在test.html文件内,设置input标签的class属性为myin。

3、在css标签内,通过class定义input的样式,设置它的宽度为250px,高度为35px。

4、在css标签内,再使用color属性设置输入框文字的颜色为红色。

5、最后在浏览器打开test.html文件,查看实现的效果。

可以。

参考如下代码:

-------------------------------------------------

你要用一个标签(span,p,div...等等)

然后给标签设置背景颜色background-color即可

-------------------------------------------------

运行效果如图:

<div style="width:800pxheight:600pxbackground:url(https://www.taopic.com/uploads/allimg/130427/240403-13042F61F080.jpg) no-repeat center / cover">背景图

<div style="width:400pxheight:200pxmargin:200px autobackground-color:rgba(0,0,0,0.5)color:#ffftext-align:centerline-height:200px">这是文字这是文字</div>

</div>