W3C home > Mailing lists > Public > www-style@w3.org > October 2001

Re: position: fixed [Re: How is it possible to devise such a feeble system?]

From: ValerieGSharp <ValerieGSharp@netscapeonline.co.uk>
Date: Thu, 25 Oct 2001 16:28:22 +0100
Message-ID: <3BD82F96.C498360@netscapeonline.co.uk>
To: www-style@w3.org
Vadim Plessky wrote:

[...]
> Hmmm. Please try example below (it's based on your example, with some
> modifications to improove visual perception)
> I tested it in Opera5/Linux and Mozilla 0.9.1/Linux.
> Neither Opera nor Mozilla could:
> a) center text horizontally
> b) center DIV block vertically
> c) paint background for DIV block in light-gray - rgb (211,211,211)
> d) paint border-top and border-bottom
[...]


WFM - does all of the above - in Opera 5.12 and Mozilla 0.9.5 on
PC/Win98.

There's a, to my mind slightly more useful/general, way of centering
using zero offsets and auto margins:

 #foo {
  position:fixed;
  top:0;
  bottom:0;
  left:0;
  right:0;
  height:20%;
  width:30%;
  margin:auto;
  text-align: center;
  border: 2px solid lime;
  background: rgb(211,211,211);
  color: navy;
}


Hopefully something like the proposal outlined at:

  <http://members.netscapeonline.co.uk/valeriegsharp/W3Cstyles/>

will be adopted, making it possible to use this method to center
vertically (& horizontally) with height (& width) being based on
content.


-- 
Regards,
Val Sharp - Edinburgh
Received on Thursday, 25 October 2001 11:28:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:11 GMT