改变CSS中的颜色不起作用 [英] Change color in CSS not working

查看:148
本文介绍了改变CSS中的颜色不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

改变css中的颜色不工作



CSS:

.btn {color:red; background-color:blue;}



HTML:

< input type ='button'value ='click'class ='btn '/>



这改变了背景颜色但没有文字颜色



我是什么尝试过:



CSS:

.btn {color:red; background-color:blue;}



HTML:

< input type ='button'value ='click'class ='btn '/>

Change color in css not working

CSS:
.btn{color:red; background-color:blue;}

HTML:
<input type='button' value='Click' class='btn' />

This changed background-color but not text color

What I have tried:

CSS:
.btn{color:red; background-color:blue;}

HTML:
<input type='button' value='Click' class='btn' />

推荐答案

如果这是您页面上具有给定样式的唯一按钮,则以下代码将适合您。



If this the only button with the given style on your page, then the below code will work for you.

<html>
<head>
<style>
	.btn{color:red; background-color:blue;}
</style>
</head>
<body>
	<input type='button' value='Click' class='btn' />
</body>
</html>





谢谢,



Thanks,


这篇关于改变CSS中的颜色不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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