css tips and tricks

Centering div (Flex method)

(center both vertical and horizontal)

<style type="text/css">
height: 100%;
display: flex;
align-items: center;
justify-content: center;
border: 1px silver solid;
height: 100%;
<div>Flex content</div>


Remove <form> space

<form method="POST" style="display: inline;">
<button href="/note/" class="btn btn-danger">Delete<span class="glyphicon glyphicon-trash"></span></button>


Make the whole area of a list item clickable as a link

<ul class="list-group">
<li class="list-group-item">
<a href="#" style="display: block;">Click Me</a>


Leave a Comment

Your email address will not be published. Required fields are marked *