Attach images on all four corner of DIV

后端 未结 3 813
日久生厌
日久生厌 2020-12-22 00:10

I have a DIV which has a red dotted border all around: \"blank

HTML for the DIV:

    <         


        
3条回答
  •  滥情空心
    2020-12-22 00:35

    You can do this with background images, without creating extra elements.

    See this fiddle.

    .cert {
      min-width: 212;
      min-height: 166;
      background: 
        url(http://i.stack.imgur.com/ghI7u.png) left -106px top -83px no-repeat, 
        url(http://i.stack.imgur.com/ghI7u.png) right -106px top -83px no-repeat, 
        url(http://i.stack.imgur.com/ghI7u.png) left -106px bottom -83px no-repeat, 
        url(http://i.stack.imgur.com/ghI7u.png) right -106px bottom -83px no-repeat, 
        white;
      padding: 40px;
    }
    

    Also, you can combine the four corner images for faster downloads:

    combined border images

提交回复
热议问题