老师能看看有什么问题吗

老师能看看有什么问题吗

  1. <!DOCTYPE html>

  2. <html>

  3. <head>

  4.     <title>商城</title>

  5.     <link rel="stylesheet" type="text/css" href="css/common.css">

  6. </head>

  7. <body>    

  8.     <div class="top">

  9.         <div class="top-logo">

  10.             <a href="#"><img src="images/logo.png"></a>

  11.         </div>

  12.         <div class="top-navigation">

  13.             <ul>

  14.                 <li class="bian">

  15.                     <div class="one">

  16.                         <a href="#">HOME</a>

  17.                     </div>

  18.                 </li>

  19.                 <li class="bian"><a href="#">ABOUT</a></li>

  20.                 <li class="bian"><a href="#">GALLERY</a></li>

  21.                 <li class="bian"><a href="#">FACULTY</a></li>

  22.                 <li class="bian"><a href="#">EVENTS</a></li>

  23.                 <li class="bian"><a href="#">CONCACT</a></li>

  24.             </ul>

  25.         </div>

  26.     </div>

  27.     <div class="banner">

  28.         <img src="images/banner3.jpg" class="banner-img">

  29.             <form class="banner-form">

  30.                 <input type="text" name="" placeholder="your Name" id="lie"><br>

  31.                 <input type="text" name="" placeholder="your phone" id="lie"><br>

  32.                 <input type="text" name="" placeholder="your Email" id="lie"><br>

  33.                 <textarea cols="30" rows="5" id="lie1" placeholder="Write Your Comment Here"></textarea><br>

  34.                 <input type="submit" name="" placeholder="SEND MESSAGE" id="lie2"><br>

  35.             </form>

  36.     </div>

  37.     <div class="about">

  38.         <div class="about-h3">

  39.             <h3 class="about-h33">ABOUT</h3>

  40.         </div>

  41.         <div class="about-p">

  42.             <P class="about-pp">

  43.                 Lorem Ipsum is sumply dummy text of the printing and rypesetting industry.Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.

  44.             </P>

  45.         </div>

  46.         <div class="center">

  47.             <div class="center-img">

  48.                 <img src="images/bb3.jpg" class="center-bb3">

  49.             </div>

  50.             <div class="center-left">

  51.                 <div class="center-p1">

  52.                     <p>A WORD ABOUT US</p>

  53.                 </div>

  54.             <div class="center-p2">

  55.                 <div class="center-p22">

  56.                     <p class="center-p222">Praesent dignissim est,sed bibendeum ligula congue non.Sed ac nislet felis gravida commodo?Suspendisseeget ullamcorper ipsum.Suspendisseeget ullamcorper ipsum.Supendisse diam amet.

  57.                     </p>

  58.                 </div>

  59.             <div class="center-button">

  60.                 <input type="button" name="" value="EXPLORE" id="bu">

  61.             </div>

  62.         </div>

  63.     </div>

  64.     <div class="center-right">

  65.         <div class="center-p3">

  66.             <p class="p33">70000</p>

  67.             <p>Students</p>

  68.         </div>

  69.         <div class="center-p4">

  70.             <p class="p44">600</p>

  71.             <p>Faculty</p>

  72.         </div>

  73.         </div>

  74.         </div>

  75.             <div class="lower">

  76.                 <table align='center' style="border-collapse:collapse;">

  77.                     <tr>

  78.                         <td>

  79.                             <img src="images/b1.jpg" id="b1" class="b1">

  80.                         </td>

  81.                         <td>

  82.                             <div class="lower-b11">

  83.                                 <p id="b111">Library</p>

  84.                                 <p id="b222">Lorem Ipsum is simplu dummy text of the printing and typesetting industry</p>

  85.                                 <p id="b333">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book.

  86.                                 </p>

  87.                             <div class="but1">

  88.                                 <input type="submit" name="" value="EXPLORE" id="butt1">

  89.                             </div>

  90.                             </div>

  91.                         </td>

  92.                         <td>

  93.                             <img src="images/b2.jpg" id="b2" class="b2">

  94.                         </td>

  95.                         <td>

  96.                             <div class="lower-b22">

  97.                                 <p id="b111">Library</p>

  98.                                 <p id="b222">Lorem Ipsum is simplu dummy text of the printing and typesetting industry</p>

  99.                                 <p id="b333">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book.

  100.                                 </p>

  101.                                 <div class="but1">

  102.                                     <input type="submit" name="" value="EXPLORE" id="butt1">

  103.                                 </div>

  104.                             </div>

  105.                         </td>

  106.                     </tr>

  107.                     <tr>

  108.                         <td>

  109.                             <div class="lower-b33">

  110.                                 <p id="b111">Library</p>

  111.                                 <p id="b222">Lorem Ipsum is simplu dummy text of the printing and typesetting industry</p>

  112.                                 <p id="b333">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book.

  113.                                 </p>

  114.                                 <div class="but1">

  115.                                     <input type="submit" name="" value="EXPLORE" id="butt1">

  116.                                 </div>

  117.                             </div>

  118.                         </td>

  119.                         <td>

  120.                             <img src="images/b3.jpg" id="b3" class="b3">

  121.                         </td>

  122.                         <td>

  123.                             <div class="lower-b44">

  124.                                 <p id="b111">Library</p>

  125.                                 <p id="b222">Lorem Ipsum is simplu dummy text of the printing and typesetting industry</p>

  126.                                 <p id="b333">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a galley of type and scrambled it to make a type specimen book.

  127.                                 </p>

  128.                                 <div class="but1">

  129.                                     <input type="submit" name="" value="EXPLORE" id="butt1">

  130.                                 </div>

  131.                             </div>

  132.                         </td>

  133.                         <td>

  134.                             <img src="images/b4.jpg" id="b4" class="b4">

  135.                         </td>

  136.                     </tr>

  137.                 </table>

  138.             </div>

  139.             <div class="galley">

  140.                 <div class="galley-top">

  141.                     <div class="galley-h3">

  142.                         <h3 class="galley-h33">GALLERY</h3>

  143.                     </div>

  144.                     <div class="galley-p">

  145.                         <P class="galley-pp">

  146.                         Lorem Ipsum is sumply dummy text of the printing and rypesetting industry.Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.

  147.                         </P>

  148.                     </div>

  149.                 </div>

  150.                 <div class="img-content">

  151.                     <ul>

  152.                         <li>

  153.                             <img src="images/03-01.jpg">

  154.                             <div class="img-info">

  155.                                 <p>SCIENCE LAB</p>

  156.                             </div>

  157.                         </li>

  158.                         <li>

  159.                             <img src="images/03-02.jpg">

  160.                             <div class="img-info">

  161.                                 <p>INDOOR STADIUM</p>

  162.                             </div>

  163.                         </li>

  164.                         <li>

  165.                             <img src="images/03-03.jpg">

  166.                             <div class="img-info">

  167.                                 <p>TRANSPORTATION</p>

  168.                             </div>

  169.                         </li>

  170.                         <li>

  171.                             <img src="images/03-04.jpg">

  172.                             <div class="img-info">

  173.                                 <p>KIDS ROOM</p>

  174.                             </div>

  175.                         </li>

  176.                         <li>

  177.                             <img src="images/03-05.jpg">

  178.                             <div class="img-info">

  179.                                 <p>MEDITATION CLASS</p>

  180.                             </div>

  181.                         </li>

  182.                         <li>

  183.                             <img src="images/03-06.jpg">

  184.                             <div class="img-info">

  185.                                 <p>KIDS PLAY GROUNDS</p>

  186.                             </div>

  187.                         </li>

  188.                     </ul>

  189.                 </div>

  190.             </div>

  191.             <div class="footer">

  192.                 <p><img draggable="false" class="moco-emoji" alt="©" src="https://www.imooc.com/static/moco/v1.0/images/face/36x36/a9.png" data-src="©" style="cursor: pointer;">2016 imooc.com 京ICP备13046642号</p>

  193.             </div>        

  194. </body>

  195.  

