黑松山资源网 Design By www.paidiu.com
【内容】:
1. 利用background-image 渐变样式
2.可以利用scale缩放
3.给伪元素设置边框
在这里插入代码片<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>0.5px线实现方法</title> <style type="text/css"> /*标准1px边框*/ .b1{ height: 40px; border: 1px solid #ff0000; } /*1.可以利用利用渐变样式=>实现.5px*/ .a1{ height: 1px; margin-top: 20px; background-image: linear-gradient(0deg, #f00 50%, transparent 50%); } /*2.可以利用缩放-发虚=>实现.5px*/ .a2{ height: 1px; margin-top: 20px; background-color: #f00; -webkit-transform: scaleY(.5); transform:scaleY(.5); } /*3.四条边框都需要的样式*/ .scale-half { margin-top: 20px; height: 100px; border:1px solid #f00; -webkit-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: scale(.5, .5); transform: scale(.5, .5); } /*4.给伪元素添加设置边框*/ .border3{ position: relative; } .border3:before{ content: ''; position: absolute; width: 200%; height: 200%; border: 1px solid blue; -webkit-transform-origin: 0 0; -moz-transform-origin: 0 0; -ms-transform-origin: 0 0; -o-transform-origin: 0 0; transform-origin: 0 0; -webkit-transform: scale(.5, .5); -ms-transform: scale(.5, .5); -o-transform: scale(.5, .5); transform: scale(.5, .5); -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } </style> </head> <body> <div class="b1">正常1px边框</div> <div class="a1"></div> <div class="a2"></div> <div class="scale-half"></div> <div class="border3"> <div class="content">伪类设置的边框</div> </div> </body> </html>
黑松山资源网 Design By www.paidiu.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
黑松山资源网 Design By www.paidiu.com
暂无评论...
更新日志
2024年09月20日
2024年09月20日
- 《战锤40K星际战士2》卡在正在加入服务器解决方法
- 《勇者斗恶龙怪物仙境3》玩法内容介绍
- 《幸福工厂》无限报错解决方法
- 交错战线原始交易所推荐角色一览
- 战锤40K星际战士2战术职业介绍|战术职业技能效果一览
- 战锤40K星际战士2突击职业介绍|突击职业技能效果一览
- [妙音金曲]群星《悲情咖啡屋》(黑胶)2CD[DTS-WAV]
- 阿兰·达瓦卓玛《A-Lan阿兰唯美歌姬》2CD[DTS-WAV]
- 【小提琴】陈立新《思乡曲》2004[FLAC+CUE]
- 《战地》新作明年初大规模测试!EA已内部测试一年
- 《GTAOL》PC版时隔多年更新反作弊!小助手宣布跑路
- EA称AI是其业务核心!能提高开发效率、节约成本
- 卫华.1990-太阳升【BMG】【WAV+CUE】
- 呼吸乐队.1992-THEBREATHING【深飞】【WAV+CUE】
- 李玟.2008-1994-2008豪华典藏精选2CD【SONY】【WAV+CUE】