<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CSS &#8211; 萧邦的博客</title>
	<atom:link href="https://www.zlhlab.top/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.zlhlab.top</link>
	<description>If not me who, If not now when</description>
	<lastBuildDate>Thu, 29 Jun 2017 08:06:35 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.6</generator>
	<item>
		<title>css3实现一个div设置多张背景图片及background-image属性</title>
		<link>https://www.zlhlab.top/css3%e5%ae%9e%e7%8e%b0%e4%b8%80%e4%b8%aadiv%e8%ae%be%e7%bd%ae%e5%a4%9a%e5%bc%a0%e8%83%8c%e6%99%af%e5%9b%be%e7%89%87%e5%8f%8abackground-image%e5%b1%9e%e6%80%a7/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Wed, 28 Jun 2017 07:07:59 +0000</pubDate>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=114</guid>

					<description><![CDATA[css3实现一个div设置多张背景图片及background-image属性 引子 以前做网页布局的时候，一个<div class="more-link">
				 <a href="https://www.zlhlab.top/css3%e5%ae%9e%e7%8e%b0%e4%b8%80%e4%b8%aadiv%e8%ae%be%e7%bd%ae%e5%a4%9a%e5%bc%a0%e8%83%8c%e6%99%af%e5%9b%be%e7%89%87%e5%8f%8abackground-image%e5%b1%9e%e6%80%a7/" class="link-btn theme-btn"><span>Read More </span> <i class="fa fa-caret-right"></i></a>
			</div>]]></description>
										<content:encoded><![CDATA[<p>css3实现一个div设置多张背景图片及background-image属性</p>
<p><strong>引子</strong></p>
<p>以前做网页布局的时候，一个div只能设置一张背景图片，设置多个背景的话，要用多个div嵌套才能实现，这样兼容性比较好。若您的网站要求兼容浏览器低版本，建议用这种方法。css3的出现，解决了一个div只能设置一个背景的问题，使一个div可以设置多个背景图片。background-image还可以设置线性渐变，等效果。</p>
<p><strong>CSS3/CSS1 background-image 属性</strong></p>
<p>语法:</p>
<pre><code>background-image：&lt;bg-image&gt; [ , &lt;bg-image&gt; ]*
<span class="s1">&lt;bg-image&gt; = none | &lt;url&gt; | &lt;linear-gradient&gt; | &lt;radial-gradient&gt; | &lt;repeating-linear-gradient&gt; | &lt;repeating-radial-gradient&gt;</code></pre>
<p><strong>默认值：</strong>none</p>
<p><strong>取值：</strong>none：无背景图。</p>
<p>&lt; url &gt;：使用绝对或相对地址指定背景图像。</p>
<p>&lt; linear-gradient&gt;：使用线性渐变创建背景图像。（CSS3）</p>
<p>&lt; radial-gradient&gt;：使用径向(放射性)渐变创建背景图像。（CSS3）</p>
<p>&lt; repeating-linear-gradient&gt;：使用重复的线性渐变创建背景图像。（CSS3）</p>
<p>&lt; repeating-radial-gradient&gt;：使用重复的径向(放射性)渐变创建背景图像。（CSS3）</p>
<p><strong>说明：</strong></p>
<p>设置或检索对象的背景图像。</p>
<p>如果设置了background-image，同时也建议作者设置background-color用于当背景图像不可见时保持与文本一定的对比。</p>
<p>对应的脚本特性为backgroundImage。</p>
<p><strong>兼容性：</strong><br />
<img fetchpriority="high" decoding="async" class="size-full wp-image-119 aligncenter" src="https://www.zlhlab.top/wp-content/uploads/2017/06/jianrong.jpg" alt="" width="682" height="193" srcset="https://www.zlhlab.top/wp-content/uploads/2017/06/jianrong.jpg 682w, https://www.zlhlab.top/wp-content/uploads/2017/06/jianrong-300x85.jpg 300w" sizes="(max-width: 682px) 100vw, 682px" /></p>
<p>IE8及更早浏览器不支持CSS3 background-image，即不支持多背景和使用渐变作为背景图像。</p>
<p>IE9不支持CSS3新增参数值：&lt; linear-gradient &gt; | &lt; radial-gradient &gt; |&lt; repeating-linear-gradient &gt; | &lt; repeating-radial-gradient &gt;作为背景图像。</p>
<p>Opera11.50-11.51不支持CSS3新增参数值：&lt; radial-gradient &gt; |&lt; repeating-radial-gradient &gt;作为背景图像。</p>
<p>写法：</p>
<p><strong>css3设置多张背景图片</strong></p>
<p>css3设置多张背景图片，可以如下写：</p>
<pre><code>background:url("haoroomsCSS1_s.jpg") 0 0 no-repeat,
url("haoroomsCSS2_s.jpg") 200px 0 no-repeat,
url("haorooms.jpg") 400px 201px no-repeat;
</code></pre>
<p>也可以这么写：</p>
<pre><code>background-image:url("1.jpg"),url("2.jpg"),url("3.jpg");
background-repeat: no-repeat, no-repeat, no-repeat; 
background-position: 0 0, 200px 0, 400px 201px;
</code></pre>
<p><strong>css3背景渐变</strong></p>
<p>标准写法</p>
<pre><code>background-image: linear-gradient(<span class="Apple-converted-space">  </span>[ &lt;angle&gt; | &lt;side-or-corner&gt; ,]? &lt;color-stop&gt; [, &lt;color-stop&gt;]+ );
</code></pre>
<p>上面这种CSS语法我们经常见到，可能有人看不懂具体的意思，其实上面的些符号含义与正则表达式有很多一致之处：</p>
<p>[]在正则中表示一个字符类，这里，你可以理解为一个小单元。</p>
<p>|表示候选。也就是“或者”的意思，要么前面的，要么就后面的。</p>
<p>?为量词，表示0个或1个，言外之意就是，你可以不指定方向，直接渐变色走起。例如：</p>
<p>background:linear-gradient(red, yellow);</p>
<p>就是从上往下的红黄条纹效果。</p>
<p>+也是量词，表示1个或者更多个。因此，终止颜色是不可缺少的。例如：linear-gradient(red)是酱油命，白板。</p>
<p>&lt;&gt;中的是关键字，主要是让开发人员知道这里应该放些什么内容。</p>
<p>水平渐变</p>
<pre><code>{background-image:linear-gradient(left, red 100px, yellow 200px);}</code></pre>
<p><strong>效果如下图：</strong><br />
<img decoding="async" class="aligncenter size-full wp-image-116" src="https://www.zlhlab.top/wp-content/uploads/2017/06/shuiping.png" alt="" width="400" height="299" srcset="https://www.zlhlab.top/wp-content/uploads/2017/06/shuiping.png 400w, https://www.zlhlab.top/wp-content/uploads/2017/06/shuiping-300x224.png 300w" sizes="(max-width: 400px) 100vw, 400px" /><br />
&nbsp;<br />
<strong>左上角渐变</strong></p>
<p>那从(100px, 100px)到(200px, 200px)应该就是从左上角开始，写法如下：</p>
<pre><code>{background-image:linear-gradient(left top, red 100px, yellow 200px);}</code></pre>
<p><strong>效果如下</strong><br />
<img decoding="async" class="aligncenter size-full wp-image-117" src="https://www.zlhlab.top/wp-content/uploads/2017/06/xiezhe.png" alt="" width="400" height="300" srcset="https://www.zlhlab.top/wp-content/uploads/2017/06/xiezhe.png 400w, https://www.zlhlab.top/wp-content/uploads/2017/06/xiezhe-300x225.png 300w" sizes="(max-width: 400px) 100vw, 400px" /><br />
&nbsp;<br />
<strong>渐变方向写法组合：</strong></p>
<p>left, right, top, bottom, left top, left bottom, right top, right， bottom</p>
<p>分别表示，从左往右，从右往左，从上往下，从下往上，从左上往右下，从……（都懂的，不全写了）</p>
<p>当然，也可以用angle角度来写！</p>
<pre><code>{background-image:linear-gradient(-45deg, red 100px, yellow 200px);}</cpde></pre>
<p>具体的样式大家可以尝试着写一下，看一下！很多情况下，用了才知道！</p>
<p>注意：有不少效果加了-webkit前缀以及-moz前缀会展现的不一样！</p>
<p>例如：</p>
<pre><code>background-image:-webkit-linear-gradient(-45deg, red, yellow)</code></pre>
<p>与</p>
<pre><code>background-image:linear-gradient(-45deg, red, yellow)</code></pre>
<p>在Chrome浏览器下的渐变方向居然是相反的！但是45deg是正常的。Firefox浏览器下也是如此，有前缀和没有前缀方向相反！咋回事？</p>
<p>原因很简单，CSS3目前还是草案阶段！</p>
<p>从浏览器去掉前缀前后的变化可以推测，之前，W3C的渐变坐标是与photoshop中一致的，但是，后来，由于某些原因，修改了。</p>
<p>至于什么原因，根据我草草的查找，可能与下面几个关键字之一有联系：animation/transition动画、write-mode书写方向、flex box模型、以及radial-gradient渐变等。在这里就不深入研究了！</p>
<p>前缀兼容</p>
<p><strong>基本的写法如下：</strong></p>
<pre><code>background-image: linear-gradient(top, #fff, #dededc);</code></pre>
<p>但是为了兼容，有时候要写多个前缀，变成如下：</p>
<pre><code>background-image: -ms-linear-gradient(top, #fff, #dededc);
background-image: -moz-linear-gradient(top, #fff, #dededc);
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#dededc));
background-image: -webkit-linear-gradient(top, #fff, #dededc);
background-image: -o-linear-gradient(top, #fff, #dededc);
background-image: linear-gradient(top, #fff, #dededc);
</code></pre>
<p>关于”css3实现一个div设置多张背景图片及background-image属性“今天就写到这里，有问题可以相互交流，加油！</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>只用CSS，图像可以实现和兼容性看起来不错的15种悬停效果</title>
		<link>https://www.zlhlab.top/27/</link>
		
		<dc:creator><![CDATA[萧邦]]></dc:creator>
		<pubDate>Wed, 14 Jun 2017 08:09:50 +0000</pubDate>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[CSS]]></category>
		<guid isPermaLink="false">https://www.zlhlab.top/?p=27</guid>

					<description><![CDATA[所以有人想要的是通过列出的步行运动为自己，然后分享。正如添加效果的链接或按钮的时间徘徊，它是在你想给的东西效果<div class="more-link">
				 <a href="https://www.zlhlab.top/27/" class="link-btn theme-btn"><span>Read More </span> <i class="fa fa-caret-right"></i></a>
			</div>]]></description>
										<content:encoded><![CDATA[<p class="excerpt">所以有人想要的是通过列出的步行运动为自己，然后分享。正如添加效果的链接或按钮的时间徘徊，它是在你想给的东西效果即使在图像上悬停时的时间可能使用效果的样本。由于大量使用CSS3不支持所有的浏览器，这两者只使用CSS来实现，被缩放滑块黑色和白色模糊闪光灯，有15种。</p>
<section>
<h2>常见的HTML CSS·</h2>
<p>样品已经使用HTML，如下面的代码，还规定了以下内容作为CSS共同风格。 由于还存在指定CSS的宽度和高度的一部分，请调整至适合他们到自己的环境中时，它仅作参考。</p>
<p class="codeview"><code class="html">HTML</code></p>
<pre><code>&lt;figure&gt;
	&lt;img src="image.jpg" /&gt;
&lt;/figure&gt;</code></pre>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure {
	width: 300px;
	height: 200px;
	margin: 0;
	padding: 0;
	background: #fff;
	overflow: hidden;
}</code></pre>
<p class="s60">此外，因为它使用的每个动画GIF引入运动，实际移动和显示可以在下面的演示页面发现。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ" target="_blank" rel="noopener">DEMO</a></div>
<p class="note">
</section>
<section id="index">
<h2>只用CSS，图像可以实现和兼容性看起来不错的15种悬停效果</h2>
</section>
<section id="anchor01">
<h2>1.放大＃1</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_01.gif" alt="1.放大＃1" /></figure>
</div>
<div class="right">那些在悬停时的图像落实了扩大如下CSS，实施描述。 当你想改变倍率<code>scale</code>的值，当你想改变，如速度<code>transition</code>，请分别改变任何东西的价值。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	-webkit-transform: scale(1);
	transform: scale(1);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	-webkit-transform: scale(1.3);
	transform: scale(1.3);
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo01" target="_blank" rel="noopener">DEMO &#8211; 放大＃1</a></div>
</section>
<section id="anchor02">
<h2>2.放大＃2</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_02.gif" alt="2.放大＃2" /></figure>
</div>
<div class="right">同样的事情，比如图像被放大在悬停的时间，但这里<code>img</code>的<code>width</code>改变来改变图像大小，你可以用的感觉，不像早期的表现。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	width: 300px;
	height: auto;
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	width: 350px;
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo02" target="_blank" rel="noopener">DEMO &#8211; 放大＃2</a></div>
</section>
<section id="anchor03">
<h2>3.缩小＃1</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_03.gif" alt="3.缩小＃1" /></figure>
</div>
<div class="right">“ <a href="http://www.nxworld.net/tips/css-image-hover-effects.html#anchor01">1.放大＃1</a>中的图像的效果在介绍悬停时的反向版本”展开，就在悬停的时候<code>scale</code>，但我们通过在初始状态时增加值增加的价值，在这里提前，在悬停时通过降低值的图像是要缩小的效果的实现。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	-webkit-transform: scale(1.5);
	transform: scale(1.5);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	-webkit-transform: scale(1);
	transform: scale(1);
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo03" target="_blank" rel="noopener">DEMO &#8211; 缩小＃1</a></div>
</section>
<section id="anchor04">
<h2>4.缩小＃2</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_04.gif" alt="4.缩小＃2" /></figure>
</div>
<div class="right">这是“ <a href="http://www.nxworld.net/tips/css-image-hover-effects.html#anchor02">2放大＃2</a>中的影响而发生反向版本来放大在引入时的图像悬停在”，如下所述CSS的实施进行说明。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	width: 400px;
	height: auto;
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	width: 300px;
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo04" target="_blank" rel="noopener">DEMO &#8211; 缩小＃2</a></div>
</section>
<section id="anchor05">
<h2>5.滑动</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_05.gif" alt="5.滑动" /></figure>
</div>
<div class="right">
<p>事先<code>margin</code>应被放置在使用的图像的位置稍微移位，即在悬停的时间<code>margin</code>是什么通过擦除标记的影响，如滑动幻灯片图像。 该CSS是一个实现描述如下。</p>
<p class="note">※只要所使用的图像的宽度是比“要面积+幻灯片要被显示的距离”时，<code>scale</code>你的指定不需要。</p>
</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	margin-left: 30px;
	-webkit-transform: scale(1.5);
	transform: scale(1.5);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	margin-left: 0;
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo05" target="_blank" rel="noopener">DEMO &#8211; 幻灯片</a></div>
</section>
<section id="anchor06">
<h2>6.旋转（+缩小）</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_06.gif" alt="6.旋转（+缩小）" /></figure>
</div>
<div class="right">在悬停的时候那些图片给旋转的效果，进一步“ <a href="http://www.nxworld.net/tips/css-image-hover-effects.html#anchor03">3.缩小＃1</a>是个什么形象也补充说，在悬停的介绍的时候缩小效应”。 描述如下CSS于旋转角度执行<code>rotate</code>一个，放大倍率<code>scale</code>可以通过改变每个的值被改变为任何移动。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	-webkit-transform: rotate(15deg) scale(1.4);
	transform: rotate(15deg) scale(1.4);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	-webkit-transform: rotate(0) scale(1);
	transform: rotate(0) scale(1);
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo06" target="_blank" rel="noopener">DEMO &#8211; 旋转（+缩小）</a></div>
</section>
<section id="anchor07">
<h2>7.模糊</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_07.gif" alt="7.模糊" /></figure>
</div>
<div class="right"><code>filter</code>这是一个模糊效果的图像使用，但将是东西，此时的样品释放那些模糊预处理效果，在当时徘徊的，也apparent&#8217;re与模糊效果时，悬停在反向I. CSS是，如果你想调整在下面的示例源模糊效果：实现描述如下<code>blur(3px)</code>，请更改已被指定为对所有这些的价值点。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	-webkit-filter: blur(3px);
	filter: blur(3px);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	-webkit-filter: blur(0);
	filter: blur(0);
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo07" target="_blank" rel="noopener">DEMO &#8211; 模糊</a></div>
</section>
<section id="anchor08">
<h2>8.灰阶</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_08.gif" alt="8.灰阶" /></figure>
</div>
<div class="right">同时<code>filter</code>使用，这里是图像的灰度转换。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	-webkit-filter: grayscale(100%);
	filter: grayscale(100%);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	-webkit-filter: grayscale(0);
	filter: grayscale(0);
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo08" target="_blank" rel="noopener">DEMO &#8211; 灰度</a></div>
</section>
<section id="anchor09">
<h2>9.棕褐色</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_09.gif" alt="9.棕褐色" /></figure>
</div>
<div class="right">这里还<code>filter</code>使用了该类型的，它是由图像转换为深褐色调获得。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	-webkit-filter: sepia(100%);
	filter: sepia(100%);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	-webkit-filter: sepia(0);
	filter: sepia(0);
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo09" target="_blank" rel="noopener">DEMO &#8211; 棕褐色</a></div>
</section>
<section id="anchor10">
<h2>10.模糊+灰度</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_10.gif" alt="10.模糊+灰度" /></figure>
</div>
<div class="right">据上面介绍<code>filter</code>它，但你也可以使用多个效果的组合。 这是“ <a href="http://www.nxworld.net/tips/css-image-hover-effects.html#anchor07">7模糊</a> ”和“ <a href="http://www.nxworld.net/tips/css-image-hover-effects.html#anchor08">8灰度</a>其在组合试图与”，执行被描述如下的CSS。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	-webkit-filter: grayscale(0) blur(0);
	filter: grayscale(0) blur(0);
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	-webkit-filter: grayscale(100%) blur(3px);
	filter: grayscale(100%) blur(3px);
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo10" target="_blank" rel="noopener">DEMO &#8211; 模糊+灰阶</a></div>
</section>
<section id="anchor11">
<h2>11.不透明度＃1</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_11.gif" alt="11.不透明度＃1" /></figure>
</div>
<div class="right">这也是经常看到的实施，在悬停的时候<code>opacity</code>是用传输的事情。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure img {
	opacity: 1;
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	opacity: .5;
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo11" target="_blank" rel="noopener">DEMO &#8211; 不透明度＃1</a></div>
</section>
<section id="anchor12">
<h2>12.不透明度＃2</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_12.gif" alt="12.不透明度＃2" /></figure>
</div>
<div class="right">在同一个悬停和更早<code>opacity</code>的是，使用传输的事情，但图像的父元素（在此示例中<code>figure</code>只对背景颜色的名字），你也可以稍微不同的方式来显示。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure {
	background: #1abc9c;
}
figure img {
	opacity: 1;
	-webkit-transition: .3s ease-in-out;
	transition: .3s ease-in-out;
}
figure:hover img {
	opacity: .5;
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo12" target="_blank" rel="noopener">DEMO &#8211; 不透明＃2</a></div>
</section>
<section id="anchor13">
<h2>13.闪烁</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_13.gif" alt="13.闪烁" /></figure>
</div>
<div class="right">也是用这个博客是，它是在悬停的时候什么样的形象给了像闪烁了一下一个效果。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure:hover img {
	opacity: 1;
	-webkit-animation: flash 1.5s;
	animation: flash 1.5s;
}
@-webkit-keyframes flash {
	0% {
		opacity: .4;
	}
	100% {
		opacity: 1;
	}
}
@keyframes flash {
	0% {
		opacity: .4;
	}
	100% {
		opacity: 1;
	}
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo13" target="_blank" rel="noopener">DEMO &#8211; 闪烁</a></div>
</section>
<section id="anchor14">
<h2>14.服务</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_14.gif" alt="14.服务" /></figure>
</div>
<div class="right">这是更智能和通用的高描述方法有可能的，但是这基兰和光得到的效果，如从悬停的时间从左向右流动。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure {
	position: relative;
}
figure::before {
	position: absolute;
	top: 0;
	left: -75%;
	z-index: 2;
	display: block;
	content: '';
	width: 50%;
	height: 100%;
	background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
	background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,.3) 100%);
	-webkit-transform: skewX(-25deg);
	transform: skewX(-25deg);
}
figure:hover::before {
	-webkit-animation: shine .75s;
	animation: shine .75s;
}
@-webkit-keyframes shine {
	100% {
		left: 125%;
	}
}
@keyframes shine {
	100% {
		left: 125%;
	}
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo14" target="_blank" rel="noopener">DEMO &#8211; 服务</a></div>
</section>
<section id="anchor15">
<h2>15.圈</h2>
<div class="column">
<div class="left">
<figure><img decoding="async" src="http://www.nxworld.net/wp-content/uploads/2015/04/css-image-hover-effects_15.gif" alt="15.圈" /></figure>
</div>
<div class="right">是什么给了连锁反应，如谷歌的材质设计，在使用的时候徘徊。 该CSS是一个实现描述如下。</div>
</div>
<p class="codeview"><code class="css">CSS</code></p>
<pre><code>figure {
	position: relative;
}
figure::before {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: block;
	content: '';
	width: 0;
	height: 0;
	background: rgba(255,255,255,.2);
	border-radius: 100%;
	-webkit-transform: translate(-50%, -50%);
	transform: translate(-50%, -50%);
	opacity: 0;
}
figure:hover::before {
	-webkit-animation: circle .75s;
	animation: circle .75s;
}
@-webkit-keyframes circle {
	0% {
		opacity: 1;
	}
	40% {
		opacity: 1;
	}
	100% {
		width: 200%;
		height: 200%;
		opacity: 0;
	}
}
@keyframes circle {
	0% {
		opacity: 1;
	}
	40% {
		opacity: 1;
	}
	100% {
		width: 200%;
		height: 200%;
		opacity: 0;
	}
}</code></pre>
<p>实际运动可以在下面找到。</p>
<div class="link demo"><a href="http://codepen.io/nxworld/pen/ZYNOBZ#demo15" target="_blank" rel="noopener">DEMO &#8211; 圈</a></div>
</section>
<p class="s60">以上，这是形象与良好的兼容可能将徘徊，只能在CSS实现的效果。 当然，根据相应的浏览器，但由于这种方式只能轻易多种如果浏览器没有问题，如何显示CSS，什么页面，如图像一字排开很多，如照片库页我认为，当你想用它的效果是非常有用的。 另外，我在以前这个博客中写道“ <a href="http://www.nxworld.net/tips/css-only-caption-effect.html">标题效果20只实现在CSS</a>中还建议在组合使用”，在这里也因为它只能在CSS可以很容易地实现，就看也在这里，如果你有兴趣请尝试探测。</p>
<p>这里除了它在所有的方式引入，如果有，可以在CSS实现也请告诉我一个有趣的效果:)</p>
<p class="note">本文转载自nxworld,仅作技术分享。点击<a href="http://www.nxworld.net/tips/css-image-hover-effects.html#anchor02">阅读原文</a></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
