W3C home > Mailing lists > Public > www-svg@w3.org > November 2013

Re: Automatic centering and positioning

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 7 Nov 2013 14:51:11 -0800
Message-ID: <CAAWBYDD_WuVB1GBj+h=ddb1GEX=+p9_qrKXTZWV+zxEJ1ve1bQ@mail.gmail.com>
To: Paul LeBeau <paul.lebeau@gmail.com>
Cc: www-svg <www-svg@w3.org>
On Thu, Nov 7, 2013 at 2:27 PM, Paul LeBeau <paul.lebeau@gmail.com> wrote:
> Hi all
>
> I have spent a bit of time on Stack Overflow lately, answering questions on
> SVG.  It seems a very common use case that people want to centre elements
> inside other elements.  For example, text in a circle, image in a box.
>
> I have been wondering if this use case has been discussed before and whether
> there were any previous proposals or interest in adding some sort of feature
> that can automatically position elements with respect to a box or other
> element.
>
> Obviously you can achieve some control with child <svg>s and the text
> baseline properties, but these can be hard to use and can require manual
> tweaking.  Something automatic would be nice.
>
> I had an idea or two about how you could do this, but wanted to check
> whether other people agree it would be desirable (or not).

The right way is to continue integrating SVG with CSS more completely,
allow elements to be nested (already proposed by Doug), and then allow
things to switch into other layout modes.  CSS has centering and
positioning primitives; reinventing in SVG would be a bad time.

~TJ
Received on Thursday, 7 November 2013 22:51:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:54:47 UTC