LoginSignup
0
0

More than 3 years have passed since last update.

flexの使い方

Posted at

flex

スクリーンショット 2020-10-26 9.02.27.png

index.html
<div class="feature-item">
          <div class="feature-img-wrapper">
            <a href="https://www.yahoo.co.jp" target="_blank">
            <img src="img/feature/feature.jpg" alt="">
            </a>
          </div>
          <div class="feature-body">
            <p><span class="text-bold">サイト名:</span>
              <br>サイト名が入る<br>
              <a href="#" target="_blank">https://●●●.com</a>
            </p>
          </div><!-- ./feature-body -->
</div><!-- ./feature-item -->
style.css
.feature-item{
  display: flex;
  margin-bottom: 80px;
}
.feature-img-wrapper{
  flex-basis: 45%;
  margin-right: 40px;
}
.feature-body{
  flex: 1;
}

参考

ポートフォリオHTMLテンプレート(ベーシック)

この間書いた「float」を使ったボックスの配置から「flex」でやってみました。
この間書いた「float」の記事

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