软件定制开发供应商用HTML+CSS+JS做一个简单的个人网页

软件定制开发供应商暑假在家闲的没事,软件定制开发供应商写了一个简单的小网页,软件定制开发供应商从网上找了些图片和视软件定制开发供应商频拼起来的,软件定制开发供应商由于经验不足的关系,没有将想添加的东西放进去。

先来看看整个网页效果的视频吧

效果的图片如下(最右边空出来的其实是滑动条,截长屏自动没掉了)

首页

自我介绍

 我的家乡

 大学生涯

 软件资源

整个网页是围绕首页的结构与样式去制作的,只是在每个导航栏网页的content盒子添加了东西而已,其他都是没有变化的。

首页HTML如下(结构还是很简单的)

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>首页</title>
  8. <link href="css/首页.css" rel="stylesheet" type="text/css" />
  9. </head>
  10. <body>
  11. <!--视频背景-->
  12. <div class="home">
  13. <div class="player">
  14. <video src="video/瑞克and莫蒂.mp4" autoplay loop muted></video> <!--自动播放,循环播放,静音-->
  15. </div>
  16. </div>
  17. <!--透明覆盖在视频背景的盒子-->
  18. <div class="home2">
  19. <div class="logo">
  20. <img src="images/logo.png" width="20%" height="15%">
  21. </div>
  22. <div class="name">
  23. <img src="images/name.png" width="15%" height="10%">
  24. </div>
  25. <img id="musics" onclick="button()" src="images/音乐.png" width="3%" >
  26. <audio id="music" autoplay="autoplay" loop="loop" src="音频/音频.mp3" ></audio>
  27. </div>
  28. <!--导航栏-->
  29. <div class="nav">
  30. <div class="left">
  31. <img src="images/瑞克2.png" width="100%" height="100%">
  32. </div>
  33. <div class="menu">
  34. <a href="首页.html">首 &nbsp 页</a>
  35. </div>
  36. <div class="menu">
  37. <a href="自我介绍.html">自我介绍</a>
  38. </div>
  39. <div class="menu">
  40. <a href="我的家乡.html">我的家乡</a>
  41. </div>
  42. <div class="menu">
  43. <a href="大学生涯.html">大学生涯</a>
  44. </div>
  45. <div class="end">
  46. <a href="软件资源.html">软件资源</a>
  47. </div>
  48. <!--最右侧盒子填充用的-->
  49. <div class="right"></div>
  50. </div>
  51. <!--顶部滑出导航栏-->
  52. <div class="header">
  53. <div class="logo2">
  54. <img src="images/logo2.png" width="100%" height="100%">
  55. </div>
  56. <div class="menu1">
  57. <a href="首页.html">首 &nbsp 页</a>
  58. </div>
  59. <div class="menu1">
  60. <a href="自我介绍.html">自我介绍</a>
  61. </div>
  62. <div class="menu1">
  63. <a href="我的家乡.html">我的家乡</a>
  64. </div>
  65. <div class="menu1">
  66. <a href="大学生涯.html">大学生涯</a>
  67. </div>
  68. <div class="end1">
  69. <a href="软件资源.html">软件资源</a>
  70. </div>
  71. <div class="right1">
  72. <img src="images/瑞克3.png" width="100%" height="100%">
  73. </div>
  74. </div>
  75. <!--内容区的主盒子-->
  76. <div class="home3">
  77. <div class="beijing">
  78. <img src="images/背景.png" width="100%">
  79. </div>
  80. <div class="tietu">
  81. <img src="images/瑞克5.png" width="100%" height="100%">
  82. </div>
  83. <!--二维码弹窗-->
  84. <div id="QR">
  85. <img src="images/QR.png" width="100%" height="100%">
  86. </div>
  87. <div id="QR1">
  88. <img src="images/二维码.png" width="100%" height="100%">
  89. </div>
  90. <!--内容区-->
  91. <div class="content">
  92. </div>
  93. </div>
  94. <!--穿插用的小盒子-->
  95. <div class="kong"></div>
  96. <!--底部盒子-->
  97. <div class="footer">
  98. <div class="Morty">
  99. <img src="images/瑞克6.png" width="30%">
  100. </div>
  101. <div class="footer_logo">
  102. <img src="images/瑞克logo.png" width="80%">
  103. </div>
  104. <div class="Rick">
  105. <img src="images/瑞克4.png" width="60%">
  106. </div>
  107. </div>
  108. </body>
  109. </html>

