snipt

Ctrl+h for KB shortcuts

CSS

example of good css consolidation

class1, class2, class3, class4 {font-size: 12px;}
https://snipt.net/embed/5acea3f597b7b7a8d8cbb9533800e049/
/raw/5acea3f597b7b7a8d8cbb9533800e049/
5acea3f597b7b7a8d8cbb9533800e049
css
CSS
1
2019-08-18T03:15:46
True
False
False
/api/public/snipt/2375/
example-of-good-css-consolidation
<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="nt">class1</span><span class="o">,</span> <span class="nt">class2</span><span class="o">,</span> <span class="nt">class3</span><span class="o">,</span> <span class="nt">class4</span> <span class="p">{</span><span class="nb">font-size</span><span class="o">:</span> <span class="m">12px</span><span class="p">;}</span> </span></pre></div> </td></tr></table>
css

CSS

css pre-consolidation

1
2
3
4
class1 {font-size: 12px;}
class2 {font-size: 12px;}
class3 {font-size: 12px;}
class4 {font-size: 12px;}
https://snipt.net/embed/2a0d213e9a42864316422dd4e3c7082a/
/raw/2a0d213e9a42864316422dd4e3c7082a/
2a0d213e9a42864316422dd4e3c7082a
css
CSS
4
2019-08-18T03:26:50
True
False
False
/api/public/snipt/2374/
css-pre-consolidation
<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></span><span id="L-1"><a name="L-1"></a><span class="nt">class1</span> <span class="p">{</span><span class="nb">font-size</span><span class="o">:</span> <span class="m">12px</span><span class="p">;}</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">class2</span> <span class="p">{</span><span class="nb">font-size</span><span class="o">:</span> <span class="m">12px</span><span class="p">;}</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">class3</span> <span class="p">{</span><span class="nb">font-size</span><span class="o">:</span> <span class="m">12px</span><span class="p">;}</span> </span><span id="L-4"><a name="L-4"></a><span class="nt">class4</span> <span class="p">{</span><span class="nb">font-size</span><span class="o">:</span> <span class="m">12px</span><span class="p">;}</span> </span></pre></div> </td></tr></table>
css

CSS

css clearfix

1
2
3
4
5
6
.clearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}
.clearfix {display: inline-block;}
/* \*/
* html .clearfix {height: 1%;}
.clearfix {display: block;}
/* */
https://snipt.net/embed/bfa696b8d476ed26288efb5aa41af154/
/raw/bfa696b8d476ed26288efb5aa41af154/
bfa696b8d476ed26288efb5aa41af154
css
CSS
6
2019-08-19T13:11:20
True
False
False
/api/public/snipt/35/
css-clearfix
<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">.clearfix</span><span class="nd">:after</span> <span class="p">{</span><span class="nb">content</span><span class="o">:</span> <span class="s2">&quot;.&quot;</span><span class="p">;</span> <span class="nb">display</span><span class="o">:</span> <span class="nb">block</span><span class="p">;</span> <span class="nb">height</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> <span class="nb">clear</span><span class="o">:</span> <span class="nb">both</span><span class="p">;</span> <span class="nb">visibility</span><span class="o">:</span> <span class="nb">hidden</span><span class="p">;}</span> </span><span id="L-2"><a name="L-2"></a><span class="nc">.clearfix</span> <span class="p">{</span><span class="nb">display</span><span class="o">:</span> <span class="nb">inline</span><span class="o">-</span><span class="nb">block</span><span class="p">;}</span> </span><span id="L-3"><a name="L-3"></a><span class="c">/* \*/</span> </span><span id="L-4"><a name="L-4"></a><span class="o">*</span> <span class="nt">html</span> <span class="nc">.clearfix</span> <span class="p">{</span><span class="nb">height</span><span class="o">:</span> <span class="m">1%</span><span class="p">;}</span> </span><span id="L-5"><a name="L-5"></a><span class="nc">.clearfix</span> <span class="p">{</span><span class="nb">display</span><span class="o">:</span> <span class="nb">block</span><span class="p">;}</span> </span><span id="L-6"><a name="L-6"></a><span class="c">/* */</span> </span></pre></div> </td></tr></table>
css

CSS

css reset

