summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/CSS2/linebox/vertical-align-118a.xht
blob: 9598cbdd3c9f0bcfd2bdd9350e1146b22fd945a9 (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
<!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: text-top' - line-height</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="Section 10.8.1 Leading and half-leading" />
  <link rel="match" href="vertical-align-118a-ref.xht" />

  <meta content="ahem" name="flags" />
  <meta content="For inline non-replaced elements (such as the span element in this testcase), the box used for vertical-alignment is the box whose height is the 'line-height' (containing the box's glyphs and the half-leading on each side). 'vertical-align: text-top' will align the top of such box with the top of the parent's content area and not with the bottom of the parent's box." name="assert" />

  <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" />
  <style type="text/css"><![CDATA[
  div
  {
  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.
  */
  font: 2.5em/3.25 Ahem;
  /*
  equivalent to font: 40px/130px (with top-half-leading
  and bottom-half-leading each equal to 45px) but
  entirely font-size-relative and perfectly
  text-size-scalable in all browsers
  */
  }

  span
  {
  color: blue;
  margin: auto -1em;
  vertical-align: text-top;
  }
  ]]></style>

 </head>

 <body>

  <p>Test passes if the blue stripe is vertically offset <strong>below the black stripes on both sides</strong>. The blue stripe must be clearly and entirely below the black stripes.</p>

  <div>LLLL<span>MustBeBelow</span>LLLL</div>

 </body>
</html>