Last active
January 3, 2023 01:24
-
-
Save MurakamiShinyu/265968c3bab8146028e6e345b9b7bb95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Check devicePixelRatio</title> | |
<script> | |
window.onload = () => { | |
devicePixelRatioValue.textContent = window.devicePixelRatio; | |
actualBorderWidthValue.textContent = testBorder.getBoundingClientRect().height; | |
}; | |
</script> | |
<style> | |
#testBorder { border-top: 0.001px solid; } | |
</style> | |
</head> | |
<body> | |
<p>window.devicePixelRatio: <span id="devicePixelRatioValue"></span></p> | |
<p>A very thin border (#testBorder { border-top: 0.001px solid; }):</p> | |
<div id="testBorder"></div> | |
<p>testBorder.getBoundingClientRect().height: <span id="actualBorderWidthValue"></span></p> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment