mirror of
https://github.com/servo/servo.git
synced 2025-06-11 10:00:18 +00:00
floats, and make float placement idempotent. This moves float placement outside sequential block size computation. Improves the maze solver.
36 lines
661 B
HTML
36 lines
661 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
nav.floaty {
|
|
float: left;
|
|
}
|
|
section {
|
|
clear: both;
|
|
position: relative;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<section>
|
|
<nav>This floats</nav>
|
|
<div>This doesn't</div>
|
|
</section>
|
|
<section>
|
|
<nav>This floats</nav>
|
|
<div style="overflow: hidden;">This is a block formatting context</div>
|
|
</section>
|
|
<section>
|
|
<nav>This floats</nav>
|
|
<div style="position: absolute; top: 0; left: 0; width: 100px; height: 100px;">
|
|
This is abspos
|
|
</div>
|
|
</section>
|
|
<script>
|
|
var elements = document.getElementsByTagName('nav');
|
|
for (var i = 0; i < elements.length; i++)
|
|
elements[i].setAttribute('class', 'floaty');
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|