人物介绍卡

本文介绍了如何使用CSS3和HTML创建一个人物介绍卡,当鼠标悬停时图片会缩小。文章提供了详细的HTML结构和CSS样式代码,并强调了文件路径在引入CSS和图片时的重要性。
摘要由CSDN通过智能技术生成

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档


人物介绍卡

鼠标移上去之后就会缩小

在这里插入图片描述
在这里插入图片描述

一、先看看效果

如上图,将鼠标移上去之后图片就会缩小

二、代码

1.html部分

代码如下:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>人物介绍卡</title>
		<link rel="stylesheet" href="css/renwujieshao.css"/>
	</head>
	<body>
		<div class="card">
			<div class="photo">
				<img src="img/a.jpeg"/>
			</div>
			<h1>艾斯</h1>
			<h2>“火拳”艾斯</h2>
			<p>波特卡斯D艾斯,日本漫画《航海王》及其衍生作品中国的角色。萨博与路飞的结义兄弟。</p>
			<a href="#">了解更多</a>
		</div>
		
		
		<div class="card">
			<div class="photo">
				<img src="img/s.jpeg"/>
			</div>
			<h1>萨博</h1>
			<h2&g
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个简单的HTML+CSS动态人物介绍网页代码示例: ```html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>人物介绍网页</title> <style> /* 布局和字体样式 */ body { font-family: "微软雅黑", sans-serif; background-color: #f2f2f2; margin: 0; padding: 0; } header { background-color: #333; color: #fff; padding: 20px; text-align: center; } h1 { font-size: 36px; margin: 0; } main { display: flex; flex-wrap: wrap; justify-content: center; margin: 20px; } .card { background-color: #fff; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; margin: 20px; padding: 20px; text-align: center; transition: transform 0.2s; width: 300px; } .card:hover { transform: scale(1.05); } .card img { border-radius: 50%; height: 200px; margin-bottom: 20px; width: 200px; } .card h2 { font-size: 24px; margin: 0; } .card p { font-size: 16px; margin: 10px 0; } .card button { background-color: #333; border: none; color: #fff; cursor: pointer; padding: 10px 20px; transition: background-color 0.2s; } .card button:hover { background-color: #666; } /* 动画效果 */ @keyframes slideInLeft { from { opacity: 0; transform: translateX(-100px); } to { opacity: 1; transform: translateX(0); } } .animation { animation: slideInLeft 1s; } </style> </head> <body> <header> <h1>人物介绍网页</h1> <p>一个简单的HTML+CSS动态人物介绍网页示例</p> </header> <main> <div class="card animation"> <img src="https://via.placeholder.com/200x200" alt="人物照片"> <h2>人物名称</h2> <p>人物介绍</p> <button>了解更多</button> </div> <div class="card animation"> <img src="https://via.placeholder.com/200x200" alt="人物照片"> <h2>人物名称</h2> <p>人物介绍</p> <button>了解更多</button> </div> <div class="card animation"> <img src="https://via.placeholder.com/200x200" alt="人物照片"> <h2>人物名称</h2> <p>人物介绍</p> <button>了解更多</button> </div> </main> </body> </html> ``` 这个示例网页包括一个头部、一个主体,以及三个人物介绍片。使用了HTML标签和CSS样式来创建和美化布局,以及CSS3的动画效果来添加动态效果。希望这个示例对您有所帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值