2

我有一个包含很多<input type="text">字段的页面。不是每一个都必须被填满。当用户决定他准备好了,他应该点击提交按钮。通常我会将提交按钮放在页面的底部和/或顶部。

但是,如果按钮会随着用户向下滚动,那就太好了。

有什么办法吗?

4

3 回答 3

5

使用 CSS:

#mybutton {
   position: fixed;
}
于 2013-09-20T13:52:16.093 回答
3

尝试添加到按钮并为和style="position: fixed"输入一些绝对值topleft

于 2013-09-20T13:52:52.087 回答
1

我想这就是你要找的东西:

JSFIDDLE

CSS

#button-bar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 30px;
    text-align: center;
    background-color: #ddd;
}

#content {
    height: 600px;
}

HTML

<div id="button-bar">
    <input type="submit" value="Submit" name="submit"/>    
</div> 

<div id="content">
    <!-- content goes here -->  
</div> 
于 2013-09-20T13:59:47.043 回答