多语言展示
当前在线:204今日阅读:168今日分享:49

css3半透明遮罩背景lightbox图片展示

css3半透明遮罩背景lightbox图片展示
工具/原料

adobe dreamweaver

方法/步骤
1

新建html文档。

2

书写hmtl代码。

CSS3 Lightbox

A simple CSS-only lightbox experiment

Demo 1 Demo 2 Demo 3

  • image01 Pointe
    x Close image01

    pointe /point/

    Dance performed on the tips of the toes

  • image02 Port de bras
    image02

    port de bras /ˌpôr də ˈbrä/

    An exercise designed to develop graceful movement and disposition of the arms

    x Close
3

书写css代码。a { color: #333; text-decoration: none; }.container { position: relative; text-align: center; }.clr { clear: both; }.container > header { padding: 20px 30px 10px 30px; margin: 0px 20px 10px 20px; position: relative; display: block; text-shadow: 1px 1px 1px rgba(0,0,0,0.2); text-align: center; }.container > header h1 { font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif; font-size: 35px; line-height: 35px; position: relative; font-weight: 400; color: rgba(27,54,81,0.8); text-shadow: 1px 1px 1px rgba(0,0,0,0.3); padding: 0px 0px 5px 0px; }.container > header h1 span { color: #c7957b; text-shadow: 0px 1px 1px rgba(255,255,255,0.8); }.container > header h2, p.info { font-size: 16px; font-style: italic; color: #4a3124; text-shadow: 0px 1px 1px rgba(255,255,255,1); }.codrops-top { font-family: 'Arial Narrow', Arial, sans-serif; line-height: 24px; font-size: 11px; width: 100%; background: #000; opacity: 0.9; text-transform: uppercase; z-index: 9999; position: relative; -moz-box-shadow: 1px 0px 2px #000; -webkit-box-shadow: 1px 0px 2px #000; box-shadow: 1px 0px 2px #000; }.codrops-top a { padding: 0px 10px; letter-spacing: 1px; color: #ddd; display: block; float: left; }.codrops-top a:hover { color: #fff; }.codrops-top span.right { float: right; }.codrops-top span.right a { float: none; display: inline; }p.codrops-demos { text-align: center; display: block; padding: 14px; }

4

书写css透明代码。.lb-album { width: 900px; margin: 0 auto; font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif; }.lb-album li { float: left; margin: 5px; position: relative; }.lb-album li > a, .lb-album li > a img { display: block; }.lb-album li > a { width: 150px; height: 150px; position: relative; padding: 10px; background: #f1d2c2; -webkit-box-shadow: 1px 1px 2px #fff, 1px 1px 2px rgba(158,111,86,0.3) inset; -moz-box-shadow: 1px 1px 2px #fff, 1px 1px 2px rgba(158,111,86,0.3) inset; box-shadow: 1px 1px 2px #fff, 1px 1px 2px rgba(158,111,86,0.3) inset; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px 4px 4px 4px; }.lb-album li > a span { position: absolute; width: 150px; height: 150px; top: 10px; left: 10px; text-align: center; line-height: 150px; color: rgba(27,54,81,0.8); text-shadow: 0px 1px 1px rgba(255,255,255,0.6); font-size: 24px; opacity: 0; filter: alpha(opacity=0); /* internet explorer */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"; /*IE8*/ background: rgb(241,210,194); background: -moz-radial-gradient(center, ellipse cover, rgba(255,255,255,0.56) 0%, rgba(241,210,194,1) 100%); background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, rgba(255,255,255,0.56)), color-stop(100%, rgba(241,210,194,1))); background: -webkit-radial-gradient(center, ellipse cover, rgba(255,255,255,0.56) 0%, rgba(241,210,194,1) 100%); background: -o-radial-gradient(center, ellipse cover, rgba(255,255,255,0.56) 0%, rgba(241,210,194,1) 100%); background: -ms-radial-gradient(center, ellipse cover, rgba(255,255,255,0.56) 0%, rgba(241,210,194,1) 100%); background: radial-gradient(center, ellipse cover, rgba(255,255,255,0.56) 0%, rgba(241,210,194,1) 100%); -webkit-transition: opacity 0.3s linear; -moz-transition: opacity 0.3s linear; -o-transition: opacity 0.3s linear; -ms-transition: opacity 0.3s linear; transition: opacity 0.3s linear; }

5

代码整体结构。

6

查看效果。