メインビジュアルの分解はこのようになります ※スライドショーの実装はまだしなくて大丈夫です

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/9c5e56ac-041a-403c-a6b5-45dc07717f20/_2021-04-01_1.52.38.jpg

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ce74e92c-b5f1-4d05-9544-3b857bce8c98/main_visual_2-0x0.jpg

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/c382cbd8-c819-470c-a840-cdd574343a80/_2021-04-01_1.57.29.jpg

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/59b17ea2-c681-45b1-ba78-c2ebda77501a/_2021-04-01_1.57.39.jpg

パーツ的にはこの3つのパーツで構成されています これを重ねることでメインビジュアルができています! ここで使うのがbackground-imagepositionです background-imageについてはこちら(https://narrow-poultry-311.notion.site/background-image-5833673d28374ee2b4f72987d9894040)で解説しているので、こちらを参照ください

positionはflex-boxと同様に、階層を理解して親要素子要素を理解することが必須ですので、ざっくり説明します!

■positionの使い方

基本構造 親 position: relative; 子 position: absolute;

親要素を基準にして、top、right、bottom、leftを指定することで子要素を自由に移動させることができる、以下のようにして指定します

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bdcc1b4c-06aa-432e-abdf-ad4164405446/_2021-04-01_2.08.34.jpg

左上に子要素を配置する
.red-box {
    position: relative;
}

.yellow-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/249ff825-1433-454d-9d4f-b90c410d31e7/_2021-04-01_2.09.34.jpg

右下に子要素を配置する
.red-box {
    position: relative;
}

.yellow-box {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 100px;
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/8864533e-7421-45bb-8e26-6c2871544f98/_2021-04-01_2.18.35.jpg

.red-box {
    position: relative;
}

.yellow-box {
    position: absolute;
    top: 50px;
    left: 100px;
    width: 100px;
    height: 100px;
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/53fd5a02-2cd0-420b-9c64-a5779ee10151/_2021-04-01_2.22.35.jpg

.red-box {
    position: relative;
}

.yellow-box {
    position: absolute;
    bottom: 200px;
    left: 100px;
    width: 100px;
    height: 100px;
}

■少し特殊な上下左右中央揃え

上からちょうど真ん中の場所に移動させたい場合はどのようにCSSをかけば良いと思いますか?

半分の位置だからtop: 50%;と指定すればいけそうと思いましたか? これを実際に指定してみると、、、

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/ae3aa3ee-acca-4991-974d-d9181b0d60a3/transrate-501.png

子要素の上辺がtopから50%の位置に来てしまいます、、、 これだと真ん中の位置からズレて配置されてしまっています

本当の半分の位置にするためにはtransform: translateY(-50%);という指定を追加でする必要があり、そのコードを書き足すと

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a171d9f2-b74f-41ce-8dd4-240d83c4047c/transrate-502.png