h2 { width: 100%; font-size: 2em; background-color: #eee; } h3 { width: 100%; font-size: 1.5em; } .function { border-top: solid 1px #eee; } .function .container { display: flex; } .function .doc { width: 50%; } .function .doc p { text-indent: 1.5em; } .function .example { width: 50%; flex-grow: 2; flex-basis: auto; overflow-x: scroll; } .function .example code { border-radius: 5px; border: solid 1px #000; } @media all and (max-width: 800px) { .function .container { flex-direction: column; } .function .doc, .function .example { width: 100%; } }