微信公众号 点击显示答案 操作步骤

1、右键进入检查模式
2、ctrl+f查找html元素
3、添加答案区域代码

添加答案区域代码后,可以直接在页面进行格式调整

复制代码
<!-- 此处height控制显示区域高度 -->
<section style="height: 500px;overflow-x: hidden;overflow-y: auto;text-align: center;box-sizing: border-box;padding: 10px;border-width: 1px;border-style: solid;border-color: rgb(238, 238, 238);">
	<mpchecktext contenteditable="false" id="1603559997900_0.2463386146901354"></mpchecktext>
	<section style="border-width: 0px;border-style: none;border-color: initial;box-sizing: border-box;">
		<mpchecktext contenteditable="false" id="1603559997901_0.7806160681602305"></mpchecktext>
		<p style="text-align:center;margin-bottom: 10px;white-space: normal;">
			<!-- 这里的font-size可以设置文字的大小 -->
			<strong style="font-size: 14px;caret-color: red;">
				<span style="font-size: 14px;">
					<span style="line-height: 22.4px;">
						<!-- 这里是点击之后需要显示的文字或者是图片,显示图片需要http地址(需要先上传到微信) -->
						<p>编写答案</p>
						<!--   <img border="0" src="https://picsum.photos/100/50">  -->
						<mpchecktext contenteditable="false" id="1603559997902_0.2770796707640486"></mpchecktext>
					</span>
				</span>
			</strong>
		</p>
		<strong style="font-size: 14px;caret-color: red;">
			<mpchecktext contenteditable="false" id="1603559997903_0.5044436455277546"></mpchecktext>
		</strong>
	</section><strong style="font-size: 14px;caret-color: red;"></strong>
</section>
4、添加遮罩区域代码

根据内容区域大小调整遮罩层大小,大小一般取内容区域高度+40

复制代码
<center style="box-sizing: border-box;text-align: center;">
	<strong style="font-size: 14px;caret-color: red;">
		<!-- 设置蒙板大小 -->
		<svg width="100%" height="830" xmlns="http://www.w3.org/2000/svg" style="margin-top: -830px;box-sizing: border-box;transform: rotateZ(0deg);-webkit-transform: rotateZ(0deg);-moz-transform: rotateZ(0deg);-o-transform: rotateZ(0deg);">
			<rect width="100%" height="830" style="fill: #fefefe;box-sizing: border-box;">
				<animate attributeName="opacity" begin="click" dur="1s" style="box-sizing: border-box;" from="1" to="0" fill="freeze"></animate>
			</rect>
			<mpchecktext contenteditable="false" id="1603559997904_0.23689150596511355"></mpchecktext>
		</svg>
	</strong>
</center>

添加完遮罩层后,由于遮罩层作用,无法对内容区域直接编辑。

相关推荐
徒 花5 小时前
web前端技术知识复习
前端·html·web
cch89188 小时前
css 样式说明,在页面布局开发中,样式表用于控制组件的尺寸、间距、边框及背景等视觉表现
前端·javascript·html
小李云雾8 小时前
零基础-从ESS6基础到前后端联通实战
前端·python·okhttp·中间件·eclipse·html·fastapi
陈思杰系统思考Jason11 小时前
系统思考:团队学习与成长飞轮
百度·微信·微信公众平台·新浪微博·微信开放平台
belldeep13 小时前
前端:Bootstrap 3.0 , 4.0 , 5.0 有什么差别?
前端·bootstrap·html
吃一根烤肠13 小时前
使用ChatGPT Copilot加速Python调试:实战指南
前端·ui·html
血玥珏13 小时前
血玥珏-BMP名字图片生成器
前端·html
ZTLJQ13 小时前
构建网页的三剑客:HTML, CSS, JavaScript 完全解析
javascript·css·html
橘子编程14 小时前
HTML5 权威指南:从入门到精通
前端·css·vue.js·html·html5
anOnion1 天前
构建无障碍组件之Carousel Pattern
前端·html·交互设计