【发布时间】:2014-04-07 11:06:57
【问题描述】:
我有一个底部有一行的输入字段,很像教科书的一行。我希望能够显示占位符文本以及用户在行上方输入的文本。
我在这里做了一个小提琴:http://jsfiddle.net/H7AVP/
这是我的 HTML 的样子:
<input type="text" placeholder="subscribe for early access" class="form-control email">
还有我的 CSS(不是针对问题优化的跨浏览器):
.email::-webkit-input-placeholder {
font-family: 'Open Sans', sans-serif;
font-size: 25px;
padding-bottom:45px;
margin-top:-10px;
}
input {
background-color: #2980b9;
outline: 0;
border-bottom: 2px;
border-top: 0;
border-left: 0;
border-right: 0;
border-bottom-style: double;
border-bottom-color: #34495e;
height: 46px;
width: 300px;
}
input:focus{
outline:0;
}
textarea:focus{
outline:0;
}
【问题讨论】:
-
所以你想让文本更靠近行吗?像这样:jsfiddle.net/H7AVP/1?