위치 고정 너비 100 %
나는이 position:fixed
넓은 100 % 높이 250 픽셀에서 왼쪽 열을 나는 상단에 있지만,이 예와 같이 왼쪽 열, 오른쪽에 고정, 유체 수평 막대를 배치하기 위해 노력하고있어 :
그러나 이것이 내가 여기서 얻는 것입니다.
이것이 내가 한 일입니다.
.page-wrapper, html, body {
width:100%;
height:100%;
margin:0;
padding:0;
}
.left-column {
position:fixed;
top:0;
left:0;
z-index:1000;
width:250px;
height:100%;
background:#090909;
}
.top-bar {
position:fixed;
top:0;
left:250px;
width:100%;
height:54px;
background:#090909;
z-index:1000;
}
이 고정 된 상단 막대를 화면 폭의 100 %로 확장하지 않고 어떻게 만들 수 있습니까? 꽤 복잡한 반응 형 템플릿을 만드는 데 오랜 세월을 보냈고 콘텐츠를 추가 한 후 상단 표시 줄의 오른쪽에있는 항목이 화면에서 사라지고 있다는 것을 방금 알게 되었기 때문에 이것이 간단한 수정이되기를 바랍니다.
I do have one idea but may not be the most ideal, so interested in others suggestions first. The left fixed column could be given a higher z-index value than the top bar, remove the left-margin from the top bar, but instead put a left-margin on the top bar contents, the same as the width of the left column. Sounds confusing but possible.
Very simple solution that won't require the latest CSS version is not setting width
at all. Instead just set right: 0
, which will force the right border of the top bar to sit at the right border as can be seen in this fiddle.
.top-bar {
position:fixed;
top:0;
left:250px;
right:0;
height:54px;
background:#090909;
z-index:1000;
}
I've added a red border so it's easier to see where the box ends.
Instead of using left: 250px
use padding-left:250px
in conjuction with box-sizing: border-box
:
.top-bar {
position:fixed;
top:0;
left:0;
width:100%;
height:54px;
background:#090909;
z-index:1000;
padding-left: 250px;
-moz-box-sizing: border-box:
box-sizing: border-box:
}
Try this
.left-column {
float:left;
width:150px;
height:100px;
background:#090909;
color:white;
}
.top-bar {
margin-left:150px;
background:yellow;
border:2px solid red;
}
참고 URL : https://stackoverflow.com/questions/18442628/position-fixed-width-100
'development' 카테고리의 다른 글
IntelliJ Idea, 관련없는 프로젝트 파일의 오류에 관계없이 코드 실행 (0) | 2020.11.11 |
---|---|
AngularJS : 딥 링크로 $ locationProvider.html5Mode를 활성화하는 방법 (0) | 2020.11.11 |
Dockerfile CMD 내에서 변수를 어떻게 사용할 수 있습니까? (0) | 2020.11.11 |
테이블 레이아웃이있는 테이블 : 고정; (0) | 2020.11.11 |
엔터티 프레임 워크 코드는 먼저 "구별 자"열을 만듭니다. (0) | 2020.11.11 |