arrow_back Back to Notebook
html
html
February 28, 2019

How to make an element autoexpand right to left in HTML

Making an element expand the opposite direction is a useful html trick to remember

Float: right

Add the style float: right; to the container

<div class="container" style="float: right;">
    <div>1</div>
    <div>2</div>
    <div>3</div>
</div>

Thanks for reading!

John Wiseman

Full-Stack Software Engineer building scalable digital solutions. specializing in modern web technologies and mission-critical systems.

© 2026 Wiseman Systems Pty. Ltd.

Navigation

Start a Conversation

Ready to discuss your next project? Let's build something extraordinary together.

Get in Touch