Skip to main content

Forums

This topic contains 3 replies, has 3 voices, and was last updated by  wolfcry911 2 months, 1 week ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #279879

    jonnow
    Participant

    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?

    Thanks

    #279885

    Paulie_D
    Moderator

    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.

    #279888

    jonnow
    Participant

    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.

    #280006

    wolfcry911
    Participant

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

You must be logged in to reply to this topic.

icon-link icon-logo-star icon-search icon-star