27 lines
590 B
HTML
27 lines
590 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>This tests that selection rect does not have gaps inbetween words.</title>
|
|
<style>
|
|
div {
|
|
font-family: monospace;
|
|
font-size: 11px;
|
|
width: 500px;
|
|
white-space: pre-wrap;
|
|
color: white;
|
|
margin-left: -351px;
|
|
}
|
|
|
|
div::selection {
|
|
background: green;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id=target>Inspector doesn't do this. I have been aware of this </div>
|
|
<script>
|
|
var target = document.getElementById("target");
|
|
getSelection().setBaseAndExtent(target.firstChild, 48, target.firstChild, 53);
|
|
</script>
|
|
</body>
|
|
</html> |