Hide part of a border in CSS?

前端 未结 3 1480
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-17 23:54

I have a few simple CSS classes for a panel with a header. It works great when the background is a fixed color because I have to use that color to hide the border behind the

3条回答
  •  一生所求
    2021-01-18 00:36

    here's the sample of what you need:

    Firs of all, you need a container div with your Background (i've grabbed one from internet for this example).

    After this, you need to use and snippets from HTML.

    Your CSS

    div {
        padding: 30px;
        background: url(https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSkAuRoZnkLBZlEYtgL5GJ5w_2Tufpxh5PqkOf-Negy7eL-JGC5Mk-DW-I) no-repeat  center center;
        background-size: cover;
    }
    
    fieldset {
        border: 2px solid black;
        padding: 10px;
    }
    

    Your HTML

    Personalia:

    some text here

    Here you can see the Fiddle

提交回复
热议问题