复杂的Flexbox布局
我总是在flexbox上挣扎。这次也不例外,试图解决这个稳定的小时并阅读许多类似的问题,但是这些都没有给我正确的想法,即如何处理我的布局。我希望你们中的某些人可以帮助我解决如何做到这一点:)
我正在创建一个迷人行者。它所需的外观就像:
目前看起来像这样:
这是我当前的CSS文件:
.MiniPlayer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100px;
display: flex;
flex-direction: row;
img{
width: auto;
height: 90%;
max-height: 100px;
max-width: 100px;
flex-direction: column;
}
.Title{
flex-direction: column;
flex-wrap: wrap;
}
.Name{
flex-direction: column;
flex-wrap: wrap;
}
.MediaButton{
flex-direction: row;
}
.Slider{
flex-direction: column;
flex-wrap: wrap;
flex-grow: 4;
}
I always struggle with flexboxes. This time is no exception trying to solve this for a solid hour and read a lot of similar questions but none of these gave me the right idea on how to do it with my layout. I hope that some of you could help me out with how to do this :)
I'm creating a MiniPlayer. The desired look of it is like that:
At the moment it looks like this:
This is my current css file:
.MiniPlayer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: 100px;
display: flex;
flex-direction: row;
img{
width: auto;
height: 90%;
max-height: 100px;
max-width: 100px;
flex-direction: column;
}
.Title{
flex-direction: column;
flex-wrap: wrap;
}
.Name{
flex-direction: column;
flex-wrap: wrap;
}
.MediaButton{
flex-direction: row;
}
.Slider{
flex-direction: column;
flex-wrap: wrap;
flex-grow: 4;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发现我会按照最初的要求添加
flexbox
解决方案。Figured I would add a
flexbox
solution as initially requested.强烈建议您在
网格
中执行此操作。通过制作许多笨拙的新容器,可以使用网格
拥有更好的布局控件。如果您对
网格
不太满意,则可以使用 css grid Generator < /a>为您完成工作 - 工作正常。Would highly recommend doing this in
grid
. It is possible by making a lot of clumsy new containers, but you have much better layout control withgrid
.If you're not too comfortable with
grid
, you can use a CSS Grid Generator to do the work for you - works just fine.