<!-- HTML代码 -->
<!DOCTYPE html>
<html>
<head>
	<title>禁止在微信与QQ内浏览</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<style>
		body {
			margin: 0;
			padding: 0;
			font-size: 16px;
			font-family: Arial, sans-serif;
			background-color: #f5f5f5;
		}
<pre><code>	.container {
		width: 80%;
		margin: 0 auto;
		padding: 50px;
		background-color: #fff;
		box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
		text-align: center;
	}
	
	h1 {
		font-size: 36px;
		color: #333;
		margin-bottom: 20px;
	}
	
	p {
		font-size: 18px;
		color: #666;
		margin-bottom: 20px;
	}
	
	.btn {
		display: inline-block;
		padding: 10px 20px;
		font-size: 18px;
		color: #fff;
		background-color: #0099cc;
		border-radius: 5px;
		text-decoration: none;
		transition: background-color 0.3s ease;
	}
	
	.btn:hover {
		background-color: #0077b3;
	}
&lt;/style&gt;
</code></pre>
</head>
<body>
	<div class="container">
		<h1>禁止在微信与QQ内浏览</h1>
		<p>非常抱歉,本站不允许在微信与QQ内浏览。</p>
		<a href="#" class="btn">返回首页</a>
	</div>
<pre><code>&lt;script src=&quot;https://code.jquery.com/jquery-3.6.0.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
	$(document).ready(function() {
		var ua = navigator.userAgent.toLowerCase();
		if (ua.match(/MicroMessenger/i) == &quot;micromessenger&quot; || ua.match(/QQ/i) == &quot;qq&quot;) {
			$('.container').html('&lt;h1&gt;禁止在微信与QQ内浏览&lt;/h1&gt;&lt;p&gt;非常抱歉,本站不允许在微信与QQ内浏览。&lt;/p&gt;');
		}
	});
&lt;/script&gt;
</code></pre>
</body>
</html>
用html+jq+css 写一个不允许本站网址在微信与QQ内浏览

原文地址: https://www.cveoy.top/t/topic/bert 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录