Set width and height of the div to 320 by 240

<!DOCTYPE html> <html> <head> <style> div.blahdiv { border-color:#0000ff; border-style:solid; border-width:1px; height:240px; width:320px; } </style> </head> <body> <div class="blahdiv">Blah blah blah.</div> </body> </html>

Percentage width and height

The code below shows how you can make the div size a percentage of web page.

<!DOCTYPE html> <html> <head> <style> html{ height:100%; } body{ height:100%; background:solid green; } div.blahdiv { border-color:#0000ff; border-style:solid; border-width:1px; height:50%; width:50%; } </style> </head> <body> <div class="blahdiv">Blah blah blah</div> </body> </html>