2

Why is the .item element which acts as a table-tow won't be 100% width
of it's parent table-acting element?

Demo page: http://jsbin.com/AdaCUYu/8/edit

HTML

  <form>
    <fieldset>
      <div class="item">
        <label>First Name</label>
        <input />
      </div>
      <div class="item">
        <label>Last Name</label>
        <input />
      </div>
    </fieldset>
  </form>

CSS

fieldset{ 
  border:0;
  padding:0;
  margin:0;
  display:table;
  width:100%;
  border-spacing:10px;
}

.item{ display:table-row; }
  .item > *{ display:table-cell; padding:5px; }
  .item input{ width:100%; }
vsync
  • 118,978
  • 58
  • 307
  • 400

1 Answers1

1

ok, found the problem. Seems like a fieldset element will not work as a table-displayed element.
How strange.

vsync
  • 118,978
  • 58
  • 307
  • 400