首页 新闻 会员 周边

学习vue+elementUi 在 初步学习布局 不知道为什么 <el-aside> 有margin 谢谢各位大佬 代码如下:

0
悬赏园豆:100 [已解决问题] 解决于 2019-01-25 17:22

<template>
<el-container>
<el-header>Header</el-header>
<el-container>
<el-aside width="200px">Aside</el-aside>
<el-main>Main</el-main>
</el-container>
</el-container>
</template>

<style scoped>
.el-header,
.el-footer {
background-color: #b3c0d1;
color: #333;
text-align: center;
line-height: 60px;
}

.el-aside {
background-color: #d3dce6;
color: #333;
text-align: center;
line-height: 200px;
}

.el-main {
background-color: #e9eef3;
color: #333;
text-align: center;
line-height: 160px;
}

body > .el-container {
margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
line-height: 320px;
}
</style>

Lzhan的主页 Lzhan | 初学一级 | 园豆:14
提问于:2019-01-25 17:01
< >
分享
最佳答案
-1

不是margin吧,是aside是一个块级元素,它会独占一行,后面不会有其他元素;
自然main就掉下去了;
你可以给个浮动试试float:left试试

收获园豆:100
你风致 | 老鸟四级 |园豆:2213 | 2019-01-25 17:11

感谢

Lzhan | 园豆:14 (初学一级) | 2019-01-25 17:27
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册