css实现在图片下方加文字说明

位置:首页>文章>详情   分类: 教程分享 > Java教程   阅读(1603)   2024-03-15 09:58:59

在html中,使用css控制实现图片下方浮动一行文字说明,效果图如下:

css控制图片上的文字说明


代码:

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测试</title>
<style type="text/css">
.item{
}
.item-top{
width: 300px;
height: 420px;
position: relative;
display:block;
overflow: hidden;
}
.item-top .item-top-text{
background: rgba(190, 195, 191, 0.44);
padding: 10px 20px;
position: absolute;
width: 300px;
height: 20px;
bottom: -60px;
transition: bottom ease .3s;
}
.item-top:HOVER .item-top-text {
	bottom: 0px;
}
</style>

</head>
<body>
<div>
	<div class="item">
		<div class="item-top">
			<a href="javascript:;">
				<img alt="java" src="image/java.jpg">
			</a>
			<div class="item-top-text">
			<a href="javascript:;">测试文本</a>
			</div>
		</div>
</div>

</div>
</body>
</html>

transition: bottom ease .3s;说明:从底部出现

标签: css
地址:https://www.leftso.com/article/55.html

相关阅读

jQuery添加/改变/移除CSS类及判断是否已经存在CSS,jquery,css
css实现在图片下方加文字说明,图片浮动说明标题css实现
css
如何使用css3设置div为圆角样式,以及分别对每个角都可以自定义设置大小
如何使html中的英语单词换行。在css中有有一下几种换行策略:
css设置背景图片不随浏览器滚动条滚动,即固定背景图片
spring boot 开发技巧,在开发web项目中跳过thyemeleaf模板/js/css等缓存避免每次修改资源文件都需要重启服务器
[JAVA]_图文详解CKeditor4.4.X版本添加程序代码高亮插件codesnippet,ckeditor
一、项目环境Spring Boot 2.1.2.RELEASEshiro-spring 1.4二、去掉URL jsessionid在shiro配置中,配置关闭url中显示sessionId ...
Jquery cookie插件实现点击获取验证码后60秒内禁止重新获取,可直接拿走用,jquery,验证码获取
xcopy 复制点(.)开头的隐藏文件到用户主目录,bat如何获取用户主目录?点开头的文件夹如何用xcopy复制