Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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
使用css格式化文本字段并对外部边框应用缩进?_Css - Fatal编程技术网

使用css格式化文本字段并对外部边框应用缩进?

使用css格式化文本字段并对外部边框应用缩进?,css,Css,有人知道如何将css样式的缩进和边框发光(激活时)应用于textarea字段吗 我试图用纯css设计一个文本框 .field{ width:150px; height:20px; border:1px solid #c6c6c6; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; padding-left:5px; padding-right:4px; } .field:active { widt

有人知道如何将css样式的缩进和边框发光(激活时)应用于textarea字段吗

我试图用纯css设计一个文本框

.field{
width:150px;
height:20px;
border:1px solid #c6c6c6;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
padding-left:5px;
padding-right:4px;

}

.field:active {
width:150px;
height:20px;
border:4px solid #blue;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
padding-left:5px;
padding-right:4px;

}

您需要使用
:focus
,而不是
:active
,来设置用户正在控制的输入的样式<代码>:活动仅在单击项目时激发,因此它不会影响用户已使用选项卡或当前正在键入的输入区域

要获得辉光,而不是实体边框,可以使用
框阴影

.field:focus {
    box-shadow: 0 0 8px blue;
    outline: 0; /* optionally remove or change the outline */
}
我不清楚您想要如何缩进文本,但您可以使用
text indent

注意:CSS中有一个错误-十六进制颜色以哈希开头,但命名的颜色不以哈希开头,即蓝色不正确