The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Alternative to image background for a grid-look-alike

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #238076

    Dear all,

    I’m wondering if there is another alternative to the background-image with transparent PNG?

    As you can see on this website,

    they use a PNG image repetition to make this grid, I try to achieve the same but without an image, I was wondering if there is a way to do this with only code, as such as SVG? Wonder if it make the website slightly faster if the browser doesn’t load the image and repeat it.

    Thanks for your opinion.

    EDIT: I also think that as a matter of responsiveness, it doesn’t look good, and on retina screen, the PNG looks also blurry…


    Use an SVG image.

    A small repeating image would probably be most performant.


    Totally, embedded SVGs in data-URIs is a thing. Certainly for those geometric patterns, like in the example you linked to; see also this example.


    Thank you guys for your reply, meanwhile a friend told me about this technic, what do you think would be the best? my grid is something like squarish, 130×130 pixel, with a solid black border of 4px.


    For this I think a SVG data URI would be best, for it could be smaller in size, and easier to maintain. Maybe also less taxing on the browser-rendering, and therefor more performant.


    I see, thank you I will try with the SVG data URI, it’s something new to me but as you said it seems to be the best solution so far.

    Thank you again!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.