Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<title>Flex items and `position: relative`</title>
<link rel="author" title="Martin Robinson" href="mailto:mrobinson@igalia.com">
<meta name="assert"
content="Flex items can be positioned with `position: relative` and establish containing blocks for absolutely-positioned descendants." />
<style>
body {
margin: 0;
}
</style>
<div style="position: absolute; background: green; width: 50px; height: 50px; left: 50px; top: 50px"></div>
<div style="position: absolute; background: green; width: 50px; height:50px; left: 100px; top: 100px"></div>