php画梯形,利用css来画出各种样式不同的梯形,html中梯形外框怎么做

利用css来画出各种样式不同的梯形利用钢性铸铁来画出各种样式不同的梯形,

c346445b56cf8bbd1491df1758d65d4c.png

首先我们要知道一下四个非常重要的样式:

(学习视频分享:css视频教程

border-buttom:设置下边框

border-top:

边框-左侧:

右边框:

div class=’mask’/div.mask

{

高度:0;

宽度: 100 px

border-top: 100px固体红色;

右边框: 37px固体透明;

}

24144b2ee65f0a3ea39c0cf123986d88.png。面具

{

宽度宽度:100px

高度:0

边框-宽度宽度:0 37px 100px 37px

边框样式:无实体实心;

边框颜色:透明透明红色;

}

f266e745003766dd965b17d3ae08dca1.png。面具

{

宽度宽度:100px

高度:0

border-top: 100px固体红色;

右边框: 37px固体透明;

边框-左侧:37像素固体透明;

}

7f9af0674bef2c5add37332fcd5b548b.png。面具

{

宽度宽度:100px

高度:0

边框-顶部:100像素固体红色;

边框-左侧:37像素固体透明;

}

b0ee505769af7bb96ebbd4c2efdf4708.png

还有一些奇怪的图形自己开发去。面具

{

宽度宽度:100px

高度:0

边框-底部:100像素固体红色;

边框-左侧:37像素固体透明;

左边距-:-30px;

}

6dea0b749c133d00b29f1512f2ce64f7.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,我分别为您回答如下: 1. HTML CSS 五角星 HTML结构: ```html <div class="star"></div> ``` CSS样式: ```css .star { width: 0; height: 0; border-right: 50px solid transparent; border-bottom: 35px solid #f1c40f; border-left: 50px solid transparent; position: relative; top: -10px; } .star:before { content: ""; width: 0; height: 0; border-right: 50px solid transparent; border-bottom: 35px solid #f1c40f; border-left: 50px solid transparent; position: absolute; top: -25px; left: -50px; transform: rotate(35deg); } .star:after { content: ""; width: 0; height: 0; border-right: 50px solid transparent; border-bottom: 35px solid #f1c40f; border-left: 50px solid transparent; position: absolute; top: -25px; left: 0; transform: rotate(-35deg); } ``` 2. CSS 梯形 HTML结构: ```html <div class="trapezoid"></div> ``` CSS样式: ```css .trapezoid { border-bottom: 100px solid #f1c40f; border-left: 50px solid transparent; border-right: 50px solid transparent; height: 0; width: 100px; } ``` 3. CSS 六角星 HTML结构: ```html <div class="hexastar"></div> ``` CSS样式: ```css .hexastar { width: 0; height: 0; border-bottom: 50px solid #f1c40f; border-left: 29px solid transparent; border-right: 29px solid transparent; position: relative; } .hexastar:before { content: ""; width: 0; height: 0; border-top: 50px solid #f1c40f; border-left: 29px solid transparent; border-right: 29px solid transparent; position: absolute; top: -50px; left: -29px; } ``` 4. CSS 六边形 HTML结构: ```html <div class="hexagon"></div> ``` CSS样式: ```css .hexagon { width: 100px; height: 55px; background-color: #f1c40f; position: relative; } .hexagon:before, .hexagon:after { content: ""; position: absolute; z-index: 1; width: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; } .hexagon:before { bottom: 100%; border-bottom: 28px solid #f1c40f; } .hexagon:after { top: 100%; width: 0; border-top: 28px solid #f1c40f; } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值