2
1

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

縦横幅がinline-block要素のように可変なものを中央配置させたい。CSS

Last updated at Posted at 2021-04-23

👋こんにちは。僕は、watnowでUX/UIデザインをしています。
縦横幅がinline-block要素のように可変なものを中央配置させたいと悩んでいたらしれっとメンバーが教えてくれたのでそれを紹介します。
#結果とコード
モーダルで使用することが多いと思うのでそのスタイルで書いています。
Screen Shot 2021-04-23 at 11.21.15.png
Screen Shot 2021-04-23 at 11.21.27.png
Screen Shot 2021-04-23 at 11.23.20.png

hoge.css
.wrapper {
 display: flex;
 position: fixed;
 justify-content: center;
 align-items: center;
 background-color: rgba(26, 32, 35, 0.8);
 margin: auto;
 top: 0;
 bottom: 0;
 left: 0;
 right: 0;
}
.contents {
 min-width: 360px;
 max-width: 80%;
 height: auto;
 min-height: 360px;
 background-color: #fff;
 padding: 24px;
 display: inline-block;
}

#おわりに
json to csvというJSONをCSVに変換するツールをメンバーと作ってみたので是非使ってみてください。

2
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?