W3C home > Mailing lists > Public > www-style@w3.org > August 2016

[css-page-floats] float: center?

From: Sam Davidson <samuelryandavidson@gmail.com>
Date: Fri, 22 Jul 2016 20:38:38 +0000
Message-ID: <CALVNz=iPwkTL1LAmuJbB4t=0ZL-M2J4wBp5ipgdpLKzZBQu79A@mail.gmail.com>
To: www-style@w3.org

I'm just learning HTML and CSS, and it strikes me as odd that there is no
float: center command. Intuitively, this would center a box in its
containing element and also cause it to take the width of its contained
text. I'm guessing this question arises out of ignorance, but why doesn't
such a command exist? Perhaps it could be implemented in a future version
of HTML?

I spent some time reading forums, and I found a functional workaround
involving three layers of divs. This seems unnecessarily complex.

Received on Tuesday, 9 August 2016 17:16:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:09:04 UTC