【发布时间】:2014-09-22 06:22:45
【问题描述】:
一方面我希望“眼睛”图标像现在一样显示(在按钮上方,所以我认为 z-index 没有帮助),但另一方面我想要按钮在其所有表面都可点击,在眼睛区域也是如此。
另外,有没有更好的方法来定位眼睛?因为一旦我使用不同的文本然后“点击我”,我将不得不相应地设置眼睛的绝对位置。有什么方法可以更好地定义它?
<form action="1.php" method="POST" target="_blank">
<input type="submit" class="button" value="Click Me"><span class="fa fa-eye fa-lg foo" "></span>
</form>
.foo{
color:red;
font-size:1.7em;
position: absolute;
height: 11px;
top: 18px;
left: 15px;
pointer-events: none;
}
.button {
display: inline-block;
zoom: 1;
line-height: normal;
white-space: nowrap;
vertical-align: baseline;
text-align: center;
cursor: pointer;
-webkit-user-drag: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-family: inherit;
font-family: arial;
font-size: 17px;
padding: .5em .9em .5em 2em;
text-decoration: none;
border-radius: 4px;
text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}
【问题讨论】:
-
您必须使用
<input type="submit">还是可以使用button? -
一定要用输入法,好的我加代码
标签: html css css-position z-index positioning