Skip to content

Commit 35c5ca3

Browse files
committed
Add tests for background-size
1 parent 7cc7f80 commit 35c5ca3

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

tests/cases/background/size.html

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Background size tests</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6+
<script type="text/javascript" src="../../test.js"></script>
7+
<style>
8+
.horizontal div, .vertical div {
9+
display: block;
10+
background:url("../../assets/image.jpg") center center;
11+
}
12+
13+
.vertical {
14+
float: right;
15+
}
16+
17+
.horizontal {
18+
float: left;
19+
}
20+
21+
.horizontal div {
22+
width: 400px; height: 200px;
23+
}
24+
25+
.vertical div {
26+
width: 200px; height: 400px;
27+
}
28+
</style>
29+
</head>
30+
<body>
31+
32+
<div class="horizontal">
33+
<div style='background-size: cover;'></div>
34+
<div style='background-size: contain;'></div>
35+
<div style='background-size: auto 100%;'></div>
36+
<div style='background-size: auto;'></div>
37+
</div>
38+
39+
<div class="vertical">
40+
<div style='background-size: cover;'></div>
41+
<div style='background-size: contain;'></div>
42+
<div style='background-size: auto 100%;'></div>
43+
<div style='background-size: auto;'></div>
44+
</div>
45+
46+
</body>
47+
</html>

0 commit comments

Comments
 (0)