{HTML} block, inline 요소

J Y·2023년 7월 19일

<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
 
  <!-------block--->
  <div>2</div>
  <div>3</div>
  <div>5</div>
  <!------- inline--->
  <span>1</span>
  <span>2</span>
  <span>3</span>
</body>
</html>

 

div,span {
  width:80px;
  height:80px;
  margin:20px;
    
}

div{
  background:red;
  display: inline-block;
}

span{
  background:blue;
  display:block;
    
}

1개의 댓글

comment-user-thumbnail
2023년 7월 19일

감사합니다, 이 글이 많은 도움이 되었습니다.

답글 달기