【问题标题】:Fit boxes side-by-side with css and html将盒子与 css 和 html 并排放置
【发布时间】:2018-06-10 22:27:31
【问题描述】:

我有一个项目,我想并排显示 8 个文章框。 它应该看起来像 this 我目前只有第一个盒子,当我尝试添加其他盒子时,它们不会像第一个一样留在同一个空间,我将如何做到这一点?我想将它们并排添加,就像提供的图片一样。

【问题讨论】:

    标签: html css


    【解决方案1】:

    我不是 css 专家,但您可以从以下内容开始:

    <div style='width:100%'>
    
    <div style='float:left;width:25%'>content 1</div>
    
    <div style='float:left;width:25%'>content 2</div>
    
    <div style='float:left;width:25%'>content 3</div>
    
    <div style='float:left;width:25%'>content 4</div>
    
    </div>
    

    将您的容器 div 分配 25 % - 4 倍。

    【讨论】:

      猜你喜欢
      • 2017-02-03
      • 2020-08-21
      • 2021-07-01
      • 2015-11-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-03
      • 1970-01-01
      相关资源
      最近更新 更多