利用Bootstrap、jQuery、Html、CSS等设计蛋糕商城注册页面

1.引入jquery-3.6.0.min.js        bootstrap.min.js    bootstrap.min.css 资源

<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
    <script src="jquery-3.6.0.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>

2.通过css.js来修改bootstrap导航样式与鼠标滑动效果

 <style>
       .navbar-default .navbar-nav>.active>a, .navbar-default .navbar-nav>.active>a:focus, .navbar-default .navbar-nav>.active>a:hover{
            color: white;
            background-color: #f07818;
        }
        .navbar-default {
            background-color: #5d4b33;
        }
        .navbar-default .navbar-nav>li>a {
            color: white;
        }
        .form-control{
          width: 500px;
          margin-bottom: 10px;
        }
        .navbar-nav li {
          border-left: 0.3px solid white;
          border-right: 0.3px solid white;
        }

        .navbar-nav li:last-child {
          border-right: none;
        } 
    </style>



<script>
        $("ul > li").hover(function () {
        $(this).addClass("active").siblings().removeClass("active")
        })
</script>

3.注册界面设计代码:

  <div  id="register" style=" margin-top: 30px;margin-left: 30%; display:none;">
          <h2 style="margin-left: 160px;margin-top: 50px;margin-bottom: 100px; color: #f07818;"><b>注册新用户</b></h2>
          <label for="inp" class="redStar"><b>用户名</b><span style="color: red;">*</span></label>
          <input type="text" class="form-control" placeholder="请输入用户名">
          <label for="inp" class="redStar"><b>邮箱</b><span style="color: red;">*</span></label>
          <input type="email" class="form-control" placeholder="请输入邮箱">
          <label for="inp" class="redStar"><b>密码</b><span style="color: red;">*</span></label>
          <input type="password" class="form-control" placeholder="请输入密码">
          <label for="inp" ><b>收货人</b></label>
          <input type="text" class="form-control" placeholder="请输入收货名">
          <label for="inp" ><b>收货电话</b></label>
          <input type="text" class="form-control" placeholder="请输入收货电话">
          <label for="inp" ><b>收货地址</b></label>
          <input type="text" class="form-control" placeholder="请输入收货地址">
          <input style="width: 80px;margin-left:190px;border-radius: 5px;margin-top: 50px;font-size: 20px;color: white;background-color: #f07818;" class="btn-default" type="submit" value="提交">
          <div style="width: 115%;margin-left: 100px;font-size: 15px; margin-top: 100px;"><footer><b>xxx &copy; All rights Reseverd</b></footer></div>
        </div>
      </form>

4.点击导航栏的注册链接,则呈现注册界面,点击其它的链接则跳转相应的界面代码:

<script>
     function showInfo(event) {
          event.preventDefault();
          var target = event.target.getAttribute("data-target");
          var divs = document.querySelectorAll("div[id]");
          for (var i = 0; i < divs.length; i++) {
            var div = divs[i];
            if (div.id === target) {
              div.style.display = "block";
            } else {
              div.style.display = "none";
            }
          }
        }
    </script>

5.运行效果:

 

  • 8
    点赞
  • 76
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值