snipt

Ctrl+h for KB shortcuts

CSS

pad images nicely on website css

1
2
3
4
img {
        padding: 10px;
        margin: 5px;
}
https://snipt.net/embed/5626de5cb19e493660a42d628b20a434/
/raw/5626de5cb19e493660a42d628b20a434/
5626de5cb19e493660a42d628b20a434
css
CSS
4
2019-08-15T19:57:56
True
False
False
/api/public/snipt/858/
pad-images-nicely-on-website-css
<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">img</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">padding</span><span class="o">:</span> <span class="m">10px</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">margin</span><span class="o">:</span> <span class="m">5px</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
css, image, img, padding, web

CSS

CSS Reset

1
2
3
4
5
6
* {
  padding: 0;
  margin: 0;
  text-decoration: none;
  outline: none;
}
https://snipt.net/embed/50f6aaafb60f6641692e6c3f0de7def4/
/raw/50f6aaafb60f6641692e6c3f0de7def4/
50f6aaafb60f6641692e6c3f0de7def4
css
CSS
6
2019-08-16T02:16:27
True
False
False
/api/public/snipt/691/
css-reset-2
<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="o">*</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">padding</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="nb">margin</span><span class="o">:</span> <span class="m">0</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="nb">text-decoration</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="nb">outline</span><span class="o">:</span> <span class="nb">none</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, reset

CSS

Css min-height hack

1
2
3
4
5
selector {
  min-height:500px;
  height:auto !important;
  height:500px;
}
https://snipt.net/embed/4f159dc090aa3d27c76998925d1660de/
/raw/4f159dc090aa3d27c76998925d1660de/
4f159dc090aa3d27c76998925d1660de
css
CSS
5
2019-08-20T12:27:50
True
False
False
/api/public/snipt/361/
css-min-height-hack
<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="nt">selector</span> <span class="p">{</span> </span><span id="L-2"><a name="L-2"></a> <span class="nb">min-height</span><span class="o">:</span><span class="m">500px</span><span class="p">;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nb">height</span><span class="o">:</span><span class="nb">auto</span> <span class="cp">!important</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="nb">height</span><span class="o">:</span><span class="m">500px</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

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