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

2カラムレイアウト作成

Posted at

サイトでよくある2カラムレイアウトを作成する。

・左レイアウトは300px固定で右レイアウトは可変にする。
・親要素にdisplay: flexをつける
・可変レイアウトにはflex: 1をつける

.parent {
    display: flex;
    height: 100vh;
}

.menu {
    width: 300px;
    background-color: violet;
}

.content {
    flex: 1;
    background-color: aqua;
}
import React from 'react'
import './Column2Layout.css'

export const Column2Layout = () => {
    return (
        <div className="parent">
            <div className="menu"></div>
            <div className="content"></div>
        </div>
    )
}

スクリーンショット 2020-11-17 23.04.23.png

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