HTML Element Style How to - Make UL/OL two columns








Question

We would like to know how to make UL/OL two columns.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
ul {<!--from   w ww  .ja  v a2s.  c om-->
  columns: 2;
  -webkit-columns: 2;
  -moz-columns: 2;
}
</style>
</head>
<body>
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
    <li>7</li>
  </ul>
</body>
</html>

The code above is rendered as follows: