使用CSS垂直设置flex项目
要垂直设置弹性项目,请使用flex-direction属性。您可以尝试运行以下代码以垂直显示弹性项目
示例
<!DOCTYPE html>
<html>
<head>
<style>
.mycontainer {
display: flex;
flex-direction: column;
background-color: orange;
}
.mycontainer > div {
background-color: white;
text-align: center;
line-height: 40px;
font-size: 25px;
width: 100px;
margin: 5px;
}
</style>
</head>
<body>
<h1>Quiz</h1>
<div class = "mycontainer">
<div>Q1</div>
<div>Q2</div>
<div>Q3</div>
<div>Q4</div>
<div>Q5</div>
<div>Q6</div>
</div>
</body>
</html>热门推荐
10 科研文案祝福语简短励志
11 红包祝福语简短网名
12 2026猪年祝福语简短语
13 哥哥中考加油祝福语简短
14 生日祝福语贺卡老师简短
15 给医生简短新年祝福语
16 五二零朋友祝福语大全简短
17 祝福语女友文案简短霸气
18 枣庄人事考试祝福语简短