Center floated child DIVs in a parent DIV that has fluid width

后端 未结 5 2003
闹比i
闹比i 2021-01-29 06:05

I have the following HTML:

Box1
Box2
5条回答
  •  隐瞒了意图╮
    2021-01-29 06:16

    If your parent element doesn't have a fixed width you can't center his child elements with only CSS. I think you have to write some script that calculate the parent width, every row width and set to them the properly margin-right and margin-left.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题