본문 바로가기

Programming/HTML

신호등 div를 활용하여 그리기

trafficLight.html

<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="myCSS1.css">
</head>
<body>
	<div id=black>
		<div id=red></div>
		<div id=yellow></div>
		<div id=green></div>
	</div>

</body>
</html>

 

trafficLight.css

@charset "EUC-KR";

#black {
	background-color: black;
	width: 120px;
	height: 360px;
	border-radius: 20px;
	box-sizing: border-box;
	padding-left: 10px;
	padding-top: 15px;
}

#red {
	background-color: red;
	width: 100px;
	height: 100px;
	border-radius: 50px;
}

#yellow {
	background-color: yellow;
	width: 100px;
	height: 100px;
	border-radius: 50px;
	margin-top: 15px;
}

#green {
	background-color: green;
	width: 100px;
	height: 100px;
	border-radius: 50px;
	margin-top: 15px;
}