<!DOCTYPE html>
<html lang="kr">
<head>
<meta charset="UTF-8">
<title>네비게이션</title>
<style>
.navi>li{
background-color: black;
list-style-type: none;
width: 100px;
height: 50px;
text-align: center;
}
.navi>li>a{
color: white;
text-decoration: none;
line-height: 50px;
width: 100%;
height: 100%;
}
.navi>li>a:hover{
font-size: 1.2em;
font-weight: bold;
}
</style>
</head>
<body>
<ul class="navi">
<li><a href="/html5.html">HTML5</a></li>
<li><a href="/css3.html">CSS3</a></li>
<li><a href="/javascript.html">JavaScript</a></li>
<li><a href="/jQuery.html">jQuery</a></li>
</ul>
</body>
</html>
이 문제는 CSS를 수정하는 문제로 네비게이션 바가 한줄이 아니라 여러줄로 출력되는 문제를 가지고 있다.
.navi>li{
background-color: black;
list-style-type: none;
width: 100px;
height: 50px;
text-align: center;
**float:left;**
}
.navi>li>a{
color: white;
text-decoration: none;
line-height: 50px;
width: 100%;
height: 100%;
**display: block;**
}
.navi>li>a:hover{
font-size: 1.2em;
font-weight: bold;
}
<!DOCTYPE html>
<html lang="kr">
<head>
<meta charset="UTF-8">
<title>갤러리</title>
<style>
.img-box{
margin: 0 auto;
width: 365px;
height: 400px;
}
.img-box>img{
position: absolute;
width: 200px;
height: 200px;
top: 50px;
z-index: 10;
}
#first{
left:20px;
}
#second{
left:80px;
}
#third{
left:140px;
}
.img-box>img:hover{
z-index: 50;
}
</style>
</head>
<body>
<div class="img-box">
<img id="first" src="img/flower1.PNG">
<img id="second" src="img/flower2.PNG">
<img id="third" src="img/flower3.PNG">
</div>
</body>
</html>
.img-box{
margin: 0 auto;
**position:relative;**
width: 365px;
height: 400px;
}
.img-box>img{
position: absolute;
width: 200px;
height: 200px;
top: 50px;
z-index: 10;
}
#first{
left:20px;
}
#second{
left:80px;
**z-index:40**
}
#third{
left:140px;
}
.img-box>img:hover{
z-index: 50;
}