前端记录css js

微信小程序,居于页面底端

.add-people-operator {

width: 100%;

position: fixed;

bottom: 1rpx;

}

水平居中

text-align: center;

垂直居中:

line-height:多少px;

字体:

font-family:'隶书';

字体间距:

letter-spacing:-3px;

 

//下载Base64图片方法

downloadFile(content, fileName) {

var base64ToBlob = function(code) {

let parts = code.split(';base64,');

let contentType = parts[0].split(':')[1];

let raw = window.atob(parts[1]);

let rawLength = raw.length;

let uInt8Array = new Uint8Array(rawLength);

for(let i = 0; i < rawLength; ++i) {

uInt8Array[i] = raw.charCodeAt(i);

}

return new Blob([uInt8Array], {

type: contentType

});

};

let aLink = document.createElement('a');

let blob = base64ToBlob(content); //new Blob([content]);

let evt = document.createEvent("HTMLEvents");

evt.initEvent("click", true, true); //initEvent 不加后两个参数在FF下会报错 事件类型,是否冒泡,是否阻止浏览器的默认行为

aLink.download = fileName;

aLink.href = URL.createObjectURL(blob);

aLink.click();

},

//保存图片流方法

saveAs(data, filename) {

let blob = new Blob([data])

filename = decodeURIComponent(filename)

if (window.navigator.msSaveOrOpenBlob) {

navigator.msSaveBlob(blob, filename);

} else {

const link = document.createElement('a');

link.href = window.URL.createObjectURL(blob);

link.download = filename;

link.click();

window.URL.revokeObjectURL(link.href);

}

},

 

内容超出部分省略

.single-line{

overflow:hidden;

text-overflow:ellipsis;

white-space: nowrap;/*加宽度width属来兼容部分浏览*/

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值