210514 - 3
layout 정의에 자주 사용되는 중요한 프로퍼티
block과 inline레벨 요소의 특징을 모두 가짐. inline레벨 요소와 같이 한 줄에 표현되면서 width,height,margin프로퍼티를 모두 지정할 수 있다.
요소를 보이게 할 것인지 정의. (요소의 렌더링 여부)
요소의 투명도 정의 0.0~1.0값
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=4, initial-scale=1.0">
<title>Document</title>
<style>
div, img {
float: left;
width: 150px;
height: 150px;
margin: 30px;
background-color: blue;
color: white;
opacity: 0.5;
transition: opacity 1s;
}
div:hover, img:hover {
opacity: 1.0;
}
</style>
</head>
<body>
<div>opacity: 0.5</div>
<img src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQeWMROnWszBhw4kIAIhPJC28aNUU0f5tNplDf3LxlfQ-old63S7iuGoXFu7l7yVUSA9Cw&usqp=CAU" alt="doug">
</body>
</html>
div hover상태
img hover상태