Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.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,我想得到一个类似于soundcloud的效果: 对于我的文本框和文本区域,我只是不知道它们是如何做到的,我真的不知道如何使背景动态。嗯,我想我希望的是一个我可以使用的教程,有人有什么想法吗?这个标题只有一个背景色,所以很简单 文本区域有一个小背景图像,使用背景位置:右下 对于曲线边界,您必须使用CSS3,这在IE中不起作用: -webkit-border-bottom-right-radius: 20px; -webkit-border-bottom-left-radius: 20px; -m

我想得到一个类似于soundcloud的效果:


对于我的文本框和文本区域,我只是不知道它们是如何做到的,我真的不知道如何使背景动态。嗯,我想我希望的是一个我可以使用的教程,有人有什么想法吗?

这个标题只有一个
背景色,所以很简单

文本区域有一个小背景图像,使用
背景位置:右下

对于曲线边界,您必须使用CSS3,这在IE中不起作用:

-webkit-border-bottom-right-radius: 20px;
-webkit-border-bottom-left-radius: 20px;
-moz-border-radius-bottomright: 20px;
-moz-border-radius-bottomleft: 20px;
border-bottom-right-radius: 20px;
border-bottom-left-radius: 20px;

像那样,但是你需要选择哪个角,当然还有半径。Google border radius获取更多信息。

标题只有一个
背景色,所以这很简单

文本区域有一个小背景图像,使用
背景位置:右下

对于曲线边界,您必须使用CSS3,这在IE中不起作用:

-webkit-border-bottom-right-radius: 20px;
-webkit-border-bottom-left-radius: 20px;
-moz-border-radius-bottomright: 20px;
-moz-border-radius-bottomleft: 20px;
border-bottom-right-radius: 20px;
border-bottom-left-radius: 20px;
像那样,但是你需要选择哪个角,当然还有半径。谷歌边界半径获取更多信息。

这里很少使用来自此网站的边界图像

多亏了css3,边框图像的所有功能都是可伸缩的。

这里很少使用来自此应用程序的边框图像


多亏了css3,border images的所有功能都是可伸缩的。

他们通过一些非常基本的css3属性实现了这些功能。这里有一些细节

1.他们正在将
右下半径
左上半径
更改为如下所示的曲线

input, 
textarea, 
select {
    -moz-box-sizing: border-box;
    border: 1px solid #CCCCCC;
    border-bottom-right-radius: 7px;
    border-top-left-radius: 7px;
    color: #333333;
    display: block;
    font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
    font-size: 12px;
    margin: 0 0 0.3em;
    padding: 3px 0 3px 3px;
}
input[type="text"]:focus,
input[type="text"]:hover,
input[type="text"].focus,
textarea:focus,textarea:hover,
textarea.focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus,
input[type="password"]:focus,
input[type="password"]:hover,
input[type="password"].focus,
input[type="email"]:focus,
input[type="email"]:hover,
input[type="email"].focus,
input[type="url"]:focus,
input[type="url"]:hover,
input[type="url"].focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus {
    background-color:#f0f6fb;
    background:0 repeat-x scroll 0 0 #f0f6fb;
    -moz-background-size:100% 4px;
    -webkit-background-size:100% 4px;
    background-size:100% 4px;
}
2.现在,他们为自己的
输入
文本框和
文本区域提供了一种
背景色
,就像这样

input[type="text"],
textarea,
input[type="search"],
input[type="password"],
input[type="email"],
input[type="url"],input[type="search"] {
    background-attachment:scroll;
    background-clip:border-box;
    background-color:#F8F8F8;
    background-image:0;
    background-origin:padding-box;
    background-position:0 0;
    background-repeat:repeat-x;
    background-size:100% 4px;
    width:100%;
}
3.最后,他们在
:hover
:focus
上更改
背景色

