зеркало из https://github.com/mozilla/gecko-dev.git
12 строки
355 B
HTML
12 строки
355 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
The green square below should be centered.
|
|
<div style="width: 400px; height: 400px; position: absolute;
|
|
perspective: 600px; left: 50%; top: 50%; background: green;">
|
|
</div>
|
|
<script>
|
|
document.body.offsetWidth;
|
|
document.querySelector("div").style.transform = "translate(-50%, -50%)";
|
|
</script>
|
|
</html>
|