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;
)
这很有用,但是页面的内容部分现在非常宽(我必须设置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 - 把顶部的部分设为最小宽度:1700px,但是它会向右浮动,除非我向右滚动,否则不会显示出来
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.
是否有办法有浮动:"right tofmonitor "这样它就会默认在监视器查看屏幕的右侧,但当我水平滚动时,它会继续向右移动。
3 个解决方案
#1
4
You can use this : http://jsfiddle.net/XHRkS/
您可以使用这个:http://jsfiddle.net/XHRkS/。
use the position:fixed;
and right:0;
使用位置:固定;和正确的:0;
#2
1
Forget the floating. You should set the position to absolute
and then set the right
to 0
.
忘记漂浮。你应该把这个位置设为绝对,然后把右边设为0。
#3
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;
听起来好像你把它装在一个容器里,它是浮在容器的右边而不是身体。把它从容器中取出,放到body标签下面。或者给它权利的绝对定位:0;
#1
4
You can use this : http://jsfiddle.net/XHRkS/
您可以使用这个:http://jsfiddle.net/XHRkS/。
use the position:fixed;
and right:0;
使用位置:固定;和正确的:0;
#2
1
Forget the floating. You should set the position to absolute
and then set the right
to 0
.
忘记漂浮。你应该把这个位置设为绝对,然后把右边设为0。
#3
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;
听起来好像你把它装在一个容器里,它是浮在容器的右边而不是身体。把它从容器中取出,放到body标签下面。或者给它权利的绝对定位:0;