Ive cleaned up your HTML a bit by putting the LI inside UL and getting rid of the redundant div.
You can set the maximum width on any element of the block level, so combining this with the @epatel library ad will give you the following.
Play with width and so on. I just installed them randomly.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Tasks for today</title> <meta name="generator" content="TextMate http://macromates.com/"> <meta name="author" content="sebastian stephenson"> <style type="text/css" media="screen"> body { border: medium dashed #7979ff; background-color: #fff; margin: 0 auto; } body p{ font: 2em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; padding-left: 5px; } .todos { font: 1em"Lucida Grande", Lucida, Verdana, sans-serif; color: #7D1518; padding-left: 20px; } .todos p{ font: 1em Arial; } ul { max-width:200px; } @media only screen and (max-device-width: 480px) { ul { max-width:480px; } } @media only screen and (max-device-width: 240px) { ul { max-width:240px; } } </style> </head> <body> <p>a greeting</p> <ul class="todos"> <li>a task</li> <li>a task with detail <p>detail</p> </li> <li>a task with muilple acitons <ul> <li>an action</li> <li>an action</li> <li>an action</li> <li>an action</li> <li>an action</li> <li>an action</li> <li>an action</li> </ul> </li> </ul> </body> </html>
source share