Computer >> 컴퓨터 >  >> 프로그램 작성 >> CSS

CSS로 세로 메뉴를 만드는 방법은 무엇입니까?

<시간/>

다음은 CSS로 세로 메뉴를 생성하는 코드입니다 -

예시

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<style>
.Menu {
   width: 200px;
}
.links {
   background-color: rgb(251, 255, 188);
   color: black;
   display: block;
   padding: 12px;
   text-decoration: none;
}
.links:hover {
   background-color: rgb(85, 85, 85);
   color:white;
}
.links.selected {
   background-color: rgb(0, 0, 0);
   color: white;
}
</style>
</head>
<body>
<div class="Menu">
<a href="#" class="links selected">About Us</a>
<a class="links" href="#">Social Links</a>
<a class="links "href="#">Visit Us</a>
<a class="links" href="#">More info</a>
<a class="links" href="#">Phone Number</a>
</div>
</body>
</html>

출력

위의 코드는 다음 출력을 생성합니다 -

CSS로 세로 메뉴를 만드는 방법은 무엇입니까?