Skip to content

Instantly share code, notes, and snippets.

@gonghao
Created July 10, 2015 03:44
Show Gist options
  • Save gonghao/144194378fcafc7b5cd6 to your computer and use it in GitHub Desktop.
Save gonghao/144194378fcafc7b5cd6 to your computer and use it in GitHub Desktop.

Revisions

  1. gonghao created this gist Jul 10, 2015.
    6 changes: 6 additions & 0 deletions dabblet.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    .banner { width: 300px; height: 200px; overflow: hidden; position: relative; }
    .banner > a { position: absolute; top: -100%; bottom: -100%; left: -100%; right: -100%; text-align: center; }
    .banner > a:before { content: ""; display: inline-block; vertical-align: middle; height: 100%; }
    .banner > a > img { vertical-align: middle; }

    .banner:after { content:""; position: absolute; top: 0; left: 0; bottom: 0; right: 0; background: rgba(0, 0, 0, 0.3); }
    7 changes: 7 additions & 0 deletions dabblet.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    <div class="banner">
    <a href="#"><img src="//placehold.it/500x300" alt=""/></a>
    </div>

    <div class="banner">
    <a href="#"><img src="//placehold.it/100x100/ff0000" alt=""/></a>
    </div>
    1 change: 1 addition & 0 deletions dabblet.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    // alert('Hello world!');
    1 change: 1 addition & 0 deletions settings.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}