html2canvas不识别边框,html2canvas 有些边框无法生成截图

问题描述

使用 html2canvas 截图时,有些边框截不出来

bVbxAGh?w=528&h=199

相关代码

完整测试代码如下

html2canvas

.test {

padding: 5px 1.6mm;

}

.test-row{

border: #000 1px solid;

font-size: 0;

line-height: 0;

width: 32mm;

}

.test-row span{

display: inline-block;

border-right: #000 0.5px solid;

width: 8mm;

height: 8mm;

position: relative;

}

.test-row span.end{

display: block;

width: auto;

height: 2mm;

border-top: #000 0.5px solid;

border-bottom: #000 0.5px solid;

border-right: 0;

font-size: 12px;

text-align: right;

color: #666;

}

.test-row span.end:last-child{

display: none;

}

Capture

function capture () {

console.log('capture')

html2canvas(document.querySelector('.container')).then(canvas => {

document.body.appendChild(canvas)

})

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值