RE: [css-background] "background-repeat:round;" and aspect ratio

> Are you willing to specify an explicit size for the image?  If so, then it's
> relatively easy - just use repeat:space rather than round.

For the purposes of the general example, no.

The idea is that you make a page, author a rule, and use an arbitrary image on an arbitrarily sized element and it should "just work".

Are you saying that this use case isn't directly representable in CSS3?

That was the conclusion I had been leaning toward, but I wanted another opinion.

- Brian


> -----Original Message-----
> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
> Sent: Friday, July 16, 2010 3:29 PM
> To: Brian Manthos
> Cc: www-style@w3.org
> Subject: Re: [css-background] "background-repeat:round;" and aspect ratio
> 
> On Fri, Jul 16, 2010 at 1:40 PM, Brian Manthos <brianman@microsoft.com>
> wrote:
> > Tab Atkins:
> >> So, the original aspect ratio is preserved only in a, b, d, and h.
> >
> > Thanks, Tab.  That fairly closely matches my original understanding.
> >
> >
> > Now let's talk about a use case:
> >
> > 1. image is a photo (GIF, JPG, or PNG)
> >
> > 2. image is "huge" (4096x3072)
> >
> > 3. I want to use it as a background
> >
> > 4. I want to tile it in both X and Y dimensions
> >
> > 5. I don't want it clipped
> >
> > 6. I want the aspect ratio preserved
> >
> > 7. Spacing between tiles is optional
> >
> > 8. target element A is 400px wide and 600px tall
> >
> > 9. target element B is 500px wide and 200px tall
> >
> >
> > What background properties should I specify for the rule that will be
> applied to both element A and element B?
> 
> Are you willing to specify an explicit size for the image?  If so, then it's
> relatively easy - just use repeat:space rather than round.
> 
> I really wouldn't recommend using such a huge image for a background,
> though.  Even on broadband, pulling down a 10MB file for a background takes
> a while.
> 
> ~TJ

Received on Friday, 16 July 2010 23:00:35 UTC