0
我想删除默认围绕输入字段(垂直对齐),我曾尝试使用:CSS删除输入文字居中
input[type="text} {
vertical-align: top;
}
基本上,我建立一个“文本框”组成,其中有的占位符(后来图标等)来看看下面的代码:
定制CSS:
<div class="textbox">
<div class="textbox-placeholder">Username or email</div>
<input type="text" class="textbox-input" />
</div>
HTML:
body {
font: 400 16px/24px 'Lucida Grande', sans-serif;
}
.textbox {
height: 50px;
position: relative;
background-color: #E1E1E1;
border: 1px solid #CCCCCC;
}
.textbox-input {
display: block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
input[type="text"] {
margin: 0;
padding: 0;
outline: 0;
border: 0;
background: none transparent;
font: inherit;
}
.textbox-input {
z-index: 20;
}
.textbox-input {
z-index: 10;
}
你的意思是像[this](http://jsfiddle.net/DTgty/1/)? – Vucko 2013-04-28 22:34:24
@PSCoder我不知道这是他想要的:) – Vucko 2013-04-28 22:36:45
@Vucko当你有我的jsFiddle,并开始在输入字段中输入时,你可以看到文本在中间垂直对齐,我想删除这个,但不知道如何 – onlineracoon 2013-04-28 22:42:52