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

Gridの使い方

Posted at

#Grid
スクリーンショット 2020-11-05 8.37.11.png

スクリーンショット 2020-11-05 8.37.19.png

index.html
  <div class="wrapper">
    <div class="box">
      <a href="#">
        <h3>東京の建築A</h3>
        <img src="img/tokyo-station.jpg" alt="">
        <p>koment</p>
      </a>
    </div><!-- ./box -->
  </div><!-- ./wrapper -->
style.css
.wrapper{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  grid-gap: 16px;/* 真ん中だけ隙間16px */
}

 grid-template-columns: repeat(4, 1fr);と書くと、4カラム常にできます。

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?