1 回答
TA贡献1963条经验 获得超6个赞
如果不改变div结构,只需使用display:gird
.footer {
display: grid;
grid-template-columns: 1fr auto;
}
li {
background-color: yellow;
display: inline-block;
}
.one {
grid-area: 1 / 1 / 3 / 2;
background-color: orange;
}
.two {
grid-area: 1 / 2 / 2 / 3;
}
.three {
grid-area: 2 / 2 / 3 / 3;
}
.two, .three {
background-color: aqua;
text-align: right;
}
.copy {
grid-area: 3 / 1 / 4 / 2;
background-color: blue;
}
<html>
<body>
<footer class="footer">
<div class="one" >
<img src="https://via.placeholder.com/250x100" alt="footer" />
</div>
<div class="two">
<ul>
<li>privacy</li>
<li>terms and conditions</li>
<li>contact us</li>
</ul>
</div>
<div class="three">
<ul>
<li>instagram</li>
<li>facebook</li>
<li>twitter</li>
</div>
<div class="copy">
© 2020 mysite.com
</div>
</footer>
</body>
</html>
- 1 回答
- 0 关注
- 85 浏览
添加回答
举报