Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何设置文本字段的样式,使其没有边框?_Html_Css - Fatal编程技术网

Html 如何设置文本字段的样式,使其没有边框?

Html 如何设置文本字段的样式,使其没有边框?,html,css,Html,Css,我有一个文本字段,我不想在它周围显示边框,因为它是只读文本字段。如何使其显示为没有边框和背景色?由于您没有提供任何有关css版本的信息,下面是一个示例: <style type="text/css"> input[type=text] { border: 0px; background: transparent; } </style> <input type="text" value="helllo" />

我有一个文本字段,我不想在它周围显示边框,因为它是只读文本字段。如何使其显示为没有边框和背景色?

由于您没有提供任何有关css版本的信息,下面是一个示例:

<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>