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