Join the Webstudio community

Updated 3 months ago

Non-generic border style

At a glance
does anyone have any good resources for border/outline styles outside of the generic MDN docs ridge/outset/dotted etc?
B
B
J
10 comments
Do you have anything specific in mind?
like frills or clouds or like these
Attachments
fancy-frame-ii.png
image-with-corner-frame.png
full-screen-vintage-frame-with-multiple-borders.png
All of these could be done multiple ways.

If I was coding these by hand, I would use ::before/::after pseudo-elements. With Webstudio I create a box and place it absolutely relative to the parent and then make sure to add aria-hidden=true to it.

For the vintage item, you'll need an svg or image.

For the pink background, you could set widths of higher than 100% on your pseudo-elements and use negative margins. They could be simple boxes with 1px height.
thank you for responding.

is there any chance you could record a short video of this to cement the understanding of the process? i think a visual of the process would help with the understanding
This one takes seconds to create. The others are using the exact same ideas.
thank you for taking the time to record this for me.

i've tried to replicate this and this is what i got. can you tell me what i'm doing wrong?

https://p-50ca6901-3156-458b-9c60-a57970bec113.apps.webstudio.is/?authToken=bc7979af-b230-4631-99f9-202738b83bc2&mode=preview
  1. The image shouldn't have a fixed width of 500px.
  2. Add a width to the parent box, preferably using responsive units or within a flex or grid column.
    a. test with width 500px on the parent box, and auto left/right margins to center. You should be able to see what you need.
  3. The "after" box needs a negative margin on the right/bottom.
thank you for responding.

so i've managed to emulate what you did thanks to the added tips, but the image element doesn't have the same size as yours does.

in your video, you had the image set to 500px and max-width of 100%, but after i removed the 500px, it just remains a small square.

https://p-50ca6901-3156-458b-9c60-a57970bec113.apps.webstudio.is/?authToken=bc7979af-b230-4631-99f9-202738b83bc2&mode=preview
Attachment
image.png
I just put an arbitrary size. I wouldn't put a width on something in reality. I would put it within a container and set the image to full width of that. Then I'd possible setup an aspect ratio or object fill on there depending on what the image is.

The purpose of the demo was conceptual, it will have to be adapted for whatever your use-case is.
got it! i'll play around with the positionings and make something work.

thank you again for the time and resources you put in! πŸ‘πŸΎ
Add a reply
Sign up and join the conversation on Discord