我怎样才能拥有始终浮动的文本:带有水平滚动条的右侧
我在网页顶部有一个顶部导航部分,并且设置了一些内容,因为
float: right;
这效果很好,除了页面的内容部分现在非常宽(我必须设置 min-width: 1700px ;)
现在的问题是 float: right
效果很好,除了当我滚动到右侧时,它不再位于右侧。
我的选择是: 也
- 使顶部部分
min-width:1700px
但它们会向右浮动,除非我滚动到右侧,否则不会显示
有没有办法让 < code>float: "rightofMonitor" 因此它默认位于显示器查看屏幕的右侧,但是当我水平滚动时它会继续向右移动。
I have a top navigation section at the top of a web page and I have some content that is setup as
float: right;
this works great except that the content part of the page is now very wide (i have to set min-width: 1700px;
)
the issue is now the float: right
works great except when i scroll to the right, its no longer on the right.
my choices are either to:
- Make the top section
min-width:1700px
as well but them it would float right and it wouldn't be shown unless i scrolled to the right
Is there any way to have float: "rightofMonitor"
so it would default to the right side of the monitor viewing screen but when i scrolled over horizontally it will keep moving right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
忘记漂浮。您应该将位置设置为
absolute
,然后将right
设置为0
。Forget the floating. You should set the position to
absolute
and then set theright
to0
.听起来好像你把它放在一个容器中,并且它漂浮在容器的右侧而不是主体的右侧。将其从容器中取出并放在 body 标签下方。或者给它绝对定位
right:0;
Sounds like you have it in a container and it is floating to the right of the container not the body. Take it out of the container and put it below the body tag. Or give it absolute positioning of
right:0;
您可以使用这个: http://jsfiddle.net/XHRkS/
使用
position:fixed;
和right:0;
You can use this : http://jsfiddle.net/XHRkS/
use the
position:fixed;
andright:0;