2
A
回答
2
试试这个
.parent {
width: 150px;
height: 150px;
background: yellow;
text-align: center;
}
.flex {
display: inline-flex;
margin: auto;
justify-content: center;
background: blue;
}
相关问题
- 1. 将“Position:fixed”div的宽度设置为父div(flexbox项目)
- 2. Flexbox布局。无法将相框的宽度设置为
- 3. 如何将div宽度设置为100%
- 4. 如何将p:carousel宽度设置为100%?
- 5. 如何将宽度设置为auto + 5px?
- 6. 如何将div宽度设置为表格的宽度?
- 7. 如何将DataTemplate的宽度设置为Listbox的宽度?
- 8. 如何将Primefaces-Carousel的宽度设置为整页宽度?
- 9. 如何将表格的宽度设置为窗口的宽度
- 10. 将高度和宽度设置为img
- 11. 如何设置UITableView tableHeaderView的宽度将比UITableView宽度更宽?
- 12. 如何将图像宽度设置为100%,高度自动设置为原生?
- 13. GWT htmlDialogBox:如何将大小设置为更宽的宽度
- 14. 如何将ToggleButton宽度设置为更宽的textOn和textOff值?
- 15. 如何将datagridview的行/列宽设置为datagridview的宽度?
- 16. 如何将背景设置为100%宽度,同时将文本内的文字设置为其他宽度?
- 17. 如何将Android文本框设置为仅占用XML总宽度的60%?
- 18. 如何将宽度和高度设置为可拖动图像?
- 19. 如何设置宽度为100%,在WPF
- 20. 如何设置格宽度为div的
- 21. 如何设置宽度为LISTBOX列?
- 22. 如何设置宽度为100%
- 23. 如何设置QWidget宽度?
- 24. 如何设置宽度CKEDITOR
- 25. 如何设置宽度H:selectOneRadio
- 26. 如何设置blankText宽度?
- 27. 如何设置BarChartDataSet宽度
- 28. 将JTabbedPane的宽度设置为常量
- 29. 将固定宽度设置为Nivo Slider
- 30. 将td的宽度设置为auto?
尝试'直列flex' –