<!DOCTYPE html> <style> .green { display:inline-block; background: green; width: 50%; } .yellow { background: yellow; width: 50%; } </style> <p>Test passes if yellow block is alongside green block, not in next line.</p> <div> <div class='green'> <h1>Inline block<h1> </div> <div class='yellow'> <h1>Floating block</h1> </div> </div> <script> window.onload = function() { document.body.offsetTop; document.querySelector('.yellow').style.float = 'right'; } </script>