Blog

A CSS snippet that makes any HTML page look good

I occasionally get (legal) texts send by customers. Usually exported in horrible HTML formatting via a WYSIWYG editor. I use the following style to make it look presentable, before I send it to our app developers.

<head>
    <style>
    body {
            font-family:sans-serif;
            line-height:140%;
            max-width:38rem;
            padding:2rem;
            margin:auto;
        }
        h1,h2,h3,h4,h5 {
            margin-bottom:.6rem;
            line-height:120%;
        }
        p {
            margin:0 0 1rem;
        }
    </style>
</head>

Additionally, I use the 'replace' functionality in my text editor to remove unnecessary divs, paragraphs and other elements.

If you are looking for a minimal way to make any HTML formatted page look good, here you go.