fixed - govl2233/project_studyej GitHub Wiki

โ˜…๋ถ€๋ชจ์ž์‹๊ด€๊ณ„๊ฐ€ ์„ฑ๋ฆฝ์ด์•ˆ๋˜๊ณ  ํ™”๋ฉด์ƒ์ด ๊ธฐ์ค€์ด๋จ

ex)

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>fixed๋ถ€๋ชจ์ž์‹๊ด€๊ณ„์—†์Œ</title>
    <style type="text/css">
    
        .header{
            border:1px #f00 solid;
            width:100%; 
            height: 80px;
            background-color: rgba(0,0,0,.5);
            position: fixed;
            top:0;
        }
   
        .contents{
            border:1px #f0f solid;
            width: 500px;
            height: 1000px;
            margin:90px auto;
        }
        
            .top{
            border:1px #00f solid;
            width: 80px;
            height: 200px;
            left:50%;
            margin-left:260px;
            position:fixed;
        }
        
    </style>
</head>
<body>
    <div class="header"></div>
    <div class="contents">
        <div class="top"></div>
    </div>
        <!--contents ์•ˆ์— top๋ฅผ ๊ฐ์‹ธ์ค„๋•Œ๋Š” top class ์•ˆ์— top์œ„์น˜๋ฅผ ์•ˆ๋„ฃ์–ด์ค˜๋„๋œ๋‹ค.-->
        <!--๊ทธ๋Ÿฌ๋‚˜ class๊ฐ€ ๋”ฐ๋กœ ์ง€์ •๋ ๋•Œ์—๋Š” stlye์—์„œ topํƒœ๊ทธ์—  ์œ„์น˜top์„ ์„ค์ •ํ•ด์ค˜์•ผํ•œ๋‹ค.(fixed๋Š” absolute๋ž‘ ๊ฐ™์•„์„œ ํ™”๋ฉด์ƒ๊ธฐ์ค€์œผ๋กœ๋˜๊ธฐ๋•Œ๋ฌธ์—)-->
    
 </body>
</html>
โš ๏ธ **GitHub.com Fallback** โš ๏ธ