1
2
3
4
5
6
7
8
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline;}
:focus {outline: 0;}
body {line-height: 1; color: black; background: white;}
ol, ul {list-style: none;}
table {border-collapse: separate; border-spacing: 0;}
caption, th, td {text-align: left; font-weight: normal;}
blockquote:before, blockquote:after, q:before, q:after {content: "";}
blockquote, q {quotes: "" "";}
https://snipt.net/embed/87e715ec82ab19a75e811e2481e94b56/
/raw/87e715ec82ab19a75e811e2481e94b56/
87e715ec82ab19a75e811e2481e94b56
css
CSS
8
2019-08-19T13:11:37
True
False
False
/api/public/snipt/31/
css-reset
<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> <a href="#L-8">8</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">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">span</span><span class="o">,</span> <span class="nt">applet</span><span class="o">,</span> <span class="nt">object</span><span class="o">,</span> <span class="nt">iframe</span><span class="o">,</span> <span class="nt">h1</span><span class="o">,</span> <span class="nt">h2</span><span class="o">,</span> <span class="nt">h3</span><span class="o">,</span> <span class="nt">h4</span><span class="o">,</span> <span class="nt">h5</span><span class="o">,</span> <span class="nt">h6</span><span class="o">,</span> <span class="nt">p</span><span class="o">,</span> <span class="nt">blockquote</span><span class="o">,</span> <span class="nt">pre</span><span class="o">,</span> <span class="nt">a</span><span class="o">,</span> <span class="nt">abbr</span><span class="o">,</span> <span class="nt">acronym</span><span class="o">,</span> <span class="nt">address</span><span class="o">,</span> <span class="nt">big</span><span class="o">,</span> <span class="nt">cite</span><span class="o">,</span> <span class="nt">code</span><span class="o">,</span> <span class="nt">del</span><span class="o">,</span> <span class="nt">dfn</span><span class="o">,</span> <span class="nt">em</span><span class="o">,</span> <span class="nt">font</span><span class="o">,</span> <span class="nt">img</span><span class="o">,</span> <span class="nt">ins</span><span class="o">,</span> <span class="nt">kbd</span><span class="o">,</span> <span class="nt">q</span><span class="o">,</span> <span class="nt">s</span><span class="o">,</span> <span class="nt">samp</span><span class="o">,</span> <span class="nt">small</span><span class="o">,</span> <span class="nt">strike</span><span class="o">,</span> <span class="nt">strong</span><span class="o">,</span> <span class="nt">sub</span><span class="o">,</span> <span class="nt">sup</span><span class="o">,</span> <span class="nt">tt</span><span class="o">,</span> <span class="nt">var</span><span class="o">,</span> <span class="nt">dl</span><span class="o">,</span> <span class="nt">dt</span><span class="o">,</span> <span class="nt">dd</span><span class="o">,</span> <span class="nt">ol</span><span class="o">,</span> <span class="nt">ul</span><span class="o">,</span> <span class="nt">li</span><span class="o">,</span> <span class="nt">fieldset</span><span class="o">,</span> <span class="nt">form</span><span class="o">,</span> <span class="nt">label</span><span class="o">,</span> <span class="nt">legend</span><span class="o">,</span> <span class="nt">table</span><span class="o">,</span> <span class="nt">caption</span><span class="o">,</span> <span class="nt">tbody</span><span class="o">,</span> <span class="nt">tfoot</span><span class="o">,</span> <span class="nt">thead</span><span class="o">,</span> <span class="nt">tr</span><span class="o">,</span> <span class="nt">th</span><span class="o">,</span> <span class="nt">td</span> <span class="p">{</span><span class="nb">margin</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> <span class="nb">padding</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> <span class="nb">border</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> <span class="nb">outline</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> <span class="nb">font-weight</span><span class="o">:</span> <span class="nb">inherit</span><span class="p">;</span> <span class="nb">font-style</span><span class="o">:</span> <span class="nb">inherit</span><span class="p">;</span> <span class="nb">font-size</span><span class="o">:</span> <span class="m">100%</span><span class="p">;</span> <span class="nb">font-family</span><span class="o">:</span> <span class="nb">inherit</span><span class="p">;</span> <span class="nb">vertical-align</span><span class="o">:</span> <span class="nb">baseline</span><span class="p">;}</span> </span><span id="L-2"><a name="L-2"></a><span class="nd">:focus</span> <span class="p">{</span><span class="nb">outline</span><span class="o">:</span> <span class="m">0</span><span class="p">;}</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">body</span> <span class="p">{</span><span class="nb">line-height</span><span class="o">:</span> <span class="m">1</span><span class="p">;</span> <span class="nb">color</span><span class="o">:</span> <span class="nb">black</span><span class="p">;</span> <span class="nb">background</span><span class="o">:</span> <span class="nb">white</span><span class="p">;}</span> </span><span id="L-4"><a name="L-4"></a><span class="nt">ol</span><span class="o">,</span> <span class="nt">ul</span> <span class="p">{</span><span class="nb">list-style</span><span class="o">:</span> <span class="nb">none</span><span class="p">;}</span> </span><span id="L-5"><a name="L-5"></a><span class="nt">table</span> <span class="p">{</span><span class="nb">border-collapse</span><span class="o">:</span> <span class="nb">separate</span><span class="p">;</span> <span class="nb">border-spacing</span><span class="o">:</span> <span class="m">0</span><span class="p">;}</span> </span><span id="L-6"><a name="L-6"></a><span class="nt">caption</span><span class="o">,</span> <span class="nt">th</span><span class="o">,</span> <span class="nt">td</span> <span class="p">{</span><span class="nb">text-align</span><span class="o">:</span> <span class="nb">left</span><span class="p">;</span> <span class="nb">font-weight</span><span class="o">:</span> <span class="nb">normal</span><span class="p">;}</span> </span><span id="L-7"><a name="L-7"></a><span class="nt">blockquote</span><span class="nd">:before</span><span class="o">,</span> <span class="nt">blockquote</span><span class="nd">:after</span><span class="o">,</span> <span class="nt">q</span><span class="nd">:before</span><span class="o">,</span> <span class="nt">q</span><span class="nd">:after</span> <span class="p">{</span><span class="nb">content</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">;}</span> </span><span id="L-8"><a name="L-8"></a><span class="nt">blockquote</span><span class="o">,</span> <span class="nt">q</span> <span class="p">{</span><span class="nb">quotes</span><span class="o">:</span> <span class="s2">&quot;&quot;</span> <span class="s2">&quot;&quot;</span><span class="p">;}</span> </span></pre></div> </td></tr></table>
css