snipt

Ctrl+h for KB shortcuts

Text only

CIRCLE IMAGE SIMPLE

1
2
3
4
5
6
7
.img-circle {
    border-radius: 50%;
}

Now any image with the img-circle class will be displayed as a perfect circle:

<img class="img-circle" src="kitten.jpg">
https://snipt.net/embed/14f7751b5d61be4d632534297219db3e/
/raw/14f7751b5d61be4d632534297219db3e/
14f7751b5d61be4d632534297219db3e
text
Text only
7
2019-08-18T01:49:23
True
False
False
Sep 26, 2015 at 06:16 PM
/api/public/snipt/141251/
circle-image-simple
<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>.img-circle { </span><span id="L-2"><a name="L-2"></a> border-radius: 50%; </span><span id="L-3"><a name="L-3"></a>} </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>Now any image with the img-circle class will be displayed as a perfect circle: </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a>&lt;img class=&quot;img-circle&quot; src=&quot;kitten.jpg&quot;&gt; </span></pre></div> </td></tr></table>
circle, css, image

Text only

CSS: Flickering on animation on iOS

1
2
3
4
5
6
7
Could be fixed by:

Tips 1 - Adding -webkit-backspace-visibility: hidden to the animated element and/or its parent(s) and/or its child(ren)

Tips 2 - Adding translateZ(0) everywhere like a maniac

Tips 3 - Could be because of -webkit-scrolling-overflow ! Remove it and yey. Can't remove it ? Then remove a overflow: hidden on its parent and you should be fine.
https://snipt.net/embed/0798edb481751d69478f7c2e8bd40b5a/
/raw/0798edb481751d69478f7c2e8bd40b5a/
0798edb481751d69478f7c2e8bd40b5a
text
Text only
7
2019-08-15T19:04:20
True
False
False
Apr 01, 2015 at 04:04 PM
/api/public/snipt/138822/
css-flickering-on-animation-on-ios-75944e62
<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>Could be fixed by: </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>Tips 1 - Adding -webkit-backspace-visibility: hidden to the animated element and/or its parent(s) and/or its child(ren) </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>Tips 2 - Adding translateZ(0) everywhere like a maniac </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a>Tips 3 - Could be because of -webkit-scrolling-overflow ! Remove it and yey. Can&#39;t remove it ? Then remove a overflow: hidden on its parent and you should be fine. </span></pre></div> </td></tr></table>
animation, blink, crap, css, flicker

CSS

Image set Color black white

1
2
3
4
5
#image{
	filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); 
	filter: gray; 
	-webkit-filter: grayscale(100%);
}
https://snipt.net/embed/aa4e5343ceb1745eac8007803dce64e6/
/raw/aa4e5343ceb1745eac8007803dce64e6/
aa4e5343ceb1745eac8007803dce64e6
css
CSS
5
2016-12-31T16:51:22
True
False
True
Aug 21, 2014 at 04:46 AM
/api/public/snipt/136200/
image-set-color-black-white-0591ef6d
<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></span><span id="L-1"><a name="L-1"></a><span class="nn">#image</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="sx">url(&quot;data:image/svg+xml;utf8,&lt;svg xmlns=\&#39;http://www.w3.org/2000/svg\&#39;&gt;&lt;filter id=\&#39;grayscale\&#39;&gt;&lt;feColorMatrix type=\&#39;matrix\&#39; values=\&#39;0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\&#39;/&gt;&lt;/filter&gt;&lt;/svg&gt;#grayscale&quot;)</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="nb">gray</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="o">-</span><span class="n">webkit</span><span class="o">-</span><span class="n">filter</span><span class="o">:</span> <span class="n">grayscale</span><span class="p">(</span><span class="m">100%</span><span class="p">);</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
css, image

Text only

Shortest Clearfix ever

1
2
3
4
5
.cf:after {
    content:"";
    clear:both;
    display:table;
}
https://snipt.net/embed/117fdbfb9fce09c89a66a0d299e35ad1/
/raw/117fdbfb9fce09c89a66a0d299e35ad1/
117fdbfb9fce09c89a66a0d299e35ad1
text
Text only
5
2019-08-18T09:54:30
True
False
False
/api/public/snipt/136023/
shortest-clearfix-ever-fd450953
<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></span><span id="L-1"><a name="L-1"></a>.cf:after { </span><span id="L-2"><a name="L-2"></a> content:&quot;&quot;; </span><span id="L-3"><a name="L-3"></a> clear:both; </span><span id="L-4"><a name="L-4"></a> display:table; </span><span id="L-5"><a name="L-5"></a>} </span></pre></div> </td></tr></table>
css