snipt

Ctrl+h for KB shortcuts

SCSS

Vertical gradient background, with alpha opacity and IE support. Compass+Sass style.

1
2
3
4
5
6
$color_start: rgba(255,255,255,1);
$color_stop:  rgba(255,255,255,0);
#gradient {
    @include background(filter-gradient(ie-hex-str($color_start), ie-hex-str($color_stop))); // For IE
    @include background(linear-gradient($color_start, $color_stop));
}
https://snipt.net/embed/7cd0787f39a05f476c04ac0400a57c22/
https://snipt.net/raw/7cd0787f39a05f476c04ac0400a57c22/
7cd0787f39a05f476c04ac0400a57c22
scss
SCSS
6
2016-09-26T18:48:42
True
False
False
/api/public/snipt/39983/
vertical-gradient-background-with-alpha-opacity-and-ie-support-compasssass-style
<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 id="L-1"><a name="L-1"></a><span class="nv">$color_start</span><span class="o">:</span> <span class="nf">rgba</span><span class="p">(</span><span class="mi">255</span><span class="o">,</span><span class="mi">255</span><span class="o">,</span><span class="mi">255</span><span class="o">,</span><span class="mi">1</span><span class="p">);</span> </span><span id="L-2"><a name="L-2"></a><span class="nv">$color_stop</span><span class="o">:</span> <span class="nf">rgba</span><span class="p">(</span><span class="mi">255</span><span class="o">,</span><span class="mi">255</span><span class="o">,</span><span class="mi">255</span><span class="o">,</span><span class="mi">0</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nn">#gradient</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">@include</span><span class="nd"> background</span><span class="p">(</span><span class="nf">filter-gradient</span><span class="p">(</span><span class="nf">ie-hex-str</span><span class="p">(</span><span class="nv">$color_start</span><span class="p">)</span><span class="o">,</span> <span class="nf">ie-hex-str</span><span class="p">(</span><span class="nv">$color_stop</span><span class="p">)));</span> <span class="c1">// For IE</span> </span><span id="L-5"><a name="L-5"></a> <span class="k">@include</span><span class="nd"> background</span><span class="p">(</span><span class="nf">linear-gradient</span><span class="p">(</span><span class="nv">$color_start</span><span class="o">,</span> <span class="nv">$color_stop</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>
background, compass, gradient, sass

CSS

CSS 3 background gradient

1
2
3
4
background: #cccccc; /* old browsers */
background: -webkit-gradient(linear, left top, left bottom, from(#efefef), to(#cccccc));
background: -moz-linear-gradient(top, #efefef, #cccccc);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#efefef', endColorstr='#cccccc'); /* IE8 */
https://snipt.net/embed/e81259e1f26c610d924ce626fcfc5f14/
https://snipt.net/raw/e81259e1f26c610d924ce626fcfc5f14/
e81259e1f26c610d924ce626fcfc5f14
css
CSS
4
2016-09-22T17:59:20
True
False
False
/api/public/snipt/25141/
css-3-background-gradient
<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="nt">background</span><span class="o">:</span> <span class="nf">#cccccc</span><span class="o">;</span> <span class="c">/* old browsers */</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">background</span><span class="o">:</span> <span class="nt">-webkit-gradient</span><span class="o">(</span><span class="nt">linear</span><span class="o">,</span> <span class="nt">left</span> <span class="nt">top</span><span class="o">,</span> <span class="nt">left</span> <span class="nt">bottom</span><span class="o">,</span> <span class="nt">from</span><span class="o">(</span><span class="nf">#efefef</span><span class="o">),</span> <span class="nt">to</span><span class="o">(</span><span class="nf">#cccccc</span><span class="o">));</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">background</span><span class="o">:</span> <span class="nt">-moz-linear-gradient</span><span class="o">(</span><span class="nt">top</span><span class="o">,</span> <span class="nf">#efefef</span><span class="o">,</span> <span class="nf">#cccccc</span><span class="o">);</span> </span><span id="L-4"><a name="L-4"></a><span class="nt">filter</span><span class="o">:</span> <span class="nt">progid</span><span class="nd">:DXImageTransform</span><span class="nc">.Microsoft.gradient</span><span class="o">(</span><span class="nt">startColorstr</span><span class="o">=</span><span class="s1">&#39;#efefef&#39;</span><span class="o">,</span> <span class="nt">endColorstr</span><span class="o">=</span><span class="s1">&#39;#cccccc&#39;</span><span class="o">);</span> <span class="c">/* IE8 */</span> </span></pre></div> </td></tr></table>
background, css, css3, gradient

CSS

NewGap Logo CSS3 Gradient

background:-webkit-gradient(linear, 100% 0%, 0% 100%, from(#03265e), to(#6481b9)) 0% 0 no-repeat #D7D2BD;
https://snipt.net/embed/6e4686e8915c57ba6521528b18b0f5e5/
https://snipt.net/raw/6e4686e8915c57ba6521528b18b0f5e5/
6e4686e8915c57ba6521528b18b0f5e5
css
CSS
2
2016-09-22T11:32:06
True
False
False
/api/public/snipt/20629/
newgap-logo-css3-gradient
<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">background</span><span class="nd">:-webkit-gradient</span><span class="o">(</span><span class="nt">linear</span><span class="o">,</span> <span class="nt">100</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">100</span><span class="o">%,</span> <span class="nt">from</span><span class="o">(</span><span class="nf">#03265e</span><span class="o">),</span> <span class="nt">to</span><span class="o">(</span><span class="nf">#6481b9</span><span class="o">))</span> <span class="nt">0</span><span class="o">%</span> <span class="nt">0</span> <span class="nt">no-repeat</span> <span class="nf">#D7D2BD</span><span class="o">;</span> </span></pre></div> </td></tr></table>
css3, gradient, webkit
Copyrighted, illegal, or inappropriate content? Email support@snipt.net.