html中浅灰色怎么表示

html-css019

html中浅灰色怎么表示,第1张

1:可以用英文字母表示 gray2:十六进制 (#ccc)3:rgb(22,22,22)4:rgba(22,22,22,.5)英文和数字我仅代表举例,不管是什么颜色,都可以这样添加,希望我的回答对你有帮助

style="width:300px" class="<%if rec(1)<>"" then%>sch1<%else%>sch0<%end if%>" 这里做了手脚了,检查css定义中或者外部引用的css文件中是否有.sch1 和.sch0, 看看是否定义了color为灰色.

第一步,点击文本框,在属性栏中填写你需要的文字;见下图

第二步,为文本框文字添加css属性,点击文本框,可以在css面板中直接选择颜色或填写值;(可以在网页中直接定义css,也可以新建一个css文件)

显示效果

如果要实现鼠标点击灰色文字自动消失,需要使用js编程,可以在网上找js或jquery效果代码添加进页面内。

附上具体代码:

<!DOCTYPE html><html><head><style>.txt{    color:#ccc}.focus{    color:#333}</style><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script><script>$(document).ready(function(){    var str="我是灰色文字"    $(".txt").val(str)         $(".txt").focus(function(){        var v=this.value        if(v == str){            $(this).val("").addClass("focus")        }    }).blur(function(){        var v=this.value        if(v == ""){            $(this).val(str).removeClass("focus")                     }    })})</script></head><body><input class="txt" type="text" value="我是灰色文字"/></body></html>