</html>

  1. *{

  2.     margin: 0;

  3.     padding: 0;

  4.  

  5. }

  6. /*字体设置*/

  7. body{

  8.     font-family: Microsoft YaHei UI;

  9.     /*width: 1300px;

  10.     margin-left: 120px;

  11.     margin-top: 50px;*/

  12. }

  13.  

  14. /*顶部*/

  15. .top{

  16.     width: 100%;

  17.     height: 68px;

  18.     background-color: #07cbc9;

  19.     line-height: 68px;

  20.     overflow: hidden;

  21. }

  22. /*logo设置*/

  23. .top .top-logo{

  24.     float: left;

  25.     margin-left: 180px;

  26.     margin-right: 480px;

  27.     margin-top: 7px;

  28. }

  29. /*导航栏设置*/

  30. .top .top-navigation ul li{

  31.     float: left;

  32.     list-style: none;

  33.     margin-right: 20px;

  34. }

  35. /*导航栏设置离右边距离*/

  36. .top .top-navigation ul{

  37.     margin-right: 40px;

  38.     height: 68px;

  39. }

  40. /*导航栏设置去下划线*/

  41. .top .top-navigation ul a{

  42.     text-decoration:none;

  43.     color: white;

  44. }

  45. /*伪类设置鼠标移动到导航栏背景变色*/

  46. .top .top-navigation ul a:hover{

  47.     background-color: #000;

  48.     display: block;

  49. }

  50. /*banner区*/

  51. /*背景图片设置项*/

  52. .banner{

  53.     width: 100%;

  54.     height: 600px;

  55.     overflow: hidden;

  56. }

  57. /*背景图片*/

  58. .banner .banner-img{

  59.     width: 100%;

  60.     height: 600px;

  61.     margin-top: 0px;

  62.     float: left;

  63.     opacity:0.9;

  64. }

  65. /*表单设置*/

  66. .banner .banner-form{

  67.     width: 550px;

  68.     position: absolute;

  69.     text-align: center;

  70.     height: 380px;

  71.     line-height: 70px;

  72.     left: 50%;

  73.     margin-top: 100px;

  74.     margin-left: -275px;

  75. }

  76. /*input标签*/

  77. #lie{

  78.     width: 400px;

  79.     height: 30px;

  80.     line-height:30px;

  81.     background-color: transparent;

  82.     color: white

  83. }

  84. /*多行输入框*/

  85. #lie1{

  86.     width: 400px;

  87.     height: 70px;

  88.     line-height:30px;

  89.     border: 1px solid white;

  90.     background-color: transparent;

  91.     color: white

  92. }

  93. /*提交按钮*/

  94. #lie2{

  95.     width: 110px;

  96.     height: 30px;

  97.     line-height:30px;

  98.     border: 1px solid white;

  99.     background-color: transparent;

  100.     color: white

  101. }

  102. /*表单设置*/

  103. .banner .banner-form form{

  104.     margin: 70px 650px;

  105.     line-height:60px;

  106.     height: 60px;

  107. }

  108. /*伪类设置*/

  109. #lie:hover{

  110.     border:1px solid #07cbc9;

  111. }

  112. #lie1:hover{

  113.     border:1px solid #07cbc9;

  114. }

  115. #lie2:hover{

  116.     background-color: #07cbc9;

  117.     border:none;

  118. }

  119. /*ABOUT区*/

  120. /*ABOUT区上部设置*/

  121. .about{

  122.     width: 100%;

  123. }

  124. /*ABOUT区上部标题设置*/

  125. .about .about-h3{

  126.     width: 100%;

  127.     height:150px;

  128.     overflow: hidden;

  129.     font-size: 50px;

  130. }

  131. .about .about-h3 .about-h33{

  132.     border-bottom: 1px solid #07cbc9;

  133.     padding-bottom: 20px;

  134.     margin: 30px auto;

  135.     width: 200px;

  136. }

  137. /*ABOUT区上部文字设置*/

  138. .about .about-p{

  139.     width: 100%;

  140.     height:75px;

  141.     text-align: center;

  142. }

  143. .about .about-p .about-pp{

  144.     width: 490px;

  145.     height:60px;

  146.     margin: 5px auto;

  147. }

  148. /*ABOUT区中部设置*/

  149. .center{

  150.     margin: 10px auto;

  151.     overflow: hidden;

  152. }

  153.  

  154. /*中间图片的div设置*/

  155. .center .center-img{

  156.     position: absolute;

  157.     text-align: center;

  158.     width: 100%;

  159.     height: 435px;

  160.     margin: 0px auto;

  161.  

  162. /*左边块设置*/

  163. .center .center-left{

  164.     width: 400px;

  165.     height:435px;

  166.     float: left;

  167.     position: relative;

  168.     left: 70px;

  169.     top:0px;

  170.  

  171. }

  172.  

  173. /*左边块首文字*/

  174. .center .center-left .center-p1{

  175.     font-size: 40px;

  176.     width: 250px;

  177.     left: 20px;

  178.     position: relative;

  179. }

  180.  

  181. /*左边下文字与按钮设置*/

  182. .center .center-left .center-p2{

  183.     width: 350px;

  184.     height:200px;

  185.     background-color: rgba(255, 255, 255, 0.4);

  186.     border:1px solid #ADADAD;

  187.     top: 30px;

  188.     position: relative;

  189. }

  190.  

  191. /*左边下文字设置*/

  192. .center .center-left .center-p2 .center-p222{

  193.     padding-top: 25px;

  194.     padding-left: 25px;

  195.     line-height:20px;

  196.     position: relative;

  197. }


  198.  /*按钮块设置*/

  199.  .center .center-left .center-button{

  200.     height: 77px;

  201.  }


  202. /* 按钮普通状态设置*/

  203. .center .center-left .center-p2 .center-button input{

  204.     height: 40px;

  205.     width: 80px;

  206.     background-color: black;

  207.     color: white;

  208.     border: none;

  209.     left: 20px;

  210.     top: 20px;

  211.     position: relative;

  212. }


  213. /*鼠标移入按钮背景透明*/

  214.  #bu:hover{

  215.     border: 1px solid black;

  216.     background-color: rgba(255, 255, 255, 0.4);

  217.     color: black;

  218. }


  219. /*右边块设置*/

  220. .center .center-right{

  221.     width: 250px;

  222.     height:345px;

  223.     text-align: center;

  224.     position: relative;

  225.     right: 40px;

  226.     float: right;

  227. }

  228.  

  229. /*右边student的div*/

  230. .center .center-right .center-p3{

  231.     width: 250px;

  232.     height:150px;

  233.     border: 1px solid #07cbc9;

  234.     font-size: 40px;

  235.     line-height: 70px;

  236.     text-align: center;

  237. }

  238.  

  239. /*右边facul的div*/

  240. .center .center-right .center-p4{

  241.     width: 250px;

  242.     height:150px;

  243.     border: 1px solid #07cbc9;

  244.     font-size: 40px;

  245.     line-height: 70px;

  246.     top: 40px;

  247.     position: relative;

  248. }

  249.  

  250. .center .center-right .center-p3 .p33{

  251.     height: 70px;

  252.     width: 150px;

  253.     border-bottom: 1px solid #07cbc9;

  254.     margin: 0 auto;

  255. }

  256.  

  257. .center .center-right .center-p4 .p44{

  258.     height: 70px;

  259.     width: 150px;

  260.     border-bottom: 1px solid #07cbc9;

  261.     margin: 0 auto;

  262. }

  263.  

  264.  

  265. /*ABOUT下部分区*/

  266. .lower{

  267.     width: 100%;

  268.     top: 80px;

  269.     position: relative;

  270. }

  271. .lower table{

  272.     width: 100%;

  273.     border-collapse: collapse;

  274.     border-spacing: 0px;

  275. }

  276. .lower table tr {

  277.     width: 100%;

  278. }

  279. .lower table tr td{

  280.     padding: 0px;

  281.     width:25%;

  282.     height: 300px;

  283.     background-color: #07cbc9;

  284.     color: white;

  285.  

  286. }

  287.  

  288. /*图片设置*/

  289. .b1,.b2,.b3,.b4{

  290.     height: 300px;

  291.     width: 100%;

  292. }

  293.  

  294.  

  295. #b111{

  296.     font-size: 25px;

  297.     left: 20px;

  298.     top: -20px;

  299.     position: relative;

  300. }

  301.  

  302.  

  303. #b222{

  304.     left: 20px;

  305.     position: relative;

  306.     font-size: 15px;

  307. }

  308.  

  309.  

  310. #b333{

  311.     width: 80%;

  312.     height: 20px;

  313.     left: 20px;

  314.     position: relative;

  315.     font-size: 10px;

  316.     top: 10px;

  317. }

  318.  

  319.  

  320. /*按钮设置*/

  321.  

  322. #butt1{

  323.     position: relative;

  324.     top:70px;

  325.     width: 90px;

  326.     height: 40px;

  327.     background-color: black;

  328.     color: white;

  329.     border:none;

  330. }

  331.  

  332. /*鼠标移入按钮效果*/

  333. #butt1:hover{

  334.     border: 1px solid black;

  335.     background-color: rgba(255, 255, 255, 0.4);

  336.     color: black;

  337. }

  338.  

  339. .but1{

  340.     text-align: center;

  341. }

  342.  

  343. /*GALLERY区*/

  344. .galley{

  345.     /*width: 100%;*/

  346.     width: 1200px;

  347.     position: relative;

  348.     padding-top: 50px;

  349.     margin: 0px auto;

  350.     top: 80px;

  351. }

  352.  

  353. .galley .galley-h3{

  354.     width: 100%;

  355.     height:150px;

  356.     overflow: hidden;

  357.     font-size: 50px;


  358. .galley .galley-h3 .galley-h33{

  359.     border-bottom: 1px solid #07cbc9;

  360.     padding-bottom: 20px;

  361.     margin: 30px auto;

  362.     width: 200px;

  363. }

  364.  

  365. /*ABOUT区上部文字设置*/

  366. .galley .galley-p{

  367.     width: 100%;

  368.     height:75px;

  369.     text-align: center;

  370. }

  371.  

  372. .galley .galley-p .galley-pp{

  373.     width: 490px;

  374.     height:60px;

  375.     margin: 5px auto;

  376. }

  377.  

  378. .galley .img-content ul li{/*设置六张图片从靠左一竖列到一排三个*/

  379.     float: left;

  380.     width: 360px;

  381.     margin:0 40px 20px 0;

  382.     list-style-type:none; 

  383.  }

  384. .footer{

  385.     margin-top: 690px;

  386.     width: 100%;

  387.     height: 88px;

  388.     background-color: #07cbc9;

  389.     text-align: center;

  390.     line-height: 88px;

  391.     color: white;

  392. }

正在回答

登陆购买课程后可参与讨论,去登陆

3回答

你好!可以设置如下样式,添加到你的css文件底部即可

.img-info{
    /*设置背景颜色为黑色*/
    background-color:#000;
    /*设置div的高度*/
    height:50px;
    /*设置左内边距,使得文字不是紧挨着左侧边界*/
    padding-left:10px;
}
.img-info p{
    /*设置字体为白色*/
    color:#fff;
    /*设置行高,与img-info的height属性一致才能垂直居中*/
    line-height:50px;
    /*设置文字垂直居中*/
    vertical-align: middle;
}

效果如下:

http://img1.sycdn.imooc.com//climg/5d7eea5109ecb75803750059.jpg

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

好帮手慕珊 2019-09-15 09:43:03

同学,你好!关于第三个问题,四个小div的外面是否有一个div呢,如果有设置外层div的属性margin:0 auto来实现居中效果,如果没有要添加一个div。

关于文字,可以设置一下.img-info p{}的文字样式,通过color设置字体颜色为白色,通过font-size:设置字体大小

http://img1.sycdn.imooc.com//climg/5d7d96cb0936addc05880322.jpg

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

  • 提问者 慕后端2033046 #1
    谢谢老师!但是老师讲的gallery区这一块听的不是很懂。(关于黑色背景跟文字的颜色和大小的设置)老师能不能根据我的代码来改改这部分让它看起来跟案例中显示的差不多,谢谢了。
    2019-09-15 20:35:46
芝芝兰兰 2019-09-14 10:58:08

同学你好。同学大体都完成的很不错呢。只是有些地方还需要注意一下:

1、banner区缺少遮罩层。建议的实现思路是,设置一个和图片大小一致的div,借用绝对定位,将其设置在图片正上方。此div的背景可设置为background-color: #000;opacity: 0.4; 

http://img1.sycdn.imooc.com//climg/5d7c50ee09f075c809270386.jpg


2、表单的边框和目标样式有些差距,建议使用   border: 2px solid gray;

3、同学about区的设计思路是好的。但可能会产生如下效果:

http://img1.sycdn.imooc.com//climg/5d7c53a909b7947612670690.jpg

可以采用这样的设计思路:

用一个大div实现居中。然后里面包裹四个小div。标号1、2、3都浮动向左,显示为一行,标号4采用绝对定位,实现稍微遮盖图片的效果。html的顺序建议调整为1、2、3、4的先后顺序

http://img1.sycdn.imooc.com//climg/5d7c5517099f8bce18580582.jpg

4、div超出了td的范围,建议给div设置宽度高度固定

http://img1.sycdn.imooc.com//climg/5d7c5658099d6e8918650408.jpg

5、gallery区应对文字的颜色和大小适当设置,使其看起来如案例展示:

http://img1.sycdn.imooc.com//climg/5d7c57120962025415590162.jpg

祝学习愉快~

  • 提问者 慕后端2033046 #1
    3、这个about区设置了之后其中四个div都靠到了屏幕的左边该怎么处理让它们显示在屏幕的中间呢 5、gallery文字颜色大小和这个黑色的背景设置老师能不能提示一下呢
    2019-09-14 21:08:35
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师