然后就是首页的CSS

  1. body {
  2. margin: 0;
  3. padding: 0;
  4. }
  5. .home {
  6. position: fixed; /*绝对定位,固定在页面上*/
  7. }
  8. .player video{
  9. width: 100%;
  10. height: 100%;
  11. z-index: 1;
  12. }
  13. .home2 {
  14. width: 100%;
  15. height: 100%;
  16. position: absolute;
  17. z-index: 2; /*图像的堆叠顺序*/
  18. }
  19. .logo {
  20. width: 100%;
  21. display: flex;
  22. justify-content: center;
  23. position: absolute;
  24. top: 30%;
  25. }
  26. .name {
  27. width: 100%;
  28. display: flex;
  29. justify-content: center;
  30. position: absolute;
  31. top: 45%;
  32. }
  33. #musics {
  34. animation-name: music; /*这个名称是下方的动画名称*/
  35. animation-timing-function: linear; /*规定动画的速度曲线,linear是匀速旋转*/
  36. animation-duration: 3s;
  37. animation-iteration-count: infinite; /*动画无数次旋转*/
  38. cursor: pointer; /*让鼠标箭头变成一支小手*/
  39. position: absolute;
  40. z-index: 2;
  41. }
  42. @keyframes music{
  43. 0%{
  44. transform: rotate(0deg); /*旋转角度*/
  45. }
  46. 50%{
  47. transform: rotate(180deg);
  48. }
  49. 100%{
  50. transform: rotate(365deg);
  51. }
  52. }
  53. .nav {
  54. width: 100%;
  55. height: 15%;
  56. position: absolute;
  57. top: 90%;
  58. background-color: white;
  59. display: flex;
  60. border-bottom: 1px solid gray;
  61. z-index: 3;
  62. }
  63. .left,.right {
  64. width: 10%;
  65. height: 100%;
  66. text-align: center;
  67. }
  68. .end {
  69. width: 16%;
  70. height: 50%;
  71. display: flex;
  72. align-items: center;
  73. justify-content: center;
  74. margin: auto;
  75. }
  76. .menu {
  77. width: 16%;
  78. height: 50%;
  79. display: flex;
  80. align-items: center;
  81. justify-content: center;
  82. margin: auto;
  83. border-right: 1px solid gray;
  84. }
  85. a {
  86. color: gray;
  87. font-size: 18px;
  88. text-decoration: none;
  89. }
  90. .nav a:hover {
  91. height: 100%;
  92. width: 80%;
  93. text-align: center;
  94. line-height: 47px;
  95. background-color: cornflowerblue;
  96. color: white;
  97. border-radius: 7px;
  98. transition: 1s; /**/
  99. }
  100. .header {
  101. position: fixed;
  102. top: -15%;
  103. width: 100%;
  104. height: 15%;
  105. background-color: white;
  106. transition: all 0.8s;
  107. z-index: 4;
  108. display: flex;
  109. }
  110. .logo2 {
  111. width: 20%;
  112. display: flex; /*弹性盒子*/
  113. justify-content: center; /*居中对齐*/
  114. align-items: center; /*水平对齐弹性项目*/
  115. }
  116. .end1 {
  117. width: 14%;
  118. height: 50%;
  119. display: flex;
  120. align-items: center;
  121. justify-content: center;
  122. margin: auto;
  123. }
  124. .menu1 {
  125. width: 14%;
  126. height: 50%;
  127. display: flex;
  128. align-items: center;
  129. justify-content: center;
  130. margin: auto;
  131. border-right: 1px solid gray;
  132. }
  133. .right1 {
  134. width: 10%;
  135. display: flex;
  136. justify-content: center;
  137. align-items: center;
  138. }
  139. .header a:hover {
  140. height: 100%;
  141. width: 80%;
  142. text-align: center;
  143. line-height: 47px;
  144. background-color: cornflowerblue;
  145. color: white;
  146. border-radius: 7px;
  147. transition: 1s;
  148. }
  149. .home3 {
  150. width: 100%;
  151. position: absolute;
  152. top: 105%;
  153. display: flex;
  154. justify-content: center;
  155. }
  156. .tietu {
  157. width: 10%;
  158. height: 20%;
  159. position: absolute;
  160. top: 30%;
  161. left: 0;
  162. }
  163. #QR {
  164. width: 4%;
  165. height: 7%;
  166. background-color: white;
  167. position: absolute;
  168. top: 30%;
  169. right: 3%;
  170. border-radius: 5px;
  171. z-index: 3;
  172. cursor: pointer;
  173. }
  174. #QR:hover {
  175. background-color: brown;
  176. }
  177. #QR1 {
  178. width: 10%;
  179. height: 16%;
  180. border-radius: 5px;
  181. z-index: 3;
  182. position: absolute;
  183. top: 25%;
  184. right: 8%;
  185. }
  186. .content {
  187. width: 80%;
  188. height: 95%;
  189. background: radial-gradient(circle at top center,#d3d3d3,#fff); /*径向渐变色*/
  190. position: absolute;
  191. top: 2%;
  192. border-radius: 10px;
  193. }
  194. .kong {
  195. width: 100%;
  196. height: 1%;
  197. background-color: cyan;
  198. position: absolute;
  199. top: 220%;
  200. }
  201. .footer {
  202. width: 100%;
  203. height: 35%;
  204. position: absolute;
  205. top: 221%;
  206. background: radial-gradient(circle at top center,#800080,#778899);
  207. display: flex;
  208. justify-content: center;
  209. align-items: center;
  210. }
  211. .Morty {
  212. width: 25%;
  213. text-align: center;
  214. }
  215. .footer_logo {
  216. width: 50%;
  217. text-align: center;
  218. }
  219. .Rick {
  220. width: 25%;
  221. text-align: center;
  222. }

到这里网页整个样式已经弄好,JS代码我就没有放了,具体就是header的滑动条弹窗、音乐播放暂停的按钮、鼠标悬停图片弹出二维码图片这些JS代码

还有就是关于的使用,我的视频背景添加了muted静音属性,如果浏览器没有设置自动媒体或声音播放,那么我这个视频背景就可以播放,但没有视频声音;反之你没有设置muted属性,浏览器也没有设置自动媒体或声音播放,那么这个视频背景不仅没有声音而且不能播放。所以我才添加了一个音乐播放器,这样他人使用的时候不需要浏览器设置也可以点击音乐按钮实现音频播放。

video视频背景播放和声音解决方法如下

谷歌浏览器(进入设置,搜索”网站设置“并点击,下拉到头点击”更多内容“,点击声音,点击允许播放声音旁的添加,把你要播放音频的网页粘贴上去就好了)

edge浏览器(点击设置,找到”Cookie 和网站权限“并点击,下拉找到媒体自动播放点击进入,直接选择允许就好了,无需添加站点)

图片资源大部分都是免抠图,瑞克和莫蒂的图片资源在Stickpng官网下载,视频背景则是壁纸引擎下的。

就这么多了,这是我第一次写博客,可能写的不是很好,望阅读的朋友多多包涵,谢谢啦。

网站建设定制开发 软件系统开发定制 定制软件开发 软件开发定制 定制app开发 app开发定制 app开发定制公司 电商商城定制开发 定制小程序开发 定制开发小程序 客户管理系统开发定制 定制网站 定制开发 crm开发定制 开发公司 小程序开发定制 定制软件 收款定制开发 企业网站定制开发 定制化开发 android系统定制开发 定制小程序开发费用 定制设计 专注app软件定制开发 软件开发定制定制 知名网站建设定制 软件定制开发供应商 应用系统定制开发 软件系统定制开发 企业管理系统定制开发 系统定制开发