๐Ÿ’œ HTML,CSS

HTML&CSS ์‹ค์Šต6 (์ •๋ฆฌx)

Genie_. 2024. 3. 23. 22:10
728x90
๋ฐ˜์‘ํ˜•
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>๊ฐ€์ •์šฉ ๊ฟ€์‚ฌ๊ณผ</title>
</head>

</html>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    main{
        width: 700px;
        border: 1px solid black;
        margin: auto; /* width ๊ฐ’์ด ์žˆ์„ ๋•Œ๋งŒ ๋งˆ์ง„ auto ์ ์šฉ๋จ !!  */
    }
    h2{
        color: white;
        background-color: black;
    }
    h3{
        color: red;
        margin: 20px ;
    }
    span{
        display: block;
    }
    .blue{
        display: inline;
        color: blue;
    }
    #s2 div{
        text-align: center;
        font-weight: bold;
        margin: 20px 0;
    }
    #s2 span{
        margin-bottom: 30px;
    }
    .seconds{
        border-bottom: 1px solid black;
    }

    #s1{
        position: relative; /* ์ž์‹์˜ position ๊ธฐ์ค€์ด ๋˜๋„๋ก */
        height: 300px;
        margin-bottom: 20px;
        background-image: url("https://news.kbs.co.kr/data/news/2021/10/18/20211018_iYfwL8.jpg");
        background-repeat: no-repeat;
        background-position: center;
        background-size: cover;
        overflow: hidden;
    }
    #s1 > div{
        position: absolute; /* ๋ถ€๋ชจ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์œ„์น˜ ์žก์•„๋ผ */
        padding: 10px 20px;
        width: 100%; /* ๋ถ€๋ชจ ๊ฐ€๋กœ ๊ฐ’์ด๋ž‘ ๋˜‘๊ฐ™์ด ๋งž์ถฐ๋ผ */
        bottom: 0; /* ๋‚ด ๋ถ€๋ชจ์˜ ์ตœ ํ•˜๋‹จ์— ๋ถ™์—ฌ๋ผ */
        background-color: rgba(0,0,0,0.8);
    }
    #s1 h1{
        color: white;
        margin-bottom: 10px;
    }
    #s1 span{
        margin: 5px 0;
    }
    #s1 p{
        color: orange;
    }

</style>
<body>
<main>
    <section id="s1">
        <div>
            <h1>๊ฐ€์ •์šฉ ๊ฟ€์‚ฌ๊ณผ</h1>
            <p>
                <span>ํ ์ง‘์ด ์žˆ๊ณ  ์•ฝ๊ฐ„์€ ๋ชป์ƒ๊ฒผ์ง€๋งŒ ๋ง›๊ณผ ์˜์–‘์€ ๊ทธ๋Œ€๋กœ์ž…๋‹ˆ๋‹ค</span>
                <span>์งˆ ์ข‹์€ ์‚ฌ๊ณผ๋ฅผ ์ €๋ ดํ•˜๊ฒŒ ์ฆ๊ฒจ๋ณด์„ธ์š”</span>
            </p>
        </div>
    </section>

    <section id="s2">
        <h2>ํ™•์ธํ•˜์„ธ์š”</h2>
        <div>
            <h3>์ฃผ๋ฌธ ๋ฐ ๋ฐฐ์†ก</h3>
            <p>
                <span><span class="blue">์˜คํ›„ 2์‹œ ์ด์ „</span> ์ฃผ๋ฌธ๊ฑด์€ ๋‹น์ผ ๋ฐœ์†กํ•ฉ๋‹ˆ๋‹ค</span>
                <span>2์‹œ ์ดํ›„ ์ฃผ๋ฌธ๊ฑด์€ ๋‹ค์Œ๋‚  ๋ฐœ์†กํ•ฉ๋‹ˆ๋‹ค(์ฃผ๋ง์ œ์™ธ)</span>
            </p>
        </div>
        <div class="seconds">
            <h3>๊ตํ™˜ ๋ฐ ํ™˜๋ถˆ</h3>
            <p>
                <span>๋ถˆ๋งŒ์กฑ์‹œ <span class="blue">100% ํ™˜๋ถˆ</span>ํ•ด ๋“œ๋ฆฝ๋‹ˆ๋‹ค</span>
                <span>๊ณ ๊ฐ์„ผํ„ฐ๋กœ ์ „ํ™”์ฃผ์„ธ์š”</span>
            </p>
        </div>
        <div>
            <h3>๊ณ ๊ฐ์„ผํ„ฐ</h3>
            <p>
                <span>0000-0000</span>
                <span>์ƒ๋‹ด์‹œ๊ฐ„: ์˜ค์ „ 9์‹œ ~ ์˜คํ›„ 6์‹œ (ํ† /์ผ ๊ณตํœด์ผ ํœด๋ฌด)</span>
            </p>
        </div>
    </section>
</main>
</body>

728x90
๋ฐ˜์‘ํ˜•