Skip to content

Instantly share code, notes, and snippets.

@egoing
Last active April 10, 2022 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egoing/a0832e20f103ec619ec50fc8081984dc to your computer and use it in GitHub Desktop.
Save egoing/a0832e20f103ec619ec50fc8081984dc to your computer and use it in GitHub Desktop.
자바스크립트 예제 - 메뉴
<html>
<head>
<style>
#nav{
font-size:0;
padding:0;
display:grid;
grid-template-columns: 70px 70px 100px;
}
#nav li{
list-style: none;
font-size:20px;
min-width:50px;
padding:5px;
text-align: center;
}
#nav li:hover{
background-color:black;
color:white;
cursor:pointer;
}
.content {
display:none;
}
</style>
</head>
<body>
<ol id="nav">
<li
onmouseover="document.querySelector('#html').style.display = 'block';"
onmouseleave="document.querySelector('#html').style.display = 'none';"
>HTML</li>
<li
onmouseover="document.querySelector('#css').style.display = 'block';"
onmouseleave="document.querySelector('#css').style.display = 'none';"
>CSS</li>
<li
onmouseover="document.querySelector('#javascript').style.display = 'block';"
onmouseleave="document.querySelector('#javascript').style.display = 'none';"
>JavaScript</li>
</ol>
<div class="content" id="html">
The HyperText Markup Language or HTML is the standard markup language for documents designed to be displayed in a web browser.
</div>
<div class="content" id="css">
Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML.[1] CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript.
</div>
<div class="content" id="javascript">
JavaScript (/ˈdʒɑːvəskrɪpt/),[10] often abbreviated JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS.[11] Over 97% of websites use JavaScript on the client side for web page behavior,[12] often incorporating third-party libraries.[13] All major web browsers have a dedicated JavaScript engine to execute the code on users' devices.
</div>
</body>
</html>
@egoing
Copy link
Author

egoing commented Apr 10, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment