Adjust li width fit with ul width of the outer div/body

HTML:-

CSS:-

JavaScript:-