blob: e2983d5b8e7cee0db64ed0a1124da6e995a0b4af (
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CSS Test: Vertical-align applied to an 'inline-block' with 'overflow' not set to 'visible' and baseline alignment</title>
<link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
<link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#leading" title="10.8.1 Leading and half-leading" />
<link rel="match" href="vertical-align-baseline-004a-ref.xht" />
<meta content="ahem image" name="flags" />
<meta content="The baseline of an 'inline-block' whose 'overflow' property has a computed value other than 'visible' is located at its bottom margin edge." name="assert" />
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
<style type="text/css"><![CDATA[
body {margin: 8px;}
p
{
font: 1em/1.25 serif;
margin: 1em 0em;
}
div#wrapper
{
background-color: yellow;
/*
The sole purpose for such yellow background
is to help delimit and visually identify the
content area of the block container box.
*/
color: black;
font: 50px/1 Ahem;
/*
So that 50px / 5 == 10 without remainder;
that way, the accurate position of baseline
does not imply fractional pixel.
Also, the height of the "p" glyph will not
create fractional pixel either.
*/
}
div#inline-block-with-overflow-hidden
{
color: blue;
display: inline-block;
margin-bottom: 99px;
height: 2em;
overflow: hidden;
width: 2em;
}
img
{
position: absolute;
top: 72px;
/*
16px : max(body's margin-top, p's margin-top) == max(8px, 16px)
+
20px : p's first line box height
+
20px : p's second line box height
+
16px : p's margin-bottom
========
72px
*/
}
]]></style>
</head>
<body>
<p>Test passes if the bottom edge of the blue square is flush with the 100px<br />
line and if the top edge of the black stripe is flush with the 200px line.</p>
<div id="wrapper">
<div id="inline-block-with-overflow-hidden">XXX XXX XXX</div><img src="support/ruler-v-100px-200px.png" width="55" height="250" alt="Image download support must be enabled" />pppppppp
</div>
</body>
</html>
|