Fabians Bookmarks
  • Fabians Bookmarks
  • Tag cloud
  • Daily
  • RSS Feed
  • Login
Delete   Set public   Set private   Add tags   Delete tags
  Add tag   Cancel
  Delete tag   Cancel
17527 shaares · 14141 private links
Filters
Links per page
20 50 100

Vertical centering is impossible in CSS lol! No it isn't. // mini-rant by @jaffathecake

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta charset="utf-8">
<!--
Created using JS Bin
http://jsbin.com

Copyright (c) 2014 by jakearchibald (http://jsbin.com/honawo/5/edit)

Released under the MIT license: http://jsbin.mit-license.org
-->
<title>JS Bin</title>

<style id="jsbin-css">
body, html {
height: 100%;
margin: 0;
padding: 0;
}

p {
padding: 0 30px;
margin: 0;
font-family: Georgia, serif;
font-size: 100px;
font-size: 8vw;
box-sizing: border-box;
line-height: 1.4;
text-align: center;
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.5s ease-in-out;
filter: alpha(opacity=0);
pointer-events: none;
}

.active {
opacity: 1;
filter: alpha(opacity=100);
pointer-events: auto;
}

.technique-1 { / the best one /
display: -webkit-flex;
-webkit-align-items: center;
-webkit-justify-content: center;
display: flex;
align-items: center;
justify-content: center;
}

.technique-2 {
height: auto;
top: 50%;
-webkit-transform: translateY(-50%);
transform: translateY(-50%);
}

.technique-3 {
display: table;
}

.technique-3 > span {
display: table-cell;
vertical-align: middle;
}

.technique-4 { / yeah, this one is weak /
font-size: 4vw;
line-height: 100vh;
}
</style>

css html webdev webdesign flexbox ie8 ie9
October 23, 2014 at 12:50:43 GMT+2
https://jsbin.com/honawo/quiet/
Filters
Links per page
20 50 100
By @fabian@floss.social · Powered by Shaarli
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community