F2E合作社|交錯漂浮版|網頁切版


Posted by itiswonderfall on 2021-11-24

CSS

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@100;300;400;500;700;900&display=swap" rel="stylesheet">
<style>
    * {
        margin: 0;
        padding: 0;
        list-style: none;
    }
    body {
        padding: 100px 0;
        background: linear-gradient(20deg, #3d5493, #1aa2a0) fixed center center / 100% 100%;
    }
    .wrap {
        width: 1200px;
        margin: auto;
    }
    .item {
        display: flex;
        align-items: center;
        margin-bottom: 70px;
        font-family: 'Noto Sans TC', sans-serif;
    }
    .item h2 {
        font-weight: 900;
    }
    .item p {font-weight: 500;}
    .item .pic {
        width: 55%;
        flex-shrink: 0;
    }
    .item .pic img {
        width: 100%;
        vertical-align: middle;
    }
    .item .txt {
        width: 55%;
        flex-shrink: 0;
        padding: 50px 30px;
        box-sizing: border-box;
        position: relative;
        z-index: 1;
    }
    .item > :first-child {
        margin-right: -10%;
    }
    .item:nth-child(1) .txt {
        background-color: rgba(240, 174, 193, .8);
    }
    .item:nth-child(2) .txt {
        background-color: rgba(42, 253, 208, .8);
    }
</style>

HTML

<div class="wrap">
    <div class="item">
        <div class="pic">
            <img src="https://picsum.photos/600/350?ramdom=10">
        </div>
        <div class="txt">
            <h2>Item 1</h2>
            <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Saepe ipsum ad consectetur dolorem dolores voluptatem odio provident, labore? Nobis, quibusdam. Cum, necessitatibus eos sit sunt doloribus. Natus praesentium beatae odit.</p>
        </div>
    </div>
    <div class="item">
        <div class="txt">
            <h2>Item 2</h2>
            <p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Saepe ipsum ad consectetur dolorem dolores voluptatem odio provident, labore? Nobis, quibusdam. Cum, necessitatibus eos sit sunt doloribus. Natus praesentium beatae odit.</p>
        </div>
        <div class="pic">
            <img src="https://picsum.photos/600/350?ramdom=20">
        </div>
    </div>
</div>

最後奉上 CSScoke 的影片教學

 


 

資料來源

金魚都能懂的網頁切版 : 交錯漂浮版 NO004 | 切版教學 | HTML教學 | 網頁教學 | 網頁切版


#f2e #F2E合作社 #網頁切版 #交錯漂浮







Related Posts

發生在 GitHub conflict 的衝突——無法發 PR 合併分支

發生在 GitHub conflict 的衝突——無法發 PR 合併分支

Redux(三):純函數 (Pure Function) 簡介

Redux(三):純函數 (Pure Function) 簡介

來學 React 吧之六_React 基礎總結

來學 React 吧之六_React 基礎總結


Comments