![](/img/trans.png)
[英]How to make div extend to the bottom of the screen regardless of resolution?
[英]How to make div container float to side of screen regardless of screen resolution?
我有一台筆記本電腦和一台台式計算機,台式機是我主要工作的計算機。 我的台式機的顯示器尺寸為1920x1080,筆記本電腦的屏幕為1366x768。 我注意到有一天,我一直在從事的容器div項目沒有出現在筆記本電腦的屏幕上。 我需要容器div始終保持在屏幕右側,而不管屏幕的分辨率/大小如何。
CSS:
#container {
margin:0px auto 0 auto;
height:800px;
width:960px;
text-align:left;
padding-right:0px;
float:right;
position:relative;
}
您可以在margin屬性中將第二個auto替換為0。
#container {
margin: 0 0 0 auto;
...
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.