HTML 框架
<h2><span style=“color: #00ccff;”><strong>前言:</strong></span></h2>
通过使用框架,你可以在同一个浏览器窗口中显示不止一个页面。
每份HTML文档称为一个框架,并且每个框架都独立于其他的框架。
<iframe src=“index.php/” height=“500px” width=“100%”></iframe>
<h2><span style=“color: #00ccff;”><strong>框架相关标签:</strong></span></h2>
<h1><span style=“color: #00ccff;”><strong>iframe</strong></span></h1>
iframe:定义一个内联的iframe
iframe语法:<h1><span style=“color: #00ccff;”><strong></strong></span></h1>
<pre class=“line-numbers language-html”><code class=“language-html”><iframe src="URL"></iframe></code></pre>
该URL指向不同的网页。
<h1><span style=“color: #00ccff;”><strong>height 和 width 属性</strong></span></h1>
height 和 width 属性用来定义iframe标签的高度与宽度。
属性默认以像素为单位, 但是你可以指定其按比例显示 (如:“80%”).
<pre class=“line-numbers language-html”><code class=“language-html”><iframe src="index.htm" width="100%" height="80px"></iframe>
</code></pre>
<h1><span style=“color: #00ccff;”><strong>frameborder属性</strong></span></h1>
frameborder 属性用于定义iframe表示是否显示边框。
设置属性值为 “0” 移除iframe的边框:
<pre class=“line-numbers language-html”><code class=“language-html”><iframe src="index.html" frameborder="0"></iframe></code></pre>
<h1><span style=“color: #00ccff;”><strong>target="iframe_a"属性</strong></span></h1>
iframe可以显示一个目标链接的页面
目标链接的属性必须使用iframe的属性,如下实例:
<pre class=“line-numbers language-html”><code class=“language-html”><iframe src="index.html" name="iframe_a"></iframe>
<p><a href="http://moshanghua.net" target="iframe_a">陌上花-blog</a></p>
</code></pre>
实例:
<pre class=“line-numbers language-html”><code class=“language-html”><iframe src="index.php/" height="500px" width="100%" frameborder="0"></iframe>
<p><a href="http://moshanghua.net" target="iframe_a">moshanghua</a></p></code></pre>
