How to remove above and below spaces in the order list

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

Output

sdadfasdf a

  • Coffee
  • Tea
  • Milk

asfdasdfasdfadf

How to remove above and below spaces in the order list

+4
source share
3 answers

Using css:

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

remove padding and margins:

 ol { margin: 0; } 
+3
source

Since each browser usually adds paddings, borders, and default fields for all tags, try css:

 html,body,div,p,h1,h2,h3,h4,h5,h6,address,blockquote,code, ul,ol,li,dt,dl,dd,form,fieldset,hr,table,caption,tr,tbody, td,tfoot,th,thead,img,object,sub,sup,big,small { margin: 0; padding: 0; border: 0; } 

This should reset everything to 0, including spaces. And you can move and place your elements with your own rules and laws.

+2
source

All Articles