LoginSignup
0
1

More than 5 years have passed since last update.

【備忘録】 cssで画面の縦横を判別して切り替える

Posted at

スマホ用サイトなどで画面の向きに応じてスタイルを切り替えたい場合の記述

css
@media screen and (orientation:landscape) {
  /* 横向き用スタイル */
}

@media screen and (orientation:portrait) {
  /* 縦向き用スタイル */
}
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1