老师,我设置不了table里面p标签的属性,

老师,我设置不了table里面p标签的属性,

<div id="bottom">

               <table>

               <tr>

               <td><img src="img/b1.jpg" /></td>

               <td class="word">

               <p class="first-p">Library</p>

               <p class="second-p">Lorem Ipsum is simply dummy text of the printing and typesetting industyry</p>

               <p class="thrid-p">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 sepcimen book</p>

               <a href="#">EXPLORE</a>

               </td>

               <td><img src="img/b2.jpg" /></td>

               <td>

               <p>Library</p>

               <p>Lorem Ipsum is simply dummy text of the printing and typesetting industyry</p>

               <p>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 sepcimen book</p>

               <a href="#">EXPLORE</a>

               </td>

               </tr>

               <tr>

               <td>

               <p>Library</p>

               <p>Lorem Ipsum is simply dummy text of the printing and typesetting industyry</p>

               <p>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 sepcimen book</p>

               <a href="#">EXPLORE</a>

               </td>

               <td><img src="img/b3.jpg" /></td>

               <td>

               <p>Library</p>

               <p>Lorem Ipsum is simply dummy text of the printing and typesetting industyry</p>

               <p>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 sepcimen book</p>

               <a href="#">EXPLORE</a>

               </td>

               <td><img src="img/b4.jpg" /></td>

               </tr>

               </table>

</divhttp://img1.sycdn.imooc.com//climg/5cd5667f0001c96516020936.jpg>

正在回答

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

1回答

你好,因为浏览器在解析的时候,会有一层tbody:

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

所以如果使用>选择器(父子选择器)的话,后面需要添加tbody,如下:

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

如果不使用>选择器,直接用空格(后代选择器)就可以了,如下:

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

两种都可以测试下,祝学习愉快!

  • 随机浩 提问者 #1
    是不是所有table都会有tbody这个,tbody不是跟thead,tfoot,一起出现的吗
    2019-05-11 11:33:00
问题已解决,确定采纳
还有疑问,暂不采纳

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

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

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

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

帮助反馈 APP下载

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

公众号

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

在线咨询

领取优惠

免费试听

领取大纲

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