https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 8c186f666b8dc656b2e7e068046354cc4db79c87 authored by Geoffrey Sneddon on 09 April 2018, 08:12:20 UTC
In HTML documents, always make sure we a body
Tip revision: 8c186f6
percentage-widths-001-ref.html
<!DOCTYPE html>
<link rel="author" title="Google Inc." href="http://www.google.com/">
<style>
body {
  position: relative;
  width: 600px;
  height: 800px;
}

#container {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
}

#top-bar {
  background-color: green;
  width: 100px;
}

#content {
  background-color: blue;
  width: 500px;
}
</style>


<div id="container">
  <div id="top-bar">
  Tests that percentage widths get resolved correctly when the flexbox is
  </div>
  <div id="content">
  absolutely positioned without an explicit width. You should see no red.
  </div>
</div>


back to top