반응형
1차
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>about me</title>
<style>
body{
display:flex;
height:100vh;
align-items: center;
justify-content: center;
flex-direction: column;
}
div{
background-color:teal;
width:200px;
height:200px;
}
/* 이 스크린이 400px보다 작으면 */
/* @media screen and (min-width:800px) and (max-width:1000px){
div{
background-color:tomato;
}
} */
/* @media screen and (min-width:800px) and (max-width:1000px){
div{
background-color:tomato;
} */
@media screen and (min-width:601px) and (max-width:800px) and (orientation:landscape){
div{
background-color:tomato;
}
}
@media screen and (min-width:1200px){
div{
background-color:turquoise;
}
}
span{
font-size:30px;
}
@media screen and (orientation:landscape){
span{
display:none
}
}
</style>
</head>
<body>
<div>
</div>
<span>please flip ur phone</span>
</body>
</html>
2차
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>about me</title>
<style>
body{
display:flex;
height:100vh;
align-items: center;
justify-content: center;
flex-direction: column;
}
div{
background-color:teal;
width:200px;
height:200px;
}
/* 이 스크린이 400px보다 작으면 */
/* @media screen and (min-width:800px) and (max-width:1000px){
div{
background-color:tomato;
}
} */
/* @media screen and (min-width:800px) and (max-width:1000px){
div{
background-color:tomato;
} */
@media screen and (min-width:601px) and (max-width:800px) and (orientation:landscape){
div{
background-color:tomato;
}
}
@media screen and (min-device-width:1200px){
div{
background-color:turquoise;
}
}
span{
font-size:30px;
}
@media screen and (orientation:landscape){
span{
display:none
}
}
@media print {
body{
background-color:green;
}
}
</style>
</head>
<body>
<div>
</div>
<span>please flip ur phone</span>
</body>
</html>
반응형
'Frontend > HTML, CSS, DOM, jQuery' 카테고리의 다른 글
CSS) BEM (Class 이름 네이밍 방법) (0) | 2021.12.12 |
---|---|
HTML) 주요 단축키 (0) | 2021.12.12 |
CSS)Animation (0) | 2021.12.11 |
CSS) Transform (0) | 2021.12.11 |
grid item 움직이기 (0) | 2021.12.07 |