c语言直角梯形图案,html – 带有直角梯形的盒子形状

形状不需要额外的元素

可以使用< div&gt ;:::创建形状

>左边是左边的div,top和bottom的边框.

>右边是由…制成的:之前和它的顶部,右边和底部的边界

>加入两个框的跨度是用以下方式创建的:感谢skewY

工作实例 – 只是形状

CSS已被压缩,伪元素的边框样式从div本身继承.

div {

border: solid 4px #000;

border-right-width: 0;

width: 100px;

height: 200px;

position: relative;

}

div:before,div:after {

content: '';

display: block;

height: 100%;

width: 100%;

border: inherit;

border-right-width: 4px;

border-left: none;

position: absolute;

left: 100%;

top: 13px;

margin-left: 20px;

}

div:after {

width: 20px;

border-right: none;

top: 5px;

transform: skewY(40deg);

margin: 0;

}

工作示例 – 带文本

通过上面的例子,内容将不会被包含在整个形状内.相反,它将被限制在div的半宽度内.内容需要包裹在< span>宽度为200%,可以将其打印到divs约束之外.

div {

border: solid 4px #000;

border-right-width: 0;

width: 100px;

height: 200px;

position: relative;

}

div:before,div:after {

content: '';

display: block;

height: 100%;

width: 100%;

border: inherit;

border-right-width: 4px;

border-left: none;

position: absolute;

left: 100%;

top: 13px;

margin-left: 20px;

}

div:after {

width: 20px;

border-right: none;

top: 5px;

transform: skewY(40deg);

margin: 0;

}

span {

width: 200%;

display: block;

padding: 20px 10px 10px;

}

This is me writing a large amount of words into the div. I think that you may want a span in order to contain them.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值