float

이시원·2022년 3월 10일
0

CSS

목록 보기
9/14

○float

요소를 띄워서 배치하는 속성

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* float : 요소를 띄워서 배치하는 속성 */
        /* left : 왼쪽에 요소 띄우기 
            right : 오른쪽에 요소 띄우기
            none : 띄우지 않음(기본값)*/
        img{
            width: 200px;
            height: 200px;
            float: left;
        }
        /* clear : float의 반대되는 속성 */
        div{
            /* both : 내 양옆에 아무것도 주지 않겠다 */
            /* clear : both; */
        }
    </style>
</head>
<body>
    <img src="../img/everything.jpg" alt="">
    <div>
You are my everything
My everything
My everything
You are my everything
My everything
비가 내리는 날엔
우리 방안에 누워 아무 말이 없고
감은 눈을 마주 보면 모든 게 우리거야
조금 핼쑥한 얼굴로 날 찾아올 때도
가끔 발칙한 얘기로 날 놀랠킬 때도
You are my everything
My everything
My everything
You are my everything
My everything
넌 내 모든 거야
내 여름이고 내 꿈이야
넌 내 모든 거야
나 있는 그대로 받아줄게요
내 모든걸 모든걸
내 모든걸 모든걸
내 모든걸 모든걸
내 모든걸 모든걸
내 모든걸 모든걸
내 모든걸 모든걸 줄게
    </div>
</body>
</html>

profile
코딩공부

0개의 댓글