O'Reilly logo
  • Richard Thomas thinks this is interesting:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <style> .box { height:200px; width:200px; display:inline-block } </style> </head> <body> <div class="box" style="background:red"/> <div id="middleBox" class="box" style="background:green"/> <div id="lastBox" class="box" style="background:blue"/> </body> </html>

From

Cover of HTML5, JavaScript, and jQuery 24-Hour Trainer

Note

Current versions of Firefox and Chrome on Linux do not observe the self-closing ‘/&gt;’ on the divs. I needed to update this to ‘&gt;

‘ for the page to display as per example.