[whatwg] HTML 5: The l (line) element

Dave Hodder dmh at dmh.org.uk
Sun Feb 17 13:06:47 PST 2008


Please consider adding the 'l' element (as found in XHTML 2).

The 'l' element can be used to break up text into separate lines, in a 
similar manner to the existing 'br' element.  Unlike 'br', it is a 
container element; instead of "<p>Line 1<br>Line 2</p>", one would type 
"<p><l>Line 1</l><l>Line 2</l></p>".  The main advantage of 'l' is 
presentational -- it becomes much easier to colour lines differently, to 
add automatic line numbers, etc.

Example:

     <!DOCTYPE html>
     <html lang="en-GB">
      <head>
       <title><l> Demonstration</title>
       <style type="text/css">
        label { float: left; width: 8em }
        l { display: block }
        l :nth-child(odd) { color: #000; background: #EFF }
        l :nth-child(even) { color: #000; background: #FEE }
       </style>
      </head>
      <body>
       <form method="post" action="/profiles">
        <p>
         <l><label for="forename">Forename:</label>
          <input type="text" id="forename" name="forename"
           size="50" maxlength="50" /></l>
         <l><label for="surname">Surname:</label>
          <input type="text" id="surname" name="surname"
           size="50" maxlength="50" /></l>
         <l><label for="foo">Foo:</label>
          <select id="foo" name="foo">
           <option value="bar">Bar</option>
           <option value="baz">Baz</option>
           <option value="qux">Qux</option>
          </select></l>
         <l><label for="arfle">Arfle:</label>
          <select id="arfle" name="arfle">
           <option value="barfle">Barfle</option>
           <option value="gloop">Gloop</option>
           <option value="glorp">Glorp</option>
          </select></l>
         </p>
        </form>
       </body>
     </html>

As far as the web developer community is concerned, I don't believe 
adapting to use <l> would prove any more challenging than, for example, 
adapting to use <section>.

Thank you,

Dave

P.S. One line of JScript is required to coax current versions of 
Internet Explorer into parsing the tag:

     <!--[if lt IE 8]><script type="text/javascript">
       document.createElement('l');  // Register 'l' element within IE
     </script><![endif]-->



More information about the whatwg mailing list