<template> 中的代码:
<template>
<div class="chart-box">
<div class="item-box">A</div>
<div class="item-box">B</div>
<div class="item-box">C</div>
</div>
</template><style> 中的代码:
.chart-box {
display: flex;
justify-content: space-around;
.item-box {
width: 100px;
height: 100px;
text-align: center;
line-height: 100px;
}
.chart-box div:nth-child(1) {
background-color: lightgreen;
}
.chart-box div:nth-child(2) {
background-color: lightskyblue;
}
.chart-box div:nth-child(3) {
background-color: lightcoral;
}
}
该文章展示了一个HTML模板,其中包含一个使用CSSflex布局的示例。`.chart-box`是一个flex容器,其子元素`.item-box`以等间距排列。每个`.item-box`有固定宽度和高度,并用不同颜色(lightgreen,lightskyblue,lightcoral)区分背景。

896

被折叠的 条评论
为什么被折叠?



