Skip to content

Since line-height: 1.15 is set for html, vertical scrollbars appear on the table wrapper element #783

@baooab

Description

@baooab

As described in the title,here show the code I'm using.

<style>
.table-wrapper {
  overflow: auto;
}

.table {
  border-collapse: collapse;
}
</style>

<div class="table-wrapper">
  <table class="table">
    <thead>
    <tr>
        <th>#</th>
        <th>Heading</th>
        ...
      </tr>
    </thead>
    <tbody>
      <tr>
        <th>1</th>
        <td>Cell</td>
        ...
      </tr>
      ...
    </tbody>
  </table>
</div>

Online demo: https://codepen.io/zhangbao/pen/mYeNzb

To my surprise, unexpected vertical scroll bars appear on the table wrapper element.

I found that because normalize.css sets the line-height: 1.15 for html, and if I set the line-height to a value of 1.2 or greater, the vertical scrollbar disappears.

I want to know what the reason is, thank you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions