元素固定位置水平,静态垂直 [英] Element fixed position horizontally, static vertically
本文介绍了元素固定位置水平,静态垂直的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
CSS:x轴上的固定位置,但不是y?
b
$ b
我有一个HTML页面,它应该水平滚动,并有一个固定的位置标题标签。
I have a HTML page which is supposed to scroll horizontally which has a fixed position header tag.
任何人都可以想到一个可能的非JavaScript解决方案?
Can anyone think of a possible non-javascript solution?
推荐答案
固定位置有很好的糟糕iOS设备上的支持。而不是为您的标题使用固定位置,您应该在页面上保持静态。使用 overflow:auto
的容器环绕要水平滚动的内容,以便内容滚动而不是整个页面。
Fixed position has pretty lousy support on iOS devices. Instead of using a fixed position for your header, you should leave it static on the page. Surround your content you want to scroll horizontally with a container with overflow: auto
, so that the content scrolls rather than the entire page.
预览: http://jsfiddle.net/Wexcode / vfZjb /
这篇关于元素固定位置水平,静态垂直的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文