실습문제 1-4

WEB/TRAINNING 2017. 11. 4. 19:20 |

4. 본문에 있는 그림 1-14의 test3.html을 자세히 들여다보고 <span>Love Me Tender</span>에 의해 출력된 텍스트 위에 마우스를 올리면 엘비스 프레슬리의 사진 대신 자신의 사진이 출력되도록 수정하라. 사진 이미지는 test3.html 파일이 있는 폴더에 두면 된다.



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html>
<head>
    <title>웹 페이지의 구성 요소</title>
<style>
    body 
    {    
        background-color:linen;
        color:green;
        margin-left:40px;
        margin-right:40px 
    }
    h3
    {    
        text-align:center;
        color:darkred;
    }
    hr
    {    height:5px;
        border:solid grey;
        background-color:grey;
    }
    span
    {    
        color:pink;
        font-size:20px;
    }
</style>
<script>
    function show() { // <img>에 이미지 달기
        document.getElementById("fig").src = "a.png"
    }
    function hide() { // <img>에 이미지 제거
        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>
cs






 

'WEB > TRAINNING' 카테고리의 다른 글

실습문제 2-1  (0) 2017.11.04
Open Challenge 02. 컴퓨터 기술 소개 웹 페이지 : HTML 태그로 만들기  (0) 2017.11.04
실습문제 1-3  (0) 2017.11.04
실습문제 1-2  (0) 2017.11.04
실습문제 1-1  (0) 2017.11.04
Posted by 너래쟁이
: