Just make the <li>
relatively positioned, rather than the <ul>
. Then you can set the submenu to be top: 0
and also left: 100%
rather than setting a pixel value.
.box ul li {
margin-bottom:1px;
position: relative;
}
.box ul li ul {
position:absolute;
left:100%;
top: 0;
margin-left: 1px; /* Styling */
}