[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#357019: Nonstandard centering of absolutely positioned boxes



Package: konqueror
Version: 4:3.3.2-1sarge1

Test Case:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">

<head>
  <title>
    Faulty Centering
  </title>
  <style>
    body {
      color: white;
      background: black;
      padding: 0;
    }
    div {
      position: absolute;
      top: 0px;
      right: 0px;
      bottom: 0px;
      left: 0px;
      color: black;
      background: white;
      margin: auto;
      width: 640px;
      height: 400px;
    }
  </style>
</head>

<body>
  <div>
    Fully centered white box with important information...
  </div>
</body>

</html>

If the browser window is large enought, one gets a fully centered white
box with text on black background.  If one resizes the window until the
box does not fit anymore (reload necessary), parts of the box get
inaccessible and the text gets lost.  The left/top margin must not get
negative so that the white box stays left and/or top aligned (cf. CSS 2.1,
10.3.7 and 10.6.4: If none of the three is 'auto'...).  Firefox does this
correctly.

Cheers, Jens



Reply to: