是否有可能只用 css/html 来制作这样的东西placeholder
:
我的意思是里面的文字placeholder
,一部分是一种风格,一部分是另一种风格,包括虚线下划线
.search{
position:relative;
margin:26px 0 2px;
}
.search-input{
border: 1px solid #d8d8d8;
display: block;
width: 100%;
height: 52px;
font-size: 14px;
padding: 12px 57px 12px 20px;
-webkit-border-radius: 52px;
-moz-border-radius: 52px;
border-radius: 52px;
}
.search-btn{
position:absolute;
top:0;
right:0;
bottom:0;
background:url("https://isstatic.askoverflow.dev/9vArC.png") no-repeat center center;
width:54px;
padding:0;
border:none;
}
<div class="search">
<input class="search-input" type="search" placeholder="Например: Артикул a2343-JFKLFLI3920ee">
<input class="search-btn" type="button">
</div>
如果此选项是
placeholder
使用真实元素完成的(尽管您需要一些代码)怎么办:诀窍是使用它,
<label .. for="search">
以便将对它的点击传输到input
有可能是这样的:
这是一个粗略的草图,需要完成到想要的状态,但大意是这样的。
如果没有
js
, 没有after
\before
: