Give help. Get help.

  • # December 5, 2018 at 3:13 am

    Is a CSS method of achieving a border around two elements placed on top of each other to give the effect of a single shape?

    Example on CodePen

    So in the example, turning the red border on the div and span in a single shape, losing the border that falls inside the div area. Could shape-outline be used?


    # December 5, 2018 at 8:17 am

    No, there isn’t.

    HTML objects are rectangular and borders (and outlines) follow those shapes.

    You might be a manage something with a clip-path or, for all practical purposes, in this case I’d use an SVG shape.

    # December 5, 2018 at 8:30 am

    Thanks, yeah an SVG shape does seem the way to go. Clip-path won’t give a border around the clipped shape as far as I can see, it applies the border to the div/element.

    # December 8, 2018 at 5:35 pm

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.