<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<style>
#main {
width: 200px;
height: 200px;
border: 1px solid #c3c3c3;
display: -webkit-flex; /* Safari */
display: flex;
}
#right {
flex: 1;
overflow: auto;
}
p {
margin: 0
}
</style>
</head>
<body>
<div id="main">
<div style="width: 100px; height: 100px; background-color:coral;">A</div>
<div id="right">
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
<p>asadadadasd</p>
</div>
</div>
</body>
</html>
上面可以正常生成左侧固定,右侧滚动的局部
但当我加入
#main {
align-items: center / flex-start / flex-end;
}
右侧滚动区域就会消失而且会溢出
想问下造成这种现象的原因是什么,谢谢!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…