반응형
Notice
Recent Posts
Recent Comments
Link
«   2025/09   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Archives
Today
Total
관리 메뉴

trycode

CSS 100%로 채우기 본문

html & css & scss

CSS 100%로 채우기

hello-world 2021. 1. 20. 00:31
728x90
반응형

CSS 100%로 채우기

 

 

화면에 100%로 채우기 css

.target{
max-width:none;
max-height: 100%;
min-width: 100%;
min-height: 100%;
position: absolute;
left: 50%;
top: 50%;
-webkit-transform: translate(-50%,-50%);
transform: translateX(-50%) translateY(-50%);

/* 만약에 다른곳에서 상속되어 width/height가 설정된다면 아래처럼 덮어씌우자.

width:auto;

height:auto;

*/
}

/*16:9의 비율로 와이드 화면이 된다면 아래처럼 미디어쿼리로 값변경*/

@media (min-aspect-ratio: 16/9){

.target{max-height: none; max-width: 100%;}

}
반응형

'html & css & scss' 카테고리의 다른 글

FOUC 현상  (0) 2021.01.20
특수한 mobile css  (0) 2021.01.19
zen-coding 기본  (0) 2021.01.19
css 참고 및 generator  (0) 2021.01.19
Comments