当前位置:   article > 正文

【web前端开发】HTML及CSS简单页面布局练习

【web前端开发】HTML及CSS简单页面布局练习

案例一 网页课程

  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. </head>
  9. <body>
  10. <p>课程体系</p>
  11. <hr>
  12. <img src="week1/1001/1.png" height="200px">
  13. <img src="week1/1001/2.png" height="200px">
  14. <p>实战课程</p>
  15. <hr>
  16. <img src="week1/1001/3.png" height="200px">
  17. <img src="week1/1001/4.png" height="200px">
  18. <img src="week1/1001/5.png" height="200px">
  19. </body>
  20. </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. </head>
  9. <body>
  10. <h1>商品详情</h1>
  11. <hr>
  12. <p>产品参数:</p>
  13. <p>产品名称:HTML5+CSS3网页设计&nbsp;&nbsp;ISBN编号:9787302480723&nbsp;&nbsp;书名:HTML5+CSS3网页设计</p>
  14. <p>作者:刘玉红,蒲娟&nbsp;出版时间:2017-09&nbsp;&nbsp;定价:78.00元</p>
  15. <p>出版社名称:清华大学出版社&nbsp;&nbsp;开本:16开&nbsp;&nbsp;&nbsp;是否是套装:否</p>
  16. <hr>
  17. <img src="img.week1/1002/1.jpg" height="150px" width="800px">
  18. <img src="img.week1/1002/2.jpg" width="800px">
  19. </body>
  20. </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. <script>
  9. function p(){
  10. var v=document.getElementById("video1");
  11. if (v.paused) {
  12. v.play();}
  13. else {
  14. v.pause();}
  15. }
  16. function small(){
  17. var v=document.getElementById("video1");
  18. v.width = v.width * 0.5;
  19. v.height = v.height * 0.5;
  20. }
  21. function big(){
  22. var v=document.getElementById("video1");
  23. v.width = v.width * 2;
  24. v.height = v.height *2;
  25. }
  26. function same(){
  27. var v=document.getElementById("video1");
  28. v.width = 500;
  29. v.height = 300;
  30. }
  31. </script>
  32. <style>
  33. .cont{
  34. margin: 0,auto;
  35. height: 300px;
  36. width: 500px;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <div class="cont">
  42. <video id="video1" src="../img/video.mp4" width="500" height="300" ></video>
  43. <div>
  44. <center>
  45. <button onclick="p()">播放/暂停</button>
  46. <button onclick="big()">放大</button>
  47. <button onclick="small()">缩小</button>
  48. <button onclick="same()">普通</button>
  49. </center>
  50. </div>
  51. </div>
  52. </body>
  53. </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. <style>
  9. *{
  10. padding: 0;
  11. margin: 0;
  12. }
  13. .c1{
  14. background-color: gainsboro;
  15. height: 40px;
  16. width: 300px;
  17. }
  18. .c2{
  19. background-color: gainsboro;
  20. height: 40px;
  21. width: 300px;
  22. margin-top: 20px;
  23. }
  24. form{
  25. background: url(../img/4001.png) no-repeat;
  26. height: 550px;
  27. width: 600px;
  28. position: absolute;
  29. background-color: gainsboro;
  30. }
  31. .all{
  32. position: relative;
  33. margin-top: 110px;
  34. margin-left: 110px;
  35. }
  36. [type="button"]{
  37. background-color: yellow;
  38. border: none;
  39. border-radius:12px;
  40. width: 70px;
  41. height: 40px;
  42. font-size: 20px;
  43. margin-top: 20px;
  44. margin-left: 30px;
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <form>
  50. <div class="all">
  51. <div class="c1">
  52. <img src="../img/user.png" height="30px" >
  53. <label><input style="border: 0px;background-color: gainsboro;height: 25px;" type="text" ></label>
  54. </div>
  55. <div class="c2">
  56. <img src="../img/pass.png" height="30px" >
  57. <label><input style="border: 0px;background-color: gainsboro;height: 25px;" type="text"></label>
  58. </div>
  59. <input type="button" value="登录">
  60. <a href="#" style="height: 10px;color: rgb(0, 179, 255);font-size: 15px;margin-left: 10px;">注册</a>
  61. <a href="#" style="height: 10px;color: rgb(0, 179, 255);font-size: 15px;margin-left: 10px;">忘记密码?</a>
  62. </div>
  63. </form>
  64. </body>
  65. </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. <style>
  9. *{
  10. bottom: 0;
  11. padding: 0;
  12. }
  13. .cont{
  14. background: url(../img/bg.png);
  15. position:relative;
  16. width:1000px;
  17. height:600px;
  18. background-size:100%;
  19. background-position:bottom center;
  20. position:absolute;
  21. }
  22. form{
  23. background-color: papayawhip;
  24. border-radius: 25px;
  25. width: 700px;
  26. height: 350px;
  27. margin:70px 100px;
  28. border: 3px solid peachpuff;
  29. position:absolute;
  30. }
  31. .addr{
  32. background-color: #FFF8D7;
  33. height: 50px;
  34. width: 620px;
  35. margin-left: 32px;
  36. }
  37. .little{
  38. padding-top: 15px;
  39. }
  40. .end{
  41. margin-top: 30px;
  42. height: 50px;
  43. background-color: bisque;
  44. width: 700px;
  45. border-radius: 0 0 25px 25px;
  46. }
  47. .title{
  48. margin-top: 93px;
  49. margin-left: 400px;
  50. }
  51. </style>
  52. </head>
  53. <body>
  54. <div class="cont">
  55. <div class="title">
  56. <p style="float:left;margin-top:30px;height:30px;background-color: papayawhip;font-size: 15px;padding-top: 10px;">
  57. <span style="font-size: 20px;font-weight: bolder;">祝福瓶</span>
  58. <span>祝福瓶,准确无误的送去你的祝福</span>
  59. </p>
  60. <img src="../img/bot.png">
  61. </div>
  62. <form>
  63. <p style="margin: 20px 10px;color:DarkOliveGreen;font-size: 18px;">&nbsp;&nbsp;&nbsp;祝福远在他乡的你幸福安康...</p>
  64. <div class="addr">
  65. <p style="float: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;我要祝福的他在:</p>
  66. <div class="little">
  67. <select>
  68. <option>吉林</option>
  69. <option>安徽</option>
  70. </select>
  71. <select>
  72. <option>咸阳</option>
  73. <option>合肥</option>
  74. </select>
  75. <label><input type="text" value="请输入地址信息" style="color:gainsboro";></label>
  76. </div>
  77. </div>
  78. <textarea cols="90" rows="7" style="background-color:#FFFFDF;margin:20px 30px;"></textarea>
  79. <div class="end">
  80. <label ><input type="checkbox" style="margin: 20px;">转发到微博</label>
  81. <label ><input type="checkbox">同时扔给很多人</label>
  82. <input type="button" value="关闭" style="background-color: #FFF0AC;margin-left:250px;width: 70px;height: 30px;border: 2px solid #FFDCB9 ;">
  83. <input type="button" value="扔出去" style="background-color:skyblue;width: 70px;height: 30px;color: white;border-radius: 10px;border: 2px solid #2894FF;">
  84. </div>
  85. </form>
  86. </div>
  87. </body>
  88. </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. <style>
  9. *{
  10. padding: 0;
  11. margin: 0;
  12. }
  13. .cont{
  14. background: url(../img/4003/bg\ .png) no-repeat;
  15. width: 800px;
  16. height: 500px;
  17. margin: 20px auto;
  18. }
  19. .pic{
  20. margin: 9px 200px;
  21. width: 300px;
  22. height: 40px;
  23. padding-top:60px;
  24. }
  25. textarea{
  26. margin-left: 200px;
  27. }
  28. .button{
  29. margin-left: 200px;
  30. padding-left: 20px;
  31. background-color: aliceblue;
  32. height: 50px;
  33. line-height:50px;
  34. width: 570px;
  35. }
  36. .b1{
  37. height:25px;
  38. width: 70px;
  39. line-height:25px;
  40. font-size: 14px;
  41. font-weight: bolder;
  42. color: white;
  43. background-color: gainsboro;
  44. border: none;
  45. }
  46. .b2{
  47. height:25px;
  48. width: 70px;
  49. line-height:25px;
  50. font-size: 14px;
  51. color: white;
  52. background-color: orange;
  53. border: none;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <div class="cont">
  59. <div class="pic">
  60. <label><input type="radio" name="judge" ><img src="../img/4003/red.png"></label>
  61. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  62. <label><input type="radio" name="judge"><img src="../img/4003/yellow.png"></label>
  63. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  64. <label><input type="radio" name="judge"><img src="../img/4003/black.png"></label>
  65. </div>
  66. <textarea rows="9" cols="83"></textarea>
  67. <div class="button">
  68. <button class="b1">我要晒图</button>
  69. <button class="b2">发表评价</button>
  70. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  71. <label><input type="radio" name="choose">公开</label>
  72. <label><input type="radio" name="choose">匿名</label>
  73. </div>
  74. </div>
  75. </body>
  76. </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. <style>
  9. *{
  10. padding: 0;
  11. margin: 0;
  12. }
  13. .button{
  14. float: left;
  15. }
  16. .cont{
  17. margin-top: 100px;
  18. margin-left:300px;
  19. background-color:skyblue;
  20. height: 270px;
  21. width: 700px;
  22. padding-left:40px;
  23. padding-top: 20px;
  24. }.theme{
  25. padding-left: 4px;
  26. padding-top: 10px;
  27. }
  28. .a1{
  29. margin-left: 80px;
  30. color: #000;
  31. font-size: 10px;
  32. }
  33. .a2{
  34. color: #000;
  35. font-size: 10px;
  36. margin-left: 0px;
  37. }
  38. a:link{
  39. text-decoration:none;
  40. }
  41. .main{
  42. padding-top:4px ;
  43. }
  44. .button{
  45. padding-left: 70px;
  46. font-size: 10px;
  47. font-weight: bolder;
  48. }
  49. button{
  50. background-color:#39c0d4;
  51. border:none;
  52. height: 30px;
  53. line-height: 30px;
  54. border-radius: 10%;
  55. }
  56. .choose{
  57. font-size: 10px;
  58. padding-top: 4px;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <div class="cont">
  64. <div class="reciver">
  65. <span>收件人&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
  66. <textarea rows="1" cols="50"></textarea>
  67. </div>
  68. <div class="theme">
  69. <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  70. <textarea rows="1" cols="50"></textarea>
  71. </div>
  72. <a href="" class="a1">添加附件</a>
  73. &nbsp;&nbsp;
  74. <a href="" class="a2">在线文档</a>
  75. <div class="main">
  76. <span style="float: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  77. <textarea rows="10" cols="83"></textarea>
  78. </div>
  79. <div class="button">
  80. <button>直接发送</button>
  81. <button>存草稿</button>
  82. <button>其它选项</button>
  83. </div>
  84. <div class="choose">
  85. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  86. <span>是否保存到已发送</span>&nbsp;&nbsp;&nbsp;
  87. <label><input type="radio" name="choose"></label>
  88. <label><input type="radio" name="choose"></label>
  89. </div>
  90. </div>
  91. </body>
  92. </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. <style>
  9. *{
  10. padding: 0;
  11. margin: 0;
  12. }
  13. form{
  14. background-image: url(../img/back.png);
  15. height: 500px;
  16. padding: 200px;
  17. }
  18. p{
  19. background-color:rgba(28, 164, 226, 0.614);
  20. color: white;
  21. font-size: 20px;
  22. margin-top: 20px;
  23. }
  24. label{
  25. margin-top:15px;
  26. padding-top: 1px;
  27. font-size: 12px;
  28. display: block;
  29. margin-left: 30px;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <form>
  35. <p>申请个人讲师</p>
  36. <label><input type="checkbox">为企业宣传</label>
  37. <label><input type="checkbox">上传文档至网站</label>
  38. <label><input type="checkbox">个人需要</label>
  39. <label><input type="checkbox">团购个人会员</label>
  40. <label><input type="checkbox">扩充自身网站内容</label>
  41. <label><input type="checkbox">借助明日科技技术,搭建企业内部平台</label>
  42. <p>您所在企业名称</p>
  43. <label>请输入您的回答 <input type="text"></label>
  44. <p>您所在单位的规模</p>
  45. <label><input type="radio" name="count">100人以内</label>
  46. <label><input type="radio" name="count">100-500人</label>
  47. <label><input type="radio" name="count">500人-1000人</label>
  48. <label><input type="radio" name="count">1000人-5000人</label>
  49. <label><input type="radio" name="count">5000人以上</label>
  50. <p>你是机构的负责人吗</p>
  51. <label><input type="radio" name="que"></label>
  52. <label><input type="radio" name="count">不是</label>
  53. </form>
  54. </body>
  55. </html>
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/84802
推荐阅读
相关标签
  

闽ICP备14008679号