0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

object-fitとは(画像のトリミング)

Posted at

はじめに

object-fitの使い方と効果についての備忘録です

object-fitとは

画像のトリミングをCSSプロパティ「object-fit」で行うことができる。
画像の縦横比を保ちながらトリミングする事ができます。

使用例(CSSサンプルコード)
object-fit:cover //中央でトリミング

.example img {
   width: 100%;
   height: 300px;
   object-fit: cover;
}
//縦横の画像比率を綺麗に保ちつつ、画像の中央でトリミングが可能
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?