<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>四大名著介绍</title>
	<style>
		body {
			font-family: Arial, sans-serif;
			background-color: #f2f2f2;
		}
		h1 {
			text-align: center;
			margin-top: 50px;
			color: #333;
		}
		.tab {
			display: flex;
			justify-content: space-around;
			align-items: center;
			margin-top: 50px;
			height: 50px;
			background-color: #fff;
			box-shadow: 0 2px 5px rgba(0,0,0,0.2);
		}
		.tab a {
			font-size: 18px;
			color: #333;
			text-decoration: none;
			padding: 10px;
			transition: all 0.3s ease-in-out;
		}
		.tab a:hover,
		.tab a.active {
			background-color: #333;
			color: #fff;
		}
		.tabcontent {
			display: none;
			padding: 20px;
			background-color: #fff;
			box-shadow: 0 2px 5px rgba(0,0,0,0.2);
		}
		.tabcontent.active {
			display: block;
		}
		.book {
			display: flex;
			flex-wrap: wrap;
			justify-content: space-around;
			margin-top: 50px;
		}
		.book img {
			width: 200px;
			height: 300px;
			object-fit: cover;
			margin-bottom: 20px;
			box-shadow: 0 2px 5px rgba(0,0,0,0.2);
		}
		.book p {
			font-size: 16px;
			line-height: 1.5;
			text-align: justify;
			margin-bottom: 20px;
		}
	</style>
</head>
<body>
	<h1>四大名著介绍</h1>
<pre><code>&lt;div class=&quot;tab&quot;&gt;
	&lt;a href=&quot;#&quot; class=&quot;active&quot; onclick=&quot;openTab(event, 'honglou')&quot;&gt;《红楼梦》&lt;/a&gt;
	&lt;a href=&quot;#&quot; onclick=&quot;openTab(event, 'shuihu')&quot;&gt;《水浒传》&lt;/a&gt;
	&lt;a href=&quot;#&quot; onclick=&quot;openTab(event, 'xiyou')&quot;&gt;《西游记》&lt;/a&gt;
	&lt;a href=&quot;#&quot; onclick=&quot;openTab(event, 'sanguo')&quot;&gt;《三国演义》&lt;/a&gt;
&lt;/div&gt;

&lt;div id=&quot;honglou&quot; class=&quot;tabcontent active&quot;&gt;
	&lt;div class=&quot;book&quot;&gt;
		&lt;img src=&quot;https://img3.doubanio.com/view/subject/l/public/s1070959.jpg&quot;&gt;
		&lt;p&gt;《红楼梦》是中国小说史上一部长篇小说,曾用名《石头记》、《金陵十二钗》等,是中国古代小说的巅峰之作,也是中华文化的珍贵遗产之一。小说主要描写了一个封建王朝腐败没落的历史时期,以贾、史、王、薛四大家族的荣辱兴衰为背景,通过贾宝玉与林黛玉、薛宝钗等人的爱情婚姻、身世成败和悲剧遭遇等,反映了封建社会的黑暗和腐败,表现了人性的复杂和多样,是一部揭示封建社会矛盾和危机的伟大作品。&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;

&lt;div id=&quot;shuihu&quot; class=&quot;tabcontent&quot;&gt;
	&lt;div class=&quot;book&quot;&gt;
		&lt;img src=&quot;https://img3.doubanio.com/view/subject/l/public/s1128411.jpg&quot;&gt;
		&lt;p&gt;《水浒传》是中国小说史上一部长篇小说,是中国古代小说的经典之作,也是中华文化的珍贵遗产之一。小说主要描写了北宋末年民变的历史事件,以宋江为首的108位好汉联合起义,反抗封建统治的故事。小说运用生动的语言和丰富多彩的形象,塑造了一批伟大的英雄形象,表现了人性的善恶和复杂,反映了封建社会的黑暗和腐败,是一部展现中国民族精神和社会历史的伟大作品。&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;

&lt;div id=&quot;xiyou&quot; class=&quot;tabcontent&quot;&gt;
	&lt;div class=&quot;book&quot;&gt;
		&lt;img src=&quot;https://img3.doubanio.com/view/subject/l/public/s1072710.jpg&quot;&gt;
		&lt;p&gt;《西游记》是中国小说史上一部长篇小说,是中国古代小说的经典之作,也是中华文化的珍贵遗产之一。小说主要讲述了唐朝时期僧人玄奘西行取经的故事,以孙悟空、猪八戒、沙和尚、唐僧等人物为主要形象,描绘了一个充满奇幻和神秘的世界。小说融合了道教、佛教、儒教等多种文化元素,表现了中国古代文化的丰富性和多样性,也是中国民间文化的重要组成部分。&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;

&lt;div id=&quot;sanguo&quot; class=&quot;tabcontent&quot;&gt;
	&lt;div class=&quot;book&quot;&gt;
		&lt;img src=&quot;https://img3.doubanio.com/view/subject/l/public/s1074304.jpg&quot;&gt;
		&lt;p&gt;《三国演义》是中国小说史上一部长篇小说,是中国古代小说的经典之作,也是中华文化的珍贵遗产之一。小说主要描写了东汉末年到三国时期的历史事件,以刘备、关羽、张飞、诸葛亮、曹操、孙权等人物为主要形象,表现了一个奋起反抗暴政、建立统一政权的历史进程。小说运用生动的语言和丰富多彩的形象,塑造了一批伟大的英雄形象,表现了人性的善恶和复杂,也是中国民族精神和民族情感的表现。&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;

&lt;script&gt;
	function openTab(evt, tabName) {
		var i, tabcontent, tablinks;
		tabcontent = document.getElementsByClassName(&quot;tabcontent&quot;);
		for (i = 0; i &lt; tabcontent.length; i++) {
			tabcontent[i].className = tabcontent[i].className.replace(&quot; active&quot;, &quot;&quot;);
		}
		tablinks = document.getElementsByClassName(&quot;tablinks&quot;);
		for (i = 0; i &lt; tablinks.length; i++) {
			tablinks[i].className = tablinks[i].className.replace(&quot; active&quot;, &quot;&quot;);
		}
		document.getElementById(tabName).className += &quot; active&quot;;
		evt.currentTarget.className += &quot; active&quot;;
	}
&lt;/script&gt;
</code></pre>
</body>
</html
请你使用html写一个tab页面介绍四大名著当鼠标移动到对应的tab时进行换页再写一个css使得页面看着更舒服

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

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