Search code examples
javascripthtmlcssdhtml

How to remove above and below spaces in Order list


<html>
<body>

sdadfasdf a
<ol>
  <li>Coffee</li>
  <li>Tea</li>
  <li>Milk</li>
</ol>
asfdasdfasdfadf

</body>
</html>

Output is

sdadfasdf a

  1. Coffee
  2. Tea
  3. Milk

asfdasdfasdfadf

How to remove above and below spaces in Order list


Solution

  • Using css:

    ol  {
      margin-top: 0px;
      margin-bottom: 0px;
      padding-top: 0px;
      padding-bottom: 0px;
    }