iframe和table标签

2017-05-19  本文已影响10人  李悦之
1、iframe说白了就是页面套页面
2、iframe的缺点:性能低

因为是页面套页面,所以需要加载的页面多,导致性能低下

3、name属性

name就是窗口的名字,用target可以进行定向,可以接收a标签和form标签的动作

我是A页面
    <hr>
    <a href="//baidu.com" target="xxx">百度</a>
    <hr>
    <iframe src="1.html" name="xxx" width="900px" height="500px" frameborder="0"></iframe>

如果点击A页面上的a标签,那么就会在iframe里打开百度,因为它们的window.name是一样的。

4、其它的相关属性可以看mdn,用到了再查
5、table标签
<style>
    table{
      border:1px solid red;
      border-collapse:collapse; //
    }
    td{
      border:1px solid green;
    }
</style>

注意border-collapse:collapse;这个属性,它是内边框和外边框的合并;

<thead></thead>
<tbody></tbody>
<tfooter></tfooter>

这三个很重要,尤其中tbody,即使不写也会被默认加上,这样对于用选择器会出错,tbody必须要有。

<thead>
      <tr>
        <th>1</th>
        <th>2</th>
        <th>3</th>
      </tr>
</thead>

thead一边是用来包裹表头。

上一篇 下一篇

猜你喜欢

热点阅读