Html 如何设置文本字段的样式,使其没有边框?
我有一个文本字段,我不想在它周围显示边框,因为它是只读文本字段。如何使其显示为没有边框和背景色?由于您没有提供任何有关css版本的信息,下面是一个示例:Html 如何设置文本字段的样式,使其没有边框?,html,css,Html,Css,我有一个文本字段,我不想在它周围显示边框,因为它是只读文本字段。如何使其显示为没有边框和背景色?由于您没有提供任何有关css版本的信息,下面是一个示例: <style type="text/css"> input[type=text] { border: 0px; background: transparent; } </style> <input type="text" value="helllo" />
<style type="text/css">
input[type=text]
{
border: 0px;
background: transparent;
}
</style>
<input type="text" value="helllo" />
输入[类型=文本]
{
边界:0px;
背景:透明;
}
由于您没有提供任何有关css版本的信息,下面是一个示例:
<style type="text/css">
input[type=text]
{
border: 0px;
background: transparent;
}
</style>
<input type="text" value="helllo" />
输入[类型=文本]
{
边界:0px;
背景:透明;
}
编辑:哦,你知道吗,transparent
实际上可以在IE6上运行。我记得它对某些属性不起作用,例如border
编辑:哦,你知道吗,
transparent
实际上可以在IE6上运行。我记得它对某些属性不起作用,例如border
尝试了以下内容:
<input class="noBorderAndBackground" type="text" />
noBorderAndBackground{
background-color:white;
border-style:none;
}
无名氏与背景{
背景色:白色;
边框样式:无;
}
尝试了以下内容:
<input class="noBorderAndBackground" type="text" />
noBorderAndBackground{
background-color:white;
border-style:none;
}
无名氏与背景{
背景色:白色;
边框样式:无;
}
input.asLabel
{
边界:无;
背景:透明;
}
input.asLabel
{
边界:无;
背景:透明;
}
能否添加一些标记代码?你的css试用版?你能添加一些标记代码吗?有你的css测试吗?
<html>
<head>
<style type="text/css">
input.asLabel
{
border: none;
background: transparent;
}
</style>
</head>
<body>
<form>
<input class="asLabel" type="text" value="See, don't touch :)" disabled/>
</form>
</body>
</html>