Your solution (positioning the background div) is the most efficient way that you are going to work in CSS, because the forms are not recognized by the browser as shapes.
You can take a square, make copies and rotate them to make a dot splash, and it looks like a dot splash, but with respect to the browser you have 3 squares, not a dot splash, and if you put a border, the borders will be around each square.
You can make small rectangles, rotate them and place them around the edges of your “shape” to create a “border”, so yes, it is doable, but for all practical purposes it is crazy.
If you need to draw shapes on the fly, take a look at the HTML5 canvas . Introduction to drawing a canvas .
SVG is now also a valid option since all recent browsers support it .
Sylverdrag
source share