如何使用CSS指定用于HTML元素的框的类型?
使用display属性可以指定用于HTML元素的框的类型。
示例
您可以尝试运行以下代码来实现display属性以显示flex容器。
<!DOCTYPE html><html>
<head>
<style>
.mycontainer {
display: flex;
height: 300px;
background-color: orange;
}
.mycontainer > div {
background-color: white;
text-align: center;
line-height: 90px;
font-size: 40px;
width: 100px;
margin: 50px;
}
</style>
</head>
<body>
<h1>Quiz</h1>
<div class = "mycontainer">
<div>Q1</div>
<div>Q2</div>
<div>Q3</div>
<div style = "align-self: center">Q4</div>
<div>Q5</div>
</div>
</body>
</html>
以上是 如何使用CSS指定用于HTML元素的框的类型? 的全部内容, 来源链接: utcz.com/z/322126.html