div+css实现图文卡片悬浮图片放大文字缩小效果代码

代码语言:html

所属分类:悬停

代码描述:div+css实现图文卡片悬浮图片放大文字缩小效果代码

代码标签: div css 图文 卡片 悬浮 图片 放大 文字 缩小

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">

  <meta name="viewport" content="width=device-width, initial-scale=1">

<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700" rel="stylesheet">

<link href="https://fonts.googleapis.com/css?family=Oswald:300,400,700" rel="stylesheet">

<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700" rel="stylesheet"><link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.5.0.css">
<style>
    body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  
  background: #222;
}

.wrapper {
  position: relative;
  height: 300px;
  width: 600px;
  margin: 50px 0;
  
  display: flex;
  flex-direction: row;
  
  transition: all 200ms ease-in-out;
}

.image-wrapper {
  height: 300px;
  width: 450px;
  overflow: hidden;
  border-radius: 5px;
  cursor: pointer;

  transition: all 200ms ease-in-out;
}

img {
  height: 300px;
  width: 450px;
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: top;
     object-position: top;
  
  transition: all 200ms ease-in-out;
}

.book-design-image {
  -o-obj.........完整代码请登录后点击上方下载按钮下载查看

网友评论0