ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • position
    css 2021. 6. 6. 14:31

    태그의 위치를 이동시켜보자

    <!DOCTYPE html>
    <html>
      <head>
          <style>
              h1{
                  border:1px solid red;
                  margin:100px;
              }
              #me{
                  position:relative;
                  left:100px;
                  top:100px;
              }
          </style>
      </head>
      <body>
      <h1>Hello world</h1>
      <h1 id="me">Hello world</h1>
      </body>
    </html>

    이때 position:relative 설정을 하지않으면 포지션이 이동하지않는다

    그 이유는 position의 default값은 static으로 모든 포지션속성을 무시하기 때문이다.

    'css' 카테고리의 다른 글

    태그 다중 style속성  (0) 2021.06.08
    position  (0) 2021.06.07
    width,height,vw,vh  (0) 2021.06.06
    css border  (0) 2021.06.06
    인라인,블록  (0) 2021.06.06
Designed by Tistory.