當前位置:編程學習大全網 - 網站源碼 - CSS和html如何實現這個效果

CSS和html如何實現這個效果

<!doctype?html>

<html>

<head>

<meta?charset="utf-8">

<title>淘寶購買</title>

<style>

.taobao{width:224px;height:224px;?position:relative;?z-index:0;?overflow:hidden;?cursor:pointer}

.taobao.img{display:block;?position:relative;?z-index:0;}

.taobao?a{display:none;height:20px;?text-align:center;?background:red;?color:#fff;?text-decoration:none;?font-weight:bold;?font-family:"新宋體";?font-size:16px;?line-height:20px;?margin:auto?15px;?margin-top:-102px;?position:relative;?z-index:1000;}

.zhezao{opacity:0.2;?position:relative;z-index:100;height:100%;width:100%;?margin-top:-100%;?display:none;?background:#333}

.taobao:hover?a,?.taobao:hover?.zhezao{display:block;}

</style>

</head>

<body>

<div?class="taobao">

<img?src="1.png">

<div?class="zhezao"></div><a?href="#"?target="_blank">去淘寶購買</a>

</div>

</body>

</html>

隨便做了個演示,妳根據妳自己的要求完善壹下!

例外,由於時間緊張,在ie下運行正常,其他瀏覽器,妳在測試修改下!

下面是效果圖:

  • 上一篇:WORD排版怎麽把A4的紙換成B5的
  • 下一篇:服務器能不能刷網課
  • copyright 2024編程學習大全網