Borders are applied to the box that the element creates in the page, so it will also continue to the edge of any padding you have applied.
If you just want the text underlined, use text-decoration: underline;
Also, your markup is invalid. <ul>
can only contain <li>
as it's immediate children. Move your hyperlinks inside the list elements.
<ul>
<li><a href="www.youtube.com">Menu 1</a></li>
<li><a href="www.youtube.com">Menu 2</a></li>
<li><a href="www.youtube.com">Menu 3</a></li>
<li><a href="www.youtube.com">Menu 4</a></li>
<li><a href="www.youtube.com">Menu 5</a></li>
<li><a href="www.youtube.com">Menu 6</a></li>
<li><a href="www.youtube.com">Menu 7</a></li>
<li><a href="www.youtube.com">Menu 8</a></li>
</ul>