qq_43412960 2019-06-30 15:01 采纳率: 78.6%
浏览 290
已结题

关于HMTL display的一个用法问题

<!DOCTYPE html>




<br> * {<br> margin: 0px;<br> }<br> #bigImg div{<br> display:inline;</p> <p>}<br>

    <div id="bigImg ">
       <div style="background:red;width:100px;height:100px"></div>
        <div style="background:black;width:100px;height:100px"></div> 
        <div style="background:green;width:100px;height:100px"></div>
    </div>


这是我写的所有代码,我想让三个DIV区一行排列,但是失败了,为什么呢?

  • 写回答

5条回答 默认 最新

  • 听楼一夜雨 2019-06-30 15:12
    关注

    把你id里面的空格去掉,,display:inline-block

    <style>
    *{margin: 0px; }
    
    #bigImg div{display:inline-block;}
    </style>
    <body>
    
         <div id="bigImg">
           <div style="background:red;width:100px;height:100px"></div>
            <div style="background:black;width:100px;height:100px"></div> 
            <div style="background:green;width:100px;height:100px"></div>
        </div>
    </body>
    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试