HTML   发布时间:2022-04-14  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了html – 用边框制作切角大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我想在html中创建一个具有截断角和形状边界线的形状.

我可以制作没有边框的截断形状,如下所示:

HTML

@H_450_6@<div class="cut-off"></div>

CSS:

@H_450_6@.cut-off{ position:relative; top:400px; left:400px; height:155px; width:200px; BACkground:red; } .cut-off:after{ position:absolute; bottom:0px; right:-20px; content:"."; text-indent:-999px; overflow:hidden; display:block; width:0px; height:0px; border-top: 20px solid green; border-right: 20px solid transparent; } .cut-off:before{ position:absolute; top:0; right:-20px; content:"#"; text-indent:-999px; overflow:hidden; display:block; BACkground:blue; width:20px; height:135px; }

Jfiddle here

现在我想要一个围绕形状的边框.
我该怎么做?

我想要一个像这样的形状:

充满了色彩.

解决方法

通过改变你的html结构,我可以制作 this @H_450_6@<div class="cut-off"></div> <div class="cut-off2"></div>​ .cut-off{ position: relative; width: 300px; height: 150px; border-bottom: 80px red solid; border-right: 80px transparent solid; } .cut-off2{ position: absolute; z-index: -1; top:0; left: 0; width: 305px; height: 150px; border-bottom: 82px blue solid; border-right: 80px transparent solid; } p{ position: absolute; left: 0; bottom:-40px; }

基本上它在现有的div下增加了另一个div.对于切割效果,它使用边框尺寸.

编辑:我还提供了一种在该地区包含内容的方式.

大佬总结

以上是大佬教程为你收集整理的html – 用边框制作切角全部内容,希望文章能够帮你解决html – 用边框制作切角所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。