第一项前段结构
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Mike Pot Official Website</title>
<!-- HTML -->
<!-- Custom Styles -->
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
WEL COME TO HOME...
</div>
<div class="root">
<div id="header">
<ul>
<li><a href="#">小程序</a></li>
<li><a href="#">详情</a></li>
<li><a href="#">我的</a></li>
</ul>
</div>
<p οnclick="btn()" style="font-size: 5px;">外卖订餐服务</p>
<p style="font-size: 5px;">
麦当劳鸡肉煲套餐
</p>
<div id="main">
</div>
</div>
<script src="main.js"></script>
</body>
</html>
第二项后端
var div = document.getElementById("main");
const count = "0";
function btn() {
div.style.width = '300px';
div.style.height = '400px';
div.style.backgroundImage = "url('images/emo.jpg')";
div.style.backgroundSize = "100%";
div.style.color = 'white';
div.style.position = "relative";
div.style.top = '105px';
if (div <= count) {
div.innerHTML = '你下单四件套39.9元'
alert('三件套餐请下单');
} else if (div >= count) {
alert('四件套请下单');
div.innerHTML = '你下单四件套49.9元'
} else {
false;
}
}
第三项样式
body {
font-size: 15pt;
}
ul{
list-style-type: none;
float: left;
padding-left: 15px;
top: 5px;
}
li{
text-align: center;
}
.root a{
color: white;
font-size: 5px;
float: left;
text-decoration: none;
padding-left: 0;
}
.root{
width: 100%;
height: 600px;
background-color: pink;
}
#header{
width: 200px;
height: 30px;
}
#emo{
height: 40px;
font-size: 15px;
float: left;
}