๐Ÿ“– Coding Study/์›น ๋””์ž์ธ

2023.03.29 ์ˆ˜ (CSS ์‹ค์Šต)

๋นต๋ชจ๋ฃจ 2023. 3. 29. 22:22

ํ”„๋ก ํŠธ์—”๋“œ์›น๋””์ž์ธ 4์ฃผ์ฐจ 2์ฐจ์‹œ ๊ฐ•์˜๋‚ด์šฉ

์†Œ์Šค์ฝ”๋“œ์™€ ๊ฒฐ๊ณผ๋ฌผ

<!doctype html>
<html>
    <head>
        <meta charset="utf-8">
        <title>์นดํ’€ ์‚ฌ์ดํŠธ</title>
        <style>
            .slogan {
                background-color: rgba(0, 0, 0, 0.4); /*๋„ค๋ฒˆ์งธ ์•ŒํŒŒ๊ฐ’ = ํˆฌ๋ช…๋„ ์กฐ์ ˆ*/
                position: absolute; /*๋ณธ๋ž˜์˜ ํ๋ฆ„์—์„œ ๋–ผ์–ด๋ƒ„*/
                top : 50%;
                left : 50%;
                transform: translate(-50%, -50%);
                color: white;
                text-align: center;
                padding-left: 90px;
                padding-right: 90px;
                padding-top: 20px;
                padding-bottom: 10px;
            }
            
            .slogan > h1 {
                font-style: italic;
                font-family: "Book Antique", cursive; /*cursive๋Š” ํ•„๊ธฐ์ฒด๋ฅผ ์˜๋ฏธ. book antiqueํฐํŠธ๊ฐ€ ์„ค์น˜๋œ ์ปดํ“จํ„ฐ๋Š” ๋ถ ์•คํ‹ฐํฌ ํฐํŠธ๋กœ ๋ณด์ด๊ณ , ์—†์œผ๋ฉด cursive์ค‘์— ์•„๋ฌด ํฐํŠธ๋‚˜ ๋ณด์ด๋ผ๋Š” ์˜๋ฏธ*/
                margin: 0;
            }
            
            button {
                border: none;
                padding: 10px 25px; /*์•ž ์ˆซ์ž๊ฐ€ top, bottom์ด๊ณ  ๋’ท ์ˆซ์ž๊ฐ€ left right๊ฐ’*/
                background-color: #ddd; /*์›๋ž˜๋Š” #dddddd์ธ๋ฐ ๋‹ค ๋˜‘๊ฐ™์œผ๋‹ˆ ์ค„์—ฌ์“ธ ์ˆ˜ ์žˆ์Œ*/
                font-weight: bold;
                cursor: pointer;
            }
            
            button:hover { /*๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ ธ์„ ๋•Œ*/
                background-color: orangered;
                color: white;
            }
            
            #video {
                position: fixed;  /*์›๋ž˜์˜ ํ๋ฆ„ ์ƒ์—์„œ ์ œ๊ฑฐํ•œ ๋‹ค์Œ์— ๋ธŒ๋ผ์šฐ์ € ์ฐฝ์— ๊ณ ์ •์‹œํ‚ด*/
                right:0;
                bottom:0;
                min-width: 100%;
                min-height: 100%;
            }
            
            ul {
                position: absolute;
                list-style-type : none; /*๋ชฉ๋ก์˜ ์ฉœ์ฉœ์ฉœ์„ ์—†์• ์คŒ*/
                background-color: rgb(0, 0, 0);
                overflow:hidden;
                margin: 0;
                padding: 0;
            }
            li {
                float: left; /* ํ๋ฆ„์ƒ์—์„œ ์ œ๊ฑฐํ•ด์„œ ํฌ์ง€์…˜๊ณผ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋ ˆ์ด์•„์›ƒ์„ ์กฐ์ ˆํ•ด์ฃผ๋Š” ์†์„ฑ, ์™ผ์ชฝ์œผ๋กœ ๋ฐฐ์น˜*/
            }
            li > a{ /*ํ•˜์ดํผ๋งํฌ๊ฐ€ ์•„๋‹Œ ๊ฒƒ์ฒ˜๋Ÿถ ๋ณด์ด๊ฒŒ*/
                text-decoration: none;
                display: block; /*์ธ๋ผ์ธ ์—˜๋ฆฌ๋จผํŠธ๋ฅผ ๋ธ”๋ก ์—˜๋ฆฌ๋จผํŠธ๋กœ ๋ณ€๊ฒฝ*/
                padding: 14px 16px;
                color: white;
                text-align: center;
            }
            li >a:hover {
                background-color: olivedrab;
            }
        </style>
    </head>
    <body>
        
        <p><video id="video" autoplay muted loop width="10px" height="auto">
            <source src = "images/pexels-c-technical-6117579.mp4" type = "video/mp4">
        </video></p>
        <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">Location</a></li>
            <li><a href="#">Our Story</a></li>
            <li style = "float: right"><a href="#">Home</a></li>
        </ul>
        <div class="slogan">
            <h1>Best Carfull Service</h1>
            <button>Go Carfull!</button>
        </div>
    </body>
</html>
1.00

 

LIST