<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>预览</title>
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery.qrcode.min.js"></script> <style>
.topicsCode{
width: 255px;
height: 255px;
text-Align:center;
}
.topicsCode{
position: absolute;
top: 20%;
left: 39.5%;
}
#qrcode{
margin: 0;
padding: 0;
}
.prompt{
margin-top:5px;
font-size:15px;
}
</style>
</head>
<body>
<div class="topicsCode">
<div id="qrcode"></div>
<p class="prompt">请扫描二维码在手机端预览</p>
</div>
<script>
$(function(){
$(‘#qrcode‘).qrcode(‘http://www.baidu.com/‘);
})
</script>
</body>
</html>
原文地址:https://www.cnblogs.com/yufume/p/11723282.html