【网页设计】HTML+CSS 实现简单宣传网页设计展示

网站设计包含。
1、图片设计:有背景图片和颜色,同时有一张图片悬浮。
2、字体设计:设置字体大小、颜色等内容。
3、按钮设计:完成点击按钮后弹出视频窗口的功能。
4、视频窗口:视频窗口包括视频进度条、调节音量、窗口全屏、调节视频播放速度以及画中画等功能。


一、网页展示

在这里插入图片描述


二、网页源码


<html><head>
  <style>
    body {
      background-color: #e6e6e6;
      font-family: "Helvetica Neue", sans-serif;
      background-image: url("background.jpg");
      background-size: cover;
      background-position: center;
    }
    .container {
      max-width: 1000px;
      margin: 0 auto;
      padding: 30px;
      text-align: center;
    }
    h1 {
      color: #FF9933;
      font-size: 36px;
      margin: 10px 0;
    }
    p {
      color: #FFFF99;
      font-size: 18px;
      line-height: 1.5;
    }
    .image-container {
      width: 600px;
      height: 400px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    img {
      position: absolute;
      bottom: 100;
      left: 36.5%;
      width: 100%;
      max-height: 500px;
      max-width: 400px;
      border-radius: 10px;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    a {
      display: inline-block;
      margin: 20px 0;
      padding: 12px 24px;
      color: #fff;
      background-color: #3498db;
      border-radius: 5px;
      text-decoration: none;
      transition: all 0.3s;
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
    }
    a:hover {
      background-color: #2980b9;
      box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
      font-weight: bold;
      text-transform: uppercase;
      border: 2px solid #333;
    }
    /* 添加的部分 */
    .video-container {
      /* 居中放置 */
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      /* 与图片一样大小 */
      width: 600px;
      height: 400px;
      /* 隐藏视频窗口 */
      display: none;
      /* 允许关闭 */
      overflow: hidden;
    }
    /* 播放视频 */
    .video-container video {
      width: 100%;
      height: 100%;
    }
    /* 关闭按钮 */
    .video-container .close {
      position: absolute;
      top: 10px;
      right: 10px;
      color: #fff;
      font-size: 20px;
      cursor: pointer;
    }
    .video-container {
    /* 在所有元素之上 */
      z-index: 999;
    }

</style>
</head>
<body>
  <div class="container">
    <h1>圣罗兰小金条</h1>
    <p>YSL圣罗兰小金条口红 哑光新色35金琥珀1966红棕色21</p>
    <div class="image-container" style="display: flex; justify-content: center; align-items: center;">
      <img src="image.jpg" alt="image">
      <a href="#" onclick="document.querySelector('.video-container').style.display='block'">点我查看视频</a>
    </div>

    <div class="video-container">
      <video src="video.mp4" controls=""></video>
      <div class="close">X</div>
    </div>
  </div>



    <script>
      document.querySelector('.close').addEventListener('click', function() {
        document.querySelector('.video-container').style.display = 'none';
      });
</script></body></html>

三、完整素材

完整网站文件(包含素材)在这里 ---->网页设计 HTML+CSS 简单宣传网页设计完整文件

需要可以自行下载获取。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值