9
8

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 5 years have passed since last update.

css:cssだけで画像をトリミング表示する。

Posted at

●background-positionで表示位置を指定する。

<div style="height:100px;width:200px; background-image:url('画像ファイルパス'); background-size:auto; background-position:-406px -77px;"></div>

●画像を拡大・縮小しつつ位置を指定する。

<div style="height:100px;width:200px; background-image:url('画像ファイルパス'); background-size:3000px 3000px; background-position:-406px -77px;"></div>

⇒これを応用するとイメージの拡大・縮小をjsで実装可能。

9
8
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
9
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?