input, 
textarea, 
select {
    -moz-box-sizing: border-box;
    border: 1px solid #CCCCCC;
    border-bottom-right-radius: 7px;
    border-top-left-radius: 7px;
    color: #333333;
    display: block;
    font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
    font-size: 12px;
    margin: 0 0 0.3em;
    padding: 3px 0 3px 3px;
}
input[type="text"]:focus,
input[type="text"]:hover,
input[type="text"].focus,
textarea:focus,textarea:hover,
textarea.focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus,
input[type="password"]:focus,
input[type="password"]:hover,
input[type="password"].focus,
input[type="email"]:focus,
input[type="email"]:hover,
input[type="email"].focus,
input[type="url"]:focus,
input[type="url"]:hover,
input[type="url"].focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus {
    background-color:#f0f6fb;
    background:0 repeat-x scroll 0 0 #f0f6fb;
    -moz-background-size:100% 4px;
    -webkit-background-size:100% 4px;
    background-size:100% 4px;
}
因此,基本上在悬停或聚焦时,背景色从
#f8f8
更改为
#f0f6fb

你在找这个吗


演示:

他们通过一些非常基本的CSS3属性实现了这些功能。这里有一些细节

1.他们正在将
右下半径
左上半径
更改为如下所示的曲线

input, 
textarea, 
select {
    -moz-box-sizing: border-box;
    border: 1px solid #CCCCCC;
    border-bottom-right-radius: 7px;
    border-top-left-radius: 7px;
    color: #333333;
    display: block;
    font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
    font-size: 12px;
    margin: 0 0 0.3em;
    padding: 3px 0 3px 3px;
}
input[type="text"]:focus,
input[type="text"]:hover,
input[type="text"].focus,
textarea:focus,textarea:hover,
textarea.focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus,
input[type="password"]:focus,
input[type="password"]:hover,
input[type="password"].focus,
input[type="email"]:focus,
input[type="email"]:hover,
input[type="email"].focus,
input[type="url"]:focus,
input[type="url"]:hover,
input[type="url"].focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus {
    background-color:#f0f6fb;
    background:0 repeat-x scroll 0 0 #f0f6fb;
    -moz-background-size:100% 4px;
    -webkit-background-size:100% 4px;
    background-size:100% 4px;
}
2.现在,他们为自己的
输入
文本框和
文本区域提供了一种
背景色
,就像这样

input[type="text"],
textarea,
input[type="search"],
input[type="password"],
input[type="email"],
input[type="url"],input[type="search"] {
    background-attachment:scroll;
    background-clip:border-box;
    background-color:#F8F8F8;
    background-image:0;
    background-origin:padding-box;
    background-position:0 0;
    background-repeat:repeat-x;
    background-size:100% 4px;
    width:100%;
}
3.最后,他们在
:hover
:focus
上更改
背景色

input, 
textarea, 
select {
    -moz-box-sizing: border-box;
    border: 1px solid #CCCCCC;
    border-bottom-right-radius: 7px;
    border-top-left-radius: 7px;
    color: #333333;
    display: block;
    font-family: "Lucida Grande",Arial,Helvetica,Verdana,sans-serif;
    font-size: 12px;
    margin: 0 0 0.3em;
    padding: 3px 0 3px 3px;
}
input[type="text"]:focus,
input[type="text"]:hover,
input[type="text"].focus,
textarea:focus,textarea:hover,
textarea.focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus,
input[type="password"]:focus,
input[type="password"]:hover,
input[type="password"].focus,
input[type="email"]:focus,
input[type="email"]:hover,
input[type="email"].focus,
input[type="url"]:focus,
input[type="url"]:hover,
input[type="url"].focus,
input[type="search"]:focus,
input[type="search"]:hover,
input[type="search"].focus {
    background-color:#f0f6fb;
    background:0 repeat-x scroll 0 0 #f0f6fb;
    -moz-background-size:100% 4px;
    -webkit-background-size:100% 4px;
    background-size:100% 4px;
}
因此,基本上在悬停或聚焦时,背景色从
#f8f8
更改为
#f0f6fb

你在找这个吗


演示:

谢谢,尽管我通常对IE并不在意;)谢谢,虽然我通常不在乎IE;)