HTML / CSS中的按钮 /网格问题
我对按钮的设置有问题。我不确定是否需要网格系统? 我希望它看起来像这个示例:
“我想要它的示例”
如果有人可以提供帮助,那么汉克斯就在Advanced中!
i have problems with the setup of the buttons. I'm unsure if i need a grid system or not?
I want it to look like this example:
No code yet as i am unsure of where to start, and what to start with.
If somebody can help then hanks in advanced!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以与flex,正当内容,对准目标一起使用,例如以下示例:
You can use with flex, justify-content, align-items like example below:
可以肯定的是,网格可以完美地适合您的设计。但是,您不需要明确的网格来获得该结果。 CSS Flexbox Display(
显示:Flex
)也可以正常工作,也许适合您的需求。甚至显示:块
将起作用。如果您需要仅由行或列组成的Web布局,则FlexBox是最适合使用的模型。但是,如果您有复杂的,多排和多列的布局,则需要使用CSS网格。
请查看更多详细信息:
徽标和用户配置文件)在一个Div内。您可以使用
显示:flex and flex方向:行
在一行中显示它们,josify-content:space-bettent
中间,因此元素填充了整个行。然后您有4个按钮。您可以使用另一个DIV并将
flex方向
设置为列
。根据需要更改DIV和按钮的宽度。基本上,最后一个
div
将与第一个相似。对于每个
div
,您可以指定不同的宽度或高度。for sure a grid would perfectly work for your design. However,you don't explicitly need a grid to obtain that result. Css flexbox display (
display:flex
) would also work and maybe fit your needs. Evendisplay: block
would work.If you need a web layout that only consists of rows or columns, then Flexbox is the best model to use. However, if you have a complex, multi-row and multi-column layout, then you'll want to use CSS Grid.
Have a look for more details: https://www.webdesignerdepot.com/2018/09/grid-vs-flexbox-which-should-you-choose/
Here is a simple set-up for your design with flexbox in mind:
Suppose your first component (logo and user profile) are inside one div. You can use
display:flex and flex-direction: row
to display them in one line, andjustify-content: space-between
so the elements fill the entire row.Then you have 4 buttons. You can use another div and set the
flex-direction
tocolumn
. Change the width of the div and of the buttons as you need.Basically, the last
div
would be similar to the first one.For each
div
you can specify different width or height.