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

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 UTC