How can I get multiple borders with rounded corners? CSS

前端 未结 8 1044
天涯浪人
天涯浪人 2020-12-19 08:03

Any idea on how I can get round corners work with multiple borders? The box will be dynamic, depending what will be inputed into the box, so I can\'t add static width or hei

8条回答
  •  南方客
    南方客 (楼主)
    2020-12-19 08:55

    The only CSS solution I can offer is limited to a double border, with the space between those borders the same colour as the background of the bordered element, for example the html:

    Some content

    Coupled to the css:

    #box {
        border: 10px double #f90;
        border-radius: 1.5em;
        padding: 1em;
        color: #000;
        background-color: #ffa;
    }
    

    Gives a JS Fiddle demo...

提交回复
热议问题