HTML CSS examples for CSS Layout:Width
Auto resizing div with max width
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .balloon {<!-- ww w. ja v a 2 s . com--> background:Chartreuse; border:solid 3px; display:inline-block; max-width:226px; } </style> </head> <body> <div class="balloon"> This is sample text. This is a seco sentence. </div> <div class="balloon"> This is sample text. </div> </body> </html>