2-9 作业下划线居中table嵌套table为什么不能贴在一块(黑色的背景和图片)

2-9 作业下划线居中table嵌套table为什么不能贴在一块(黑色的背景和图片)

<!DOCTYPE html>

<html> 

<head>

<title></title>

<meta charset="utf-8">

<style type="text/css">

*{margin: 0;padding: 0}

.header{

width: 100%;

height: 50px;

background-color: #07cbc9;

}

.header .title{

height: 50px;

width: 40%;

line-height: 50px;

font-size: 30px;

color: white;

float: left;

}

    .about{width: 100%;margin: 0 auto;}

    .about-title{font-size: 30px;margin: 0 auto;text-align: center;padding-top: 20px;font-style: thick;padding-bottom: 20px;}

    .about-bottom-top{

    height:50px;width:500px;margin-top: 30px;text-align: center;margin: 0 auto;}

    .about-bottom-top p{margin-top:10px;}

    .about-bottom-bottom{width: 100%;height: 300px;background-image: url(images/bb3.jpg) ; background-position: center  center;background-repeat: no-repeat;background-size: 400px 250px;} 

    .abb2l{width: 250px;height: 300px;position: absolute;top:599px;left: 15%;padding: 20px;}

    .abb2l p{padding: 5px;}

    .pb{border: 1px solid #ececec;background-color: transparent;}

    .exp{width: 80px;height: 30px;background-color: black;color: white;text-align: center;border: none;margin:  10px;}

    .abb2r{float: right;text-align: center;}

    .abb2rt,.abb2rb{width: 200px;height: 100px;margin-bottom: 20px;border:1px solid #07cbc9;margin-right: 100px;margin-top: 30px;line-height: 50px;}

    .abb2rt,.abb2rb h2{font: 900;}

    .gall{width: 1400px;margin: 0 auto;height: 620px;}

    .ttd{height: 300px;width: 350px;text-align: center;}

    .ttd img{width: 100%;height: 100%;background-color: #07cbc9;}

    .ttdc{height: 100%;width: 100%;background-color:  #07cbc9;}

    .ttd h1{color: white;text-align: left; padding:20px; }

    .ttdc1{color: white;text-align: left;padding-left:30px;padding-right:20px;line-height: 1.3em;font-size: 14px;font-weight: 200px }

    .ttdc3{color:#d0d0d0;font-size: 10px;padding: 30px;text-align: left;}

    .gallery{margin: 0 auto;width: 100%;}

    .gallery-title{text-align: center;height: 40px;width: 100%}

    .galp{width: 400px;height: 50px;margin: 0 auto;color:#989898;font-size: 12px;text-align: center;}

    .gallery-content{width: 920px;margin: 0 auto;}

    .g{width: 300px;height: 300px;}

    .gg img{width: 300px;height: 200px;}

    .ggg{width: 300px;height: 50px;background-color: black;color: white;border: none;}

    .footer{width: 100%;height: 50px;background-color: #07cbc9;color:#F8F8F8;font-size: 10px;text-align: center;line-height: 50px;font-weight: 100}

    </style>

 

</head>

<body>


<div class="about">

  <div class="about-title">ABOUT</div><hr>

<div class="about-bottom">

<div class="about-bottom-top">

 

<p>Lorem Ipsum is simply dummy text of the printing and typesting indesty.Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

</div>

<div class="about-bottom-bottom">

     <div class="abb2l">

      <h1>A WORD<br>ABOUT US</h1>

      <div class="pb">

      <p>Lorem Ipsum is simply dummy text of the printing and typesting indesty.Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p><br>

      <input type="buttom" name="exp" value="EXPLORE" class="exp">

     </div>

     </div>

     

     <div class="abb2r">

      <div class="abb2rt"><h2>70000</h2>Stuents</div>

      <div class="abb2rb"><h2>600</h2>Faculty</div>

     </div>

     </div>

</div>

<div class="clear"></div>

<div class="gall">

<table>

<tr>

   <td class="ttd"><img src="images/b1.jpg"></td>

<td class="ttd">

<div class="ttdc">

<h1>Library</h1>

<p class="ttdc1">Lorem Ipsum is simply dummy tet of the printing and typesetteing industry</p>

<p class="ttdc3"> Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallary of type and ascambled it to make a type apecimen book.</p>

<input type="buttom" name="exp" value="EXPLORE" class="exp">

</div>

</td>

<td class="ttd"><img src="images/b2.jpg"></td>

<td class="ttd"><div class="ttdc">

<h1>Computer Lab</h1>

<p class="ttdc1">Lorem Ipsum is simply dummy tet of the printing and typesetteing industry</p>

<p class="ttdc3">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallary of type and ascambled it to make a type apecimen book.</p>

<input type="buttom" name="exp" value="EXPLORE" class="exp">

</div></td>

</tr>

<tr class="ttr">

   

<td class="ttd"><div class="ttdc">

<h1>Conference Hall</h1>

<p class="ttdc1">Lorem Ipsum is simply dummy tet of the printing and typesetteing industry</p>

<p class="ttdc3">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallary of type and ascambled it to make a type apecimen book.</p>

<input type="buttom" name="exp" value="EXPLORE" class="exp">

</div></td>

<td class="ttd"><img src="images/b3.jpg"></td>

<td class="ttd"><div class="ttdc">

<h1>Play Ground</h1>

<p class="ttdc1">Lorem Ipsum is simply dummy tet of the printing and typesetteing industry</p>

<p class="ttdc3">Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unknown printer took a gallary of type and ascambled it to make a type apecimen book.</p>

<input type="buttom" name="exp" value="EXPLORE" class="exp">

</div></td>

<td class="ttd"><img src="images/b4.jpg"></td>

</tr>

</table>

</div>

</div>

<div class="gallery">

<div class="gallery-title">

        <h1>GALLERY</h1>

        

</div>

<div class="galp">

<p>Lorem Ipsum is simply dummy text of the printing and typesting indesty.Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.</p>

</div>

<div class="gallery-content">

<table align="center">

<tr>

<td class="g">

<table>

<tr><td class="gg"><img src="images/03-01.jpg"></td></tr>

<tr><td class="ggg">SCIENCE LAB</td></tr>

</table>

</td>

<td class="g"><table>

<tr><td class="gg"><img src="images/03-02.jpg"></td></tr>

<tr><td class="ggg">INDOOR STATIUM</td></tr>

</table></td>

<td class="g"><table>

<tr><td class="gg"><img src="images/03-03.jpg"></td></tr>

<tr><td class="ggg">TRANSPORTANTION</td></tr>

</table></td>

</tr>

<tr>

<td class="g">

<table >

<tr><td class="gg"><img src="images/03-04.jpg"></td></tr>

<tr><td class="ggg">KIDS ROOM</td></tr>

</table>

</td>

<td class="g"><table>

<tr><td class="gg"><img src="images/03-05.jpg"></td></tr>

<tr><td class="ggg">MEDITATION CLASSES</td></tr>

</table></td>

<td class="g">

<table>

<tr><td class="gg"><img src="images/03-06.jpg"></td></tr>

<tr><td class="ggg">KIDS PLAY GROUND</td></tr>

</table></td>

</tr>

</table>

</div>

</div>

</body>

</html>


正在回答 回答被采纳积分+1

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

2回答
小丸子爱吃菜 2017-09-18 16:47:20

table适合去写一些表格或者数据类的,涉及到布局能用div就不需要用table,table的层级太多,浏览器读取效率也不高。

小丸子爱吃菜 2017-08-26 13:41:18

可以给最外层table设置 cellpadding="0" cellspacing="0"试试~

你说的区域是否是about区域下面的两行四列的区域?这块区域也可以使用div去写,一个大div中嵌套4个小的div。

祝学习愉快!

  • about区域下面的两行四列的区域好像更像table的结构,是不是table现在真被淘汰了?
    2017-09-18 15:39:11
问题已解决,确定采纳
还有疑问,暂不采纳

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

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

0 星
前端小白入门系列课程
  • 参与学习           人
  • 提交作业       11218    份
  • 解答问题       36713    个

从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!

了解课程
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

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