アプリ版:「スタンプのみでお礼する」機能のリリースについて

例えば、

<section>
<div class="a"><img src="a.html></div>
<div class="b"><img src="b.html><div>
</section>

とあります。
これら、aクラスとbクラスをそれぞれ、横並びにして、aのマージンレフトを30px,bのマージンレフトを50pxとします。

このように、各々違うマージンをmargin-leftを使用せずに、justify-contentで、設定するには、どうすれば、良いでしょうか。

A 回答 (1件)

finaltida108070809さん


・・・・・justify-contentで、設定する・・・・・・・・・

space-aroundなどを使ったら如何ですか。

ご参考に↓
http://www.htmq.com/css/justify-content.shtml

<head>
<meta charset="utf-8">
<style>
section {
background:#eee;;
width:190px;
display: flex; justify-content:space-around;
}
</style>
</head>
<body>
<section>
<div class="a"><img src="https://oshiete.xgoo.jp/images/v2/common/profile …
<div class="b"><img src="https://oshiete.xgoo.jp/images/v2/common/profile …
</section>
<section>
</section>
</body>
</html>
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!