html margin-left调节边框

img

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul li {
            float: left;
            list-style: none;
            width: 200px;
            height: 300px;
            border: 1px solid red;
            margin-left: -1px;
            /* background-color: skyblue; */
        }
    </style>
</head>

<body>
    <ul>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>  
    </ul>
</body>
</html>

为啥会有一个边框还是2px 大小?
有没有解决方法?


<!DOCTYPE html>
<html lang="en">
 
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        ul{
            overflow: hidden;
            border: 1px solid red;
            display: inline-block;
            border-right: none;
        }
        ul li {
            float: left;
            list-style: none;
            width: 200px;
            height: 300px;
            border-right: 1px solid red;
            /* background-color: skyblue; */
        }
    </style>
</head>
 
<body>
    <ul>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>
        <li>1</li>  
    </ul>
</body>
</html>

可能就是显示的问题