如何一起使用浮点数和边距

时间:2015-10-23 08:35:38

标签: html css

我想为class='middle'提供背景颜色,lmiddle也是rmiddlediv的背景颜色,<div class="middle"> <div class="lmiddle"> <h2>heading is here ???</h2> <p>something is here...something is here... something is here...something is here... something is here...something is </p> </div> <div class="rmiddle"> <img src="dog_03.png" /> </div> </div> 应该水平对齐。

我无法解决这个问题。请帮帮我。

<?    $count=$count+1;     

1 个答案:

答案 0 :(得分:0)

用于样式使用此

<style type="text/css">
        .lmiddle, .rmiddle{
            width:50%;
            border:thin solid #ccc;
            position:absolute;
            top:0;
            background:transparent;
        }
        .rmiddle{
            right:0;
        }
        .lmiddle{
            left:0;
        }
    </style>   

并在代码末尾添加一个结束div

<div class="middle">
  <div class="lmiddle">
      <h2>heading is here ???</h2>
          <p>something is here...something is here...
              something is here...something is here...
              something is here...something is
          </p>
  </div>
  <div class="rmiddle">
      <img src="dog_03.png" />  
  </div>
</div>