Skip to content

Instantly share code, notes, and snippets.

@kpman
Created June 1, 2014 04:00
Show Gist options
  • Save kpman/c7b764a1ad0eedea57cc to your computer and use it in GitHub Desktop.
Save kpman/c7b764a1ad0eedea57cc to your computer and use it in GitHub Desktop.

Revisions

  1. kpman created this gist Jun 1, 2014.
    8 changes: 8 additions & 0 deletions element-vertical-center.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    element vertical center
    -----------------------
    position the element vertical center with pure CSS
    skill from Front-End Developer Taiwan Group

    A [Pen](http://codepen.io/kpman/pen/ihdxG) by [kpman](http://codepen.io/kpman) on [CodePen](http://codepen.io/).

    [License](http://codepen.io/kpman/pen/ihdxG/license).
    1 change: 1 addition & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    <div></div>
    11 changes: 11 additions & 0 deletions style.css
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    div {
    margin: auto;
    width: 100px;
    height: 100px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    position: absolute; /* important */
    background: DodgerBlue;
    }