2017-01-05

CSS - Mixing fixed and percentage widths


<style>
  .comment {
    position: relative;
    padding-left: 100px;
  }
  .comment-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    border: 1px solid blue;
  }
  .comment-right {
    width: 100%;
    float: left;
    border: 1px solid red
  }
</style>


<div class="comment">

  <div class="comment-left">
    something
  </div>

  <div class="comment-right">
    something else
  </div>

</div>

No comments:

Post a Comment