<!DOCTYPE html> <body> <div style="display: list-item; list-style-type: none; list-style-position: inside; border: 1px solid green; width: -moz-fit-content">Some text</div> <div style="display: list-item; list-style-type: none; list-style-position: outside; border: 1px solid green; width: -moz-fit-content">Some text</div> </body>