snipt

Ctrl+h for KB shortcuts

CSS

100% de un iframe de alto

1
2
3
4
<style type="text/css">
    html, body, div, iframe { margin:0; padding:0; height:100%; }
    iframe { display:block; width:100%; border:none; }
</style>
https://snipt.net/embed/48ec57d502f72e44bde79eef53747a43/
https://snipt.net/raw/48ec57d502f72e44bde79eef53747a43/
48ec57d502f72e44bde79eef53747a43
css
CSS
4
2016-09-07T04:19:15
True
False
False
/api/public/snipt/47736/
100-de-un-iframe-de-alto
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="o">&lt;</span><span class="nt">style</span> <span class="nt">type</span><span class="o">=</span><span class="s2">&quot;text/css&quot;</span><span class="o">&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nt">html</span><span class="o">,</span> <span class="nt">body</span><span class="o">,</span> <span class="nt">div</span><span class="o">,</span> <span class="nt">iframe</span> <span class="p">{</span> <span class="k">margin</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">padding</span><span class="o">:</span><span class="m">0</span><span class="p">;</span> <span class="k">height</span><span class="o">:</span><span class="m">100%</span><span class="p">;</span> <span class="p">}</span> </span><span id="L-3"><a name="L-3"></a> <span class="nt">iframe</span> <span class="p">{</span> <span class="k">display</span><span class="o">:</span><span class="k">block</span><span class="p">;</span> <span class="k">width</span><span class="o">:</span><span class="m">100%</span><span class="p">;</span> <span class="k">border</span><span class="o">:</span><span class="k">none</span><span class="p">;</span> <span class="p">}</span> </span><span id="L-4"><a name="L-4"></a><span class="o">&lt;/</span><span class="nt">style</span><span class="o">&gt;</span> </span></pre></div> </td></tr></table>
"alto 100%", css, frame

JavaScript

Target Frame

1
2
3
  top.location.href = 'page.htm';
  self.location.href = 'page.htm';
  parent.location.href = 'page.htm';
https://snipt.net/embed/29d381c1ce394e6474fd59eae7bf7cd3/
https://snipt.net/raw/29d381c1ce394e6474fd59eae7bf7cd3/
29d381c1ce394e6474fd59eae7bf7cd3
js
JavaScript
4
2016-09-22T11:19:04
True
False
False
/api/public/snipt/39232/
target-frame
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a> <span class="nx">top</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;page.htm&#39;</span><span class="p">;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nx">self</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;page.htm&#39;</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nx">parent</span><span class="p">.</span><span class="nx">location</span><span class="p">.</span><span class="nx">href</span> <span class="o">=</span> <span class="s1">&#39;page.htm&#39;</span><span class="p">;</span> </span></pre></div> </td></tr></table>
frame, location, target, top

HTML

Abrir Frame Pagina Principal

<a href="index.php" target="_top">Pantalla Completa</a>
https://snipt.net/embed/02bd3dcef9ef4cbff3f6e004ea67200c/
https://snipt.net/raw/02bd3dcef9ef4cbff3f6e004ea67200c/
02bd3dcef9ef4cbff3f6e004ea67200c
html
HTML
1
2016-09-24T20:11:49
True
False
False
/api/public/snipt/33652/
abrir-frame-pagina-principal
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;index.php&quot;</span> <span class="na">target=</span><span class="s">&quot;_top&quot;</span><span class="nt">&gt;</span>Pantalla Completa<span class="nt">&lt;/a&gt;</span> </span></pre></div> </td></tr></table>
"pantalla completa", abrir, frame

JavaScript

Check if a page is a frame

1
2
3
4
5
if (top != self) {
    //framed
} else {
    // stand-alone
}
https://snipt.net/embed/9c5a107b8017ea6881a8e4de6cf1a4fb/
https://snipt.net/raw/9c5a107b8017ea6881a8e4de6cf1a4fb/
9c5a107b8017ea6881a8e4de6cf1a4fb
js
JavaScript
6
2016-09-18T19:57:34
True
False
False
/api/public/snipt/14047/
check-if-a-page-is-a-frame
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="k">if</span> <span class="p">(</span><span class="nx">top</span> <span class="o">!=</span> <span class="nx">self</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="c1">//framed</span> </span><span id="L-3"><a name="L-3"></a><span class="p">}</span> <span class="k">else</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="c1">// stand-alone</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
check, frame, javascript

HTML

iframe

<iframe name="imagen" src="imagen_bodega.php?id=<?=$_GET['id']?>" width="400" height="300" scrolling="no" marginheight="0" marginwidth="0" frameborder="0">
</iframe>
https://snipt.net/embed/a598e4f2afad9df861fdc476f67ef252/
https://snipt.net/raw/a598e4f2afad9df861fdc476f67ef252/
a598e4f2afad9df861fdc476f67ef252
html
HTML
2
2016-09-22T23:29:55
True
False
False
Feb 28, 2013 at 05:21 PM
/api/public/snipt/3568/
iframe
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span id="L-1"><a name="L-1"></a><span class="nt">&lt;iframe</span> <span class="na">name=</span><span class="s">&quot;imagen&quot;</span> <span class="na">src=</span><span class="s">&quot;imagen_bodega.php?id=&lt;?=$_GET[&#39;id&#39;]?&gt;&quot;</span> <span class="na">width=</span><span class="s">&quot;400&quot;</span> <span class="na">height=</span><span class="s">&quot;300&quot;</span> <span class="na">scrolling=</span><span class="s">&quot;no&quot;</span> <span class="na">marginheight=</span><span class="s">&quot;0&quot;</span> <span class="na">marginwidth=</span><span class="s">&quot;0&quot;</span> <span class="na">frameborder=</span><span class="s">&quot;0&quot;</span><span class="nt">&gt;</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">&lt;/iframe&gt;</span> </span></pre></div> </td></tr></table>
frame
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.