Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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,这里我为textbox创建了css效果。但它没有效果 有什么问题请改正 css如下所示: in1 { border-radius: .2em; border: 1px solid #cccccc; -webkit-transition: border linear .2s, box-shadow linear .2s; -moz-transition: border linear .2s, box-shadow linear .2s; -o-transi

这里我为textbox创建了css效果。但它没有效果

有什么问题请改正

css如下所示:

in1
{
    border-radius: .2em;
    border: 1px solid #cccccc;

    -webkit-transition: border linear .2s, box-shadow linear .2s;
    -moz-transition: border linear .2s, box-shadow linear .2s;
    -o-transition: border linear .2s, box-shadow linear .2s;
    transition: border linear .2s, box-shadow linear .2s;
}

in1:focus
{
    border-color: rgba(1, 168, 255, 0.8);
    outline: 0;
    outline: thin dotted \9;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px     rgba(82,168,236,.6);
    -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);
}

你只需要在css中的类名前加一个句号

.in1 { }
类选择器的前缀为。。这里您只使用in1,它是一个元素选择器。这将尝试选择名为in1的元素

只需将选择器更改为:

.in1{ ... } ……和:

.in1:focus {
    ...
}

您可以在W3官方文档中阅读更多有关CSS选择器的信息。来自同一文档的:

E.warning—其类为警告文档语言的E元素指定如何确定类


不看你的小提琴,我猜你在使用课堂


试着添加一个。在css的开头,因此:。在1

中,必须遵循以下步骤,类选择器是一个名称,前面有一个句号“.”,ID选择器是一个名称,前面有一个哈希字符“”

而不是in1{}put.in1{}


小提琴链接不正确请为您提到的课程添加正确的小提琴链接。谢谢你提到我。但是,当我在本地系统上使用相同的css时,它并没有显示出与小提琴相同的颜色效果。也许是其他的东西覆盖了这个样式?如果你用Firebug检查它,你能看到应用的样式吗?可能是。Firebug显示样式text.style1。style1是类的名称。但这不是您在原始帖子中的类名称?我认为你需要发布更多的html/css。