css 区分 input 的类型 input[type="text"]
2013-06-01 10:08
477 查看
css 区分 input 的类型 input[type="text"]
input[type="text"]{ border:1px; border-style:solid; border-color: #CCCCCC; }
--------------------------------------------------
ie6 兼容
/* ie6 不支持 */
input[type="text"]{ border:1px; border-style: solid; border-color: #CCCCCC; }
/* ie6 支持,但效果太差了,用 "Defuult" 就 ok 了! */
input{
/*
border-color:expression(this.type=="text"?"#CCCCCC":this.style.borderColor);
border:expression(this.type=="text"?"1px":this.style.border);这样不行
border:expression(this.type=="text"?"1px":this.style.bdddddorder);这样反而行,应该是脚本错误使用了缺省值
border-style:expression(this.type=="text"?"solid":this.style.borderStyle);
*/
border-color:expression(this.type=="text"?"#CCCCCC":"Default");
border:expression(this.type=="text"?"1px":"Default");
border-style:expression(this.type=="text"?"solid":"Default");
}
--------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
input[type="text"]{
background-color:#FFC;}
input[type="password"]{
background-color:#339966;}
input[type="submit"]{
background-color:blue;
color:white;}
input[type="reset"]{
background-color:navy;
color:white;}
input[type="radio"]{
margin:10px;}
input[type="checkbox"]{
margin:10px;}
input[type="button"]{
background-color:lightblue;}
</style>
</head>
<body>
<dl>
<dt>textbox:<dd><input type="text" value="www.66css.com">
<dt>password:<dd><input type="password" value="www.66css.com">
<dt>submit:<dd><input type="submit">
<dt>reset:<dd><input type="reset">
<dt>radio:<dd><input type="radio" name="ground1">
<dt>checkbox:<dd><input type="checkbox" name="ground2">
<dt>button:<dd><input type="button" value="www.66css.com">
</dl>
</body>
</html>
input[type="text"]{ border:1px; border-style:solid; border-color: #CCCCCC; }
--------------------------------------------------
ie6 兼容
/* ie6 不支持 */
input[type="text"]{ border:1px; border-style: solid; border-color: #CCCCCC; }
/* ie6 支持,但效果太差了,用 "Defuult" 就 ok 了! */
input{
/*
border-color:expression(this.type=="text"?"#CCCCCC":this.style.borderColor);
border:expression(this.type=="text"?"1px":this.style.border);这样不行
border:expression(this.type=="text"?"1px":this.style.bdddddorder);这样反而行,应该是脚本错误使用了缺省值
border-style:expression(this.type=="text"?"solid":this.style.borderStyle);
*/
border-color:expression(this.type=="text"?"#CCCCCC":"Default");
border:expression(this.type=="text"?"1px":"Default");
border-style:expression(this.type=="text"?"solid":"Default");
}
--------------------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
input[type="text"]{
background-color:#FFC;}
input[type="password"]{
background-color:#339966;}
input[type="submit"]{
background-color:blue;
color:white;}
input[type="reset"]{
background-color:navy;
color:white;}
input[type="radio"]{
margin:10px;}
input[type="checkbox"]{
margin:10px;}
input[type="button"]{
background-color:lightblue;}
</style>
</head>
<body>
<dl>
<dt>textbox:<dd><input type="text" value="www.66css.com">
<dt>password:<dd><input type="password" value="www.66css.com">
<dt>submit:<dd><input type="submit">
<dt>reset:<dd><input type="reset">
<dt>radio:<dd><input type="radio" name="ground1">
<dt>checkbox:<dd><input type="checkbox" name="ground2">
<dt>button:<dd><input type="button" value="www.66css.com">
</dl>
</body>
</html>
相关文章推荐
- css 区分 input 的类型 input[type="text"]
- 设置<input type="text">的默认值
- JQuery获取input type="text"中的值的各种方式
- html中去掉文本框(input type="text")的边框或只显示下边框
- css style(about input type="text")
- 如何给 input 中 type="text" 设置css
- ie6bug----------------------ie6 下不解析 css input[type="text"] 等等类别的选择
- <input type="file">定义样式并获取上传文件路径及指定文件类型
- <s:textfield name="number" value="%{#student.number}" cssClass="InputStyle"/>
- <link rel="stylesheet" type="text/css" href="css/index.css">是啥意思?
- <input type="file" />浏览时只显示指定文件类型
- 使用<input type="text" value=<%=str%>>出现取值不全的问题
- html中input type="text" 的readonly 属性与asp.net服务器控件TextBox的readonly属性的js赋值、调用的小bug
- 在input的type="text"里控制只能输入数字
- jQuery设置input type="text"的值
- <input type="file" />浏览时只显示指定文件类型
- <input type="text" value="">实现输入提示
- 小细节:css文件的导入,关于link type="textcss"的解析
- <form action="get.php" method="post" id="tform"> <input type="text" name="one"> <a href="jav
- css 区分 input 的类型 input[type…