D3
OG
Old school D3 from simpler times
All examples
By author
By category
About
oskwazir
Full window
Github gist
JS Bin // source http://jsbin.com/xacawi
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Bin</title> <style id="jsbin-css"> /* * See https://davidwalsh.name/flexbox-dice * for this flexbox tutorial. I just wrote some code * to see for myself what was happening. */ body{ background-color:#679795; } [class$='-face']{ background-color:#fff; height:50px; width:50px; border:4px solid #F0EEE8; border-radius:8px; padding:10px; border-style:outset; } .pip{ background-color:#27242F; border:1px solid black; border-radius:50%; width:10px; height:10px; display:block; margin:2px; } .first-face{ /* * flexbox stuff */ display:flex; justify-content:center; align-items:center; } .second-face{ /* * flexbox stuff */ display:flex; justify-content:space-between; } .second-face .pip:nth-of-type(2){ align-self:flex-end; } </style> </head> <body> <div class="first-face"> <span class="pip"></span> </div> <div class="second-face"> <span class="pip"></span> <span class="pip"></span> </div> <script id="jsbin-source-css" type="text/css">/* * See https://davidwalsh.name/flexbox-dice * for this flexbox tutorial. I just wrote some code * to see for myself what was happening. */ body{ background-color:#679795; } [class$='-face']{ background-color:#fff; height:50px; width:50px; border:4px solid #F0EEE8; border-radius:8px; padding:10px; border-style:outset; } .pip{ background-color:#27242F; border:1px solid black; border-radius:50%; width:10px; height:10px; display:block; margin:2px; } .first-face{ /* * flexbox stuff */ display:flex; justify-content:center; align-items:center; } .second-face{ /* * flexbox stuff */ display:flex; justify-content:space-between; } .second-face .pip:nth-of-type(2){ align-self:flex-end; }</script> </body> </html>