Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

CSS

Opacity Fix for IE7 & IE8

1
2
3
4
5
6
7
#element {
    background: url("alpha-transparent.png") no-repeat 0 0;
    filter: alpha(opacity = 80);
    filter: progid:DXImageTransform.Microsoft.gradient(
        startColorstr=#00FFFFFF, endColorstr=#00FFFFFF
    );
}
https://snipt.net/embed/14a177d2919382c82ac165b66ae6b599/
https://snipt.net/raw/14a177d2919382c82ac165b66ae6b599/
14a177d2919382c82ac165b66ae6b599
css
CSS
7
2016-12-07T02:46:53
True
False
False
/api/public/snipt/36513/
opacity-fix-for-ie7-ie8
<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> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nn">#element</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">background</span><span class="o">:</span> <span class="sx">url(&quot;alpha-transparent.png&quot;)</span> <span class="nb">no-repeat</span> <span class="m">0</span> <span class="m">0</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="n">filter</span><span class="o">:</span> <span class="n">alpha</span><span class="p">(</span><span class="nb">opacity</span> <span class="o">=</span> <span class="m">80</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a> <span class="n">filter</span><span class="o">:</span> <span class="n">progid</span><span class="o">:</span><span class="n">DXImageTransform</span><span class="o">.</span><span class="n">Microsoft</span><span class="o">.</span><span class="n">gradient</span><span class="p">(</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">startColorstr</span><span class="o">=</span><span class="m">#00FFFF</span><span class="n">FF</span><span class="o">,</span> <span class="n">endColorstr</span><span class="o">=</span><span class="m">#00FFFF</span><span class="n">FF</span> </span><span id="L-6"><a name="L-6"></a> <span class="p">);</span> </span><span id="L-7"><a name="L-7"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
background, css, png, transparency

CSS+PHP

CSS 3 background transparency with rgba colors

1
2
3
background: rgba(255, 0, 0, 0.2);

/* red background with 20% of opacity, near to 0 is more opaque, near to 1 is more "colored" */
https://snipt.net/embed/5c3fb7bacb5ad85e1b542302d5ff6ab9/
https://snipt.net/raw/5c3fb7bacb5ad85e1b542302d5ff6ab9/
5c3fb7bacb5ad85e1b542302d5ff6ab9
css+php
CSS+PHP
3
2016-12-07T09:06:56
True
False
False
/api/public/snipt/16575/
css-3-background-transparency-with-rgba-colors
<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></span><span id="L-1"><a name="L-1"></a><span class="nt">background</span><span class="o">:</span> <span class="nt">rgba</span><span class="o">(</span><span class="nt">255</span><span class="o">,</span> <span class="nt">0</span><span class="o">,</span> <span class="nt">0</span><span class="o">,</span> <span class="nt">0</span><span class="nc">.2</span><span class="o">);</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c">/* red background with 20% of opacity, near to 0 is more opaque, near to 1 is more &quot;colored&quot; */</span> </span></pre></div> </td></tr></table>
background, css3, rgba, transparency

CSS

CSS transparency for all browsers

1
2
3
4
5
6
.transparent_class {
	filter:alpha(opacity=50);
	-moz-opacity:0.5;
	-khtml-opacity: 0.5;
	opacity: 0.5;
}
https://snipt.net/embed/7e7d4ef12212692060eca434734a8925/
https://snipt.net/raw/7e7d4ef12212692060eca434734a8925/
7e7d4ef12212692060eca434734a8925
css
CSS
6
2016-12-02T20:27:47
True
False
False
/api/public/snipt/12570/
css-transparency-for-all-browsers-1
<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> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nc">.transparent_class</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="n">filter</span><span class="o">:</span><span class="n">alpha</span><span class="p">(</span><span class="nb">opacity</span><span class="o">=</span><span class="m">50</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a> <span class="o">-</span><span class="n">moz</span><span class="o">-</span><span class="nb">opacity</span><span class="o">:</span><span class="m">0</span><span class="o">.</span><span class="m">5</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="o">-</span><span class="n">khtml</span><span class="o">-</span><span class="nb">opacity</span><span class="o">:</span> <span class="m">0</span><span class="o">.</span><span class="m">5</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a> <span class="nb">opacity</span><span class="o">:</span> <span class="m">0</span><span class="o">.</span><span class="m">5</span><span class="p">;</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
css, transparency

CSS

Setting an opacity

.transparency{ filter:opacity(alpha:50); }
https://snipt.net/embed/f3d2b9176f151eccfbc7b55db6ecf21b/
https://snipt.net/raw/f3d2b9176f151eccfbc7b55db6ecf21b/
f3d2b9176f151eccfbc7b55db6ecf21b
css
CSS
1
2016-12-02T20:27:50
True
False
False
/api/public/snipt/8069/
setting-an-opacity
<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></span><span id="L-1"><a name="L-1"></a><span class="nc">.transparency</span><span class="p">{</span> <span class="n">filter</span><span class="o">:</span><span class="nb">opacity</span><span class="p">(</span><span class="n">alpha</span><span class="o">:</span><span class="m">50</span><span class="p">);</span> <span class="p">}</span> </span></pre></div> </td></tr></table>
opacity, transparency
Copyrighted, illegal, or inappropriate content? Email [email protected].