blob: 9dff1b973477b15b1118787e4ad5d213abfb6809 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
<!DOCTYPE html>
<title>min-width: min-content with fixed-width children</title>
<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#sizing-values">
<link rel="help" href="https://www.w3.org/TR/css-sizing-3/#intrinsic-contribution">
<link rel="author" title="Ojan Vafai" href="mailto:ojan@chromium.org">
<link rel="author" title="Elika J. Etemad" href="http://fantasai.inkedblade.net/contact">
<link rel="match" href="../reference/ref-filled-green-100px-square.xht">
<style>
/* Reduce the heights if you want to add more variants. Don't go less than 2px per stripe. */
.screen {
width: 100px;
height: 50px;
background: red;
}
.container {
min-width: min-content;
width: 50px;
height: 25px;
background: url(../support/1x1-red.png) repeat-x green;
}
.child {
width: 100px;
height: 10px;
background: green;
color: transparent;
}
.inline-block .child {
display: inline-block;
}
</style>
<p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
<div class="screen inline-block">
<div class=container>
<div class=child>x</div>
</div>
<div class=container>
<div class=child>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div>
</div>
<div class="screen block">
<div class=container>
<div class=child>x</div>
</div>
<div class=container>
<div class=child>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</div>
</div>
</div>
|