make part of div border transparent html

后端 未结 2 1605
囚心锁ツ
囚心锁ツ 2021-01-18 05:47

Can I make part (from x1 to x2) of div border transparent?

If not what approach can you advice?

My idea [very bad] is to draw border in canvas element and

2条回答
  •  無奈伤痛
    2021-01-18 06:10

    Since DIVs have only 4 elements (top, bottom, left, right) you can't make part of a border transparent AFAIK.

    However, you could create elements that would overlay your div and use relative positioning to build a border to your taste. For example:

    
    

    You can see the result at http://jsfiddle.net/Bekqu/3/.

提交回复
热议问题