본문 바로가기

웹 프로그래밍/명품 웹 프로그래밍 답안

1장 연습문제&실습문제 정답

연습문제&실습문제
연습문제
*실제 답안과 다를 수 있습니다.
실습문제
*실제 답안과 다를 수 있습니다.

실습문제3

<!DOCTYPE html>
<html>
	<head>
		<title>웹 페이지의 구성 요소</title>
		<style>
			body{
				background-color: linen;
				color: green;
				margin-left: 40px;
				margin-right: 40px;
			}
			h3{
				color: brown;
				text-align: center;
			}
			hr{
				height: 7px;
				border: solid grey;
				background-color: grey;
			}
			span{
				color: violet;
				font-size: 20px;
			}
		</style>
	</head>
	<body>
		<h3>Elvis Presley</h3>
		<hr>
		He was an American singer and actor. In November 1956, he made his film debut in <span>Love Me Tender</span>. He is often referred to as "<span>the King of Rock and Roll</span>".
	</body>
</html>

실습문제4

<!DOCTYPE html>
<html>
	<head>
		<title>웹 페이지의 구성 요소</title>
		<style>
			body{
				background-color: linen;
				color: green;
				margin-left: 40px;
				margin-right: 40px;
			}
			h3{
				color: brown;
				text-align: center;
			}
			hr{
				height: 5px;
				border: solid grey;
				background-color: grey;
			}
			span{
				color: blue;
				font-size: 20px;
			}
		</style>
		<script>
			function show(){
				document.getElementById("fig").src="shrek.png";
			}
			function hide(){
				document.getElementById("fig").src="";
			}
		</script>
	</head>
	<body>
		<h3>Elvis Presley</h3>
		<hr>
		<div><img id="fig" src=""></div>
		He was an American singer and actor. In November 1956, he made his film debut in <span onmouseover="show()" onmouseout="hide()">Love Me Tender</span>. He is often referred to as "<span>the King of Rock and Roll</span>".
	</body>
</html>