所以我有简单的 ul 列表。我应该怎么做才能让 li 保持 ul 的 100% 宽度?请帮忙!我尝试使用 flex-basis 和 flex-drow 但没有帮助。而且它也应该在纯 CSS 中完成。
body{
margin: 0px;
height: 100%;
}
.container{
display: flex;
}
.navigation{
display: flex;
flex-direction: column;
text-align: center;
width: 20vh;
height: 100vh;
text-align:justify;
}
ul li{
border: 1px solid blue;
position: relative;
list-style-type: none;
text-align: center;
}
ul{
border: 1px solid blue;
height: 60vh;
display: flex;
flex-direction: column;
}
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>title</title>
<link rel="stylesheet" type="text/css" href="style2.css">
</head>
<body>
<div class="contaniner first">
<div class="navigation">
<ul>
<li>1</li>
<li>2</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</div>
</div>
</html>
一只斗牛犬
慕工程0101907
largeQ
慕斯709654
相关分类