纯CSS实现图片列表悬停放大效果的方法

   2015-10-08 0
核心提示:这篇文章主要为大家介绍了纯CSS实现图片列表悬停放大效果的方法,涉及css中a:hover属性的使用技巧,非常具有实用价值,需要的朋友可以参考下

本文实例讲述了纯CSS实现图片列表悬停放大效果的方法。分享给大家供大家参考。具体实现方法如下:


复制代码
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>片悬停放大</title>
<style>
*{margin:0;padding:0;}
body{margin-top:80px;font-size:12px;font-family:"微软雅黑",arial,sans-serif;color:#9C9C91;background:#fff;}
a {color:#333;text-decoration: none;}
a:hover {color:#f00;}
.wrap {width:720px;background:#f2f2f2;margin:0 auto;}
ul.works {list-style:none;margin:0;padding:0;}
ul.works li {float:left;display: inline;margin:0 20px 20px 0;width:158px;height:150px;}
ul.works li a {text-decoration: none;display:block;width:158px;height:150px;background:#fff;}
ul.works li a img {width:150px;height:140px;border:0;}
ul.works li a .imgthumb {position:relative;background:#EFEFEF;}
ul.works li a .imgthumb span.thumb_shadow_right {position:relative;top:-3px;left:-3px;display:block;border:1px solid #BCBEC0;background:#FFF;padding:3px;text-align:center;}
ul.works li a .intro {display:none;margin-top:5px;height:80px;color:#9C9C91;line-height:1.5;}
ul.works li a .intro p {border-bottom:1px solid #DEDEDD;overflow:hidden;}
ul.works li a:hover {position:absolute;z-index:5;margin:-60px -6px -220px -30px;width:210px;height:273px;background:#CFE798;cursor:pointer;}
ul.works li a:hover .shadow {position:relative;display:block;padding:4px;}
ul.works li a:hover .box {border:1px solid #9FCF30;background:#fff;padding:15px 10px 15px 15px;}
ul.works li a:hover .intro {display:block;}
</style>
</head>
<body>
<div class="wrap">
<ul class="works">
<li><a href="#"><div class="shadow"><div class="box"><div class="imgthumb"><span class="thumb_shadow_right"><img src="wall_s1.jpg" /></span></div><div class="intro"><p>服务客户: 好搜</p><p>项目类别: 企业VI设计</p><p>所在行业: 互联网</p><p>创作时间: 2015.03</p></div></div></div></a></li>
<li><a href="#"><div class="shadow"><div class="box"><div class="imgthumb"><span class="thumb_shadow_right"><img src="wall_s3.jpg" /></span></div><div class="intro"><p>服务客户: 百度搜索</p><p>项目类别: 硬件防火墙</p><p>所在行业: 互联网</p><p>创作时间: 2015.03</p></div></div></div></a></li>
<li><a href="#"><div class="shadow"><div class="box"><div class="imgthumb"><span class="thumb_shadow_right"><img src="wall_s4.jpg" /></span></div><div class="intro"><p>服务客户: 新浪财经</p><p>项目类别: 企业VI设计</p><p>所在行业: 金融行业</p><p>创作时间: 2015.04</p></div></div></div></a></li>
<li><a href="#"><div class="shadow"><div class="box"><div class="imgthumb"><span class="thumb_shadow_right"><img src="wall_s5.jpg" /></span></div><div class="intro"><p>服务客户:腾讯新闻</p><p>项目类别: 企业VI设计</p><p>所在行业: 互联网</p><p>创作时间: 2015.05</p></div></div></div></a></li>
</ul>
</div>
</body>
</html>

希望本文所述对大家的web网页设计有所帮助。

 
标签: css 图片 放大
反对 0举报 0 评论 0
 

免责声明:本文仅代表作者个人观点,与乐学笔记(本网)无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
    本网站有部分内容均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责,若因作品内容、知识产权、版权和其他问题,请及时提供相关证明等材料并与我们留言联系,本网站将在规定时间内给予删除等相关处理.

  • Bootstrap.css 中请求googleapis.com/css?famil
    问题描述: Web中引入bootstrap.css中头部有访问Google服务器的请求 @import url("//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700");     国内访问不稳定,页面反应慢解决:将请求结果保存下来,放到本地,重新声明请求1.请求http:
    03-16
  • React , TypeScript,  CSS Module , Less , Antd 遇到的坑
    React , TypeScript, CSS Module , Less , Ant
    因为React 本身的脚手架自身在webpack中已经做了对CSS Module 的配置,因最近遇到了很多坑,所以从头整理了一遍 使用版本"react": "^16.13.1","antd": "^4.4.0","typescript": "~3.7.2","webpack": "4.42.0","less": "^3
    03-08
  • react 运行报错 Error: PostCSS plugin postcss-pxtorem requires PostCSS 8.
    react 运行报错 Error: PostCSS plugin postcss
    postcss-pxtorem使用方法:https://www.cnblogs.com/liangziaha/p/13636936.html 这里报错 postcss-pxtorem 需要 8. 我以为要使用postcss-pxtorem 8.以上的版本就去看了一下postcss-pxtorem版本最高才6.0  这里降低  postcss-pxtorem@5.1.1npm i postcs
    03-08
  • React中jquery引用 react 引入css
    React中jquery引用 react 引入css
    在React中引用Jquery比较好玩,获取元素的数据更多1.引入方法举例: 1 import $ from 'jquery'; 23 import { Button } from 'antd'; 45 class testJquery extends React.Component { 67   constructor(props) { 8     super(props); 9 10     this.
    03-08
  • Vue PostCSS的使用介绍
    目录PostCSS使用安装依赖运行使用第三方插件autoprefixer使用第三方插件postcss-preset-env使用第三方插件postcss-pxtorem运行的新方式PostCSSpostcss 一种对css编译的工具,类似babel对js的处理,常见的功能如:1 . 使用下一代css语法2 . 自动补全浏览器前缀
    03-08
  • css实现弹出框 css弹出菜单
    弹出框也是前端里面经常使用的一个应用场景了,最开始想到的是用js实现这个效果,看到codepen上面有用css实现的。其实就是用到了css里面的一个:target选择器+visibility属性。URL 带有后面跟有锚名称 #,指向文档内某个具体的元素。这个被链接的元素就是目标
    03-08
  • jfinal框架页面找不到相关css,js文件404
    在JFinalConfig中添加配置: @Overridepublic void configHandler(Handlers handlers) {handlers.add(new ContextPathHandler());}页面中添加:base href="${CONTEXT_PATH}/"/之前页面找不到资源,把tomcat工程路径去掉了(path=""),这样暂时解决了问题推荐
    03-08
  • 纯CSS3实现的一些酷炫效果 css实现炫酷背景
    纯CSS3实现的一些酷炫效果 css实现炫酷背景
      之前在网上看到一些用纯CSS3实现的酷炫效果,以为实现起来比较困难,于是想看看具体是怎么实现的。一、笑脸猫动画实现效果如下:这个实现起来确实比较麻烦,很多地方需要花时间,有耐心地调整。1.先看下页面结构:bodydiv class="container"!-- 脸 --div
    03-08
  • 移动端CSS底部固定和fixed定位在ios上的bug
    fixed定位在ios上的bugcss三栏布局假设我们页面的 HTML 结构是这样: div class="wrapper"div class="content"!-- 页面主体内容区域 --/divdiv class="footer"!-- 需要做到 Sticky Footer 效果的页脚 --/div/div方法1.:absolute通过绝对定位处理应该是常见的
    03-08
  • css实现图片翻转 css使图片旋转
    !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"html xmlns="http://www.w3.org/1999/xhtml"headmeta http-equiv="Content-Type" content="text/h
    03-08
点击排行