1.如何自己手动制作一个右键菜单。代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>右键菜单</title>
<style>
* {
margin: 0;
padding: 0;
list-style: none;
}
.box {
width: 500px;
height: 500px;
border: 2px solid black;
margin: 0 auto;
margin-top: 20px;
/* 相对定位 */
position: relative;
}
.menu {
width: 100px;
height: 120px;
border: 1px solid #ccc;
text-align: center;
background-color: lightcoral;
color: white;
/* 绝对定位 */
position: absolute;