본문 바로가기
Frontend/CSS

[CSS] 반응형 디자인 media query

by 민두이 2023. 1. 25.
728x90
반응형
 

Using media queries - CSS: Cascading Style Sheets | MDN

Media queries allow you to apply CSS styles depending on a device's general type (such as print vs. screen) or other characteristics such as screen resolution or browser viewport width. Media queries are used for the following:

developer.mozilla.org

 

  • 사용 예시
/* Media Query */
@media screen and (max-width:760px) {
  .navbar__toggle-btn {
    display: block;
  }

  #navbar {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .navbar__menu {
    flex-direction: column;
    text-align: center;
    display: none;
  }

  .about__majors {
    flex-direction: column;
  }

  .major {
    margin-bottom: 2rem;
  }

  .skillset {
    flex-direction: column;
  }

  .project {
    flex-grow: 1;
  }

  .testimonial__avatar {
    width: 80px;
    height: 80px;
  }

}
728x90