Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-text/white-space/text-wrap-balance-word-spacing-001.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>CSS Text level 4 Test: text-wrap-style should account for word-spacing</title>
<link rel="author" title="Yulun Wu">
<link rel="match" href="reference/text-wrap-balance-word-spacing-001-ref.html">
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body {
font-family: "Ahem";
font-size: 12px;
width: 500px;
}
.spacing-10-balance {
word-spacing: 10px;
text-wrap-style: balance;
}
.spacing-30-balance {
word-spacing: 30px;
text-wrap-style: balance;
}
.spacing-30 {
word-spacing: 30px;
}
.balance-first-line-spacing-30 {
text-wrap-style: balance;
}
.balance-first-line-spacing-30::first-line {
word-spacing: 30px;
}
.img1 {
background-color: green;
width: 20px;
height: 10px;
}
</style>
</head>
<body>
<div class="spacing-10-balance">This passes if this div is one line </div>
<div class="spacing-30-balance">This passes if this div has the exact correct breaking points</div>
<div class="spacing-30">This passes if this div has the exact correct breaking points</div>
<div class="balance-first-line-spacing-30">This passes if this div has the exact correct breaking points</div>
<div class="spacing-30-balance">test<img class="img1">test <img class="img1"> test</div>
</body>
</html>