选择麦当劳套餐的小网站

第一项前段结构

<!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;

}

  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

党泽龙

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值