<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Css on 阿珏酱のBlog</title>
    <link>https://zh.moejue.cn/categories/css/</link>
    <description>Recent content from 阿珏酱のBlog</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    
    <managingEditor>xxx@example.com (MoeJue)</managingEditor>
    <webMaster>xxx@example.com (MoeJue)</webMaster>
    
    <copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright>
    
    <lastBuildDate>Wed, 16 May 2018 11:58:08 +0000</lastBuildDate>
    
    
    <atom:link href="https://zh.moejue.cn/categories/css/index.xml" rel="self" type="application/rss&#43;xml" />
    

    
    

    <item>
      <title>CSS3随机背景图片切换特效</title>
      <link>https://zh.moejue.cn/posts/4/</link>
      <pubDate>Wed, 16 May 2018 11:58:08 &#43;0000</pubDate>
      <author>xxx@example.com (MoeJue)</author>
      <guid>https://zh.moejue.cn/posts/4/</guid>
      <description>
        <![CDATA[<h1>CSS3随机背景图片切换特效</h1><p>作者：MoeJue（xxx@example.com）</p>
        
          <p>css3的随机背景图片淡入淡出切换特效  演示效果如本篇文章背景所示<br>
看大家扒我的幻想领域二次元限定版扒的比较累，扒了大半个小时的，抽空整理一下发出来<br>
设计之初本来是打算使用jQuery进行实现的，但是注意到了css3的@keyframes 规则，css3已经强大到曾经只有js才能实现的效果</p>
<h2 id="定义和用法">
<a class="header-anchor" href="#%e5%ae%9a%e4%b9%89%e5%92%8c%e7%94%a8%e6%b3%95"></a>
定义和用法
</h2><p>通过 @keyframes 规则，您能够创建动画。</p>
<p>创建动画的原理是，将一套 CSS 样式逐渐变化为另一套样式。</p>
<p>在动画过程中，您能够多次改变这套 CSS 样式。</p>
<p>以百分比来规定改变发生的时间，或者通过关键词 &ldquo;from&rdquo; 和 &ldquo;to&rdquo;，等价于 0% 和 100%。</p>
<p>0% 是动画的开始时间，100% 动画的结束时间。</p>
<p>为了获得最佳的浏览器支持，您应该始终定义 0% 和 100% 选择器。</p>
<p>注释：请使用动画属性来控制动画的外观，同时将动画与选择器绑定。</p>
<p>核心css部分(记得切换图片地址)</p>
<p>body {
background: #000;
background-attachment: fixed;
word-wrap: break-word;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
background-repeat: no-repeat
}</p>
<p>ul {
list-style: none
}</p>
<p>.cb-slideshow li:nth-child(1) span {
background-image: url(<a href="https://random.52ecy.cn/randbg.php?v=1520341099">https://random.52ecy.cn/randbg.php?v=1520341099</a>)
}</p>
<p>.cb-slideshow li:nth-child(2) span {
background-image: url(<a href="https://random.52ecy.cn/randbg.php?v=1520341159">https://random.52ecy.cn/randbg.php?v=1520341159</a>)
}</p>
<p>.cb-slideshow li:nth-child(3) span {
background-image: url(<a href="https://random.52ecy.cn/randbg.php?v=1520341149">https://random.52ecy.cn/randbg.php?v=1520341149</a>)
}</p>
        
        <hr><p>本文2018-05-16首发于<a href='https://zh.moejue.cn/'>阿珏酱のBlog</a>，最后修改于2018-05-16</p>]]>
      </description>
      
        <category>css</category>
      
    </item>
    
    

    <item>
      <title>简单的css3头像旋转与3D旋转效果</title>
      <link>https://zh.moejue.cn/posts/39/</link>
      <pubDate>Mon, 10 Jul 2017 07:45:23 &#43;0000</pubDate>
      <author>xxx@example.com (MoeJue)</author>
      <guid>https://zh.moejue.cn/posts/39/</guid>
      <description>
        <![CDATA[<h1>简单的css3头像旋转与3D旋转效果</h1><p>作者：MoeJue（xxx@example.com）</p>
        
          <p>经常会在一些网站看到评论区，评论人的头像当鼠标经过会360°旋转</p>
<p>先看一下效果</p>
<p>.tximg{ height:300px; border-radius:50%; border:2px solid green; /*变化规则*/ transition:all 2s; } .tximg:hover{ /* 变化动作 定义2d旋转，参数填写角度 */ transform:rotate(360deg); } <img src="https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqjenq0ztrj30hs0hsmyu.jpg" alt=""></p>
<p>css部分</p>
<p>img{
height:300px;
border-radius:50%;
border:2px solid green;
/*变化规则*/
transition:all 2s;
}</p>
<p>img:hover{
/*
变化动作
定义2d旋转，参数填写角度
*/
transform:rotate(360deg);
}</p>
<p>HTML部分(很简单，就一张图片)</p>
<img src="http://www.52ecy.cn/log0.png">
<p>3D旋转效果(前台显示样式好像还是冲突了-。-)</p>
<p>.div{ width:300px; height:300px; border:1px solid red; /*如果希望看到3d效果，需要在动的这个元素的父元素，增加一个perspective属性*/ perspective:300px;/*3D 元素距视图的距离，一般与图片的高一致效果最佳*/ } .img{ width:300px; height:300px; border:1px solid red; /*变化规则*/ /*设置旋转元素的原点位置*/ transform-origin:bottom; transition:all 2s; } .img:hover{ /*变化动作*/ transform:rotateX(60deg); }<img src="https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1pgy1fqjenq0ztrj30hs0hsmyu.jpg" alt=""></p>
<p>CSS代码</p>
<p>div{
width:300px;
height:300px;
border:1px solid red;
/*如果希望看到3d效果，需要在动的这个元素的父元素，增加一个perspective属性*/
perspective:300px;/*3D 元素距视图的距离，一般与图片的高一致效果最佳*/
}
img{
width:300px;
height:300px;
border:1px solid red;
/*变化规则*/
/*设置旋转元素的原点位置*/
transform-origin:bottom;
transition:all 2s;
}</p>
        
        <hr><p>本文2017-07-10首发于<a href='https://zh.moejue.cn/'>阿珏酱のBlog</a>，最后修改于2017-07-10</p>]]>
      </description>
      
        <category>css</category>
      
    </item>
    
    

    <item>
      <title>用CSS3绘制iPhone手机</title>
      <link>https://zh.moejue.cn/posts/29/</link>
      <pubDate>Mon, 03 Jul 2017 06:09:01 &#43;0000</pubDate>
      <author>xxx@example.com (MoeJue)</author>
      <guid>https://zh.moejue.cn/posts/29/</guid>
      <description>
        <![CDATA[<h1>用CSS3绘制iPhone手机</h1><p>作者：MoeJue（xxx@example.com）</p>
        
          <p>先上效果图，先睹为快。(这绝对不是一张图片。恩<del>这话怎么怪怪的</del>)</p>
<p>不要问我iPhone几 ，因为我也不知道，没用过，你懂得。</p>
<p><img src="https://image.baidu.com/search/down?url=https://tva1.sinaimg.cn//large/0072Vf1ply1fqi8i9h7fvj308j0fa747.jpg" alt=""><br>
css样式部分</p>
<p>#phone{
width:250px;
height:500px;
background-color:#2E2E2E;
border:10px solid #3B3B3B;
margin:100px auto;
border-radius:30px;/*设置div元素的圆角边框*/
}</p>
<p>#camera{
width:8px;
height:8px;
background-color:#1A1A1A;
border-radius:50%;
border:2px solid #505050;
margin:10px auto;/*距离上边距10px 左右居中*/
}</p>
<p>#receiver{
width:80px;
height:8px;
border:2px solid #505050;
margin:10px auto;
border-radius:10px;
background-color:#1A1A1A;
}</p>
<p>#screen{
width:225px;
height:385px;
background-color:#0A0A0A;
border:3px solid #1C1C1C;
margin:10px auto;
}</p>
<p>#btn{
width:40px;
height:40px;
background:#1A1A1A;
border-radius:50%; /*当宽高相同时，则为圆*/
margin:10px auto;
}</p>
<p>/*:before 选择器在被选元素的内容前面插入内容。*/
#btn:before{
width:22px;
height:22px;
border:2px solid white;
border-radius:30%;
content:&quot;&quot;; /*即使插入的内容为空也需要写，否则不显示*/
display:inline-block;
margin-top:7px;
margin-left:7px;
}</p>
<p>HTML部分</p>
<div id="phone">
	<div id="camera"></div><!-- 摄像头部分-->
	<div id="receiver"></div><!--听筒部分-->
	<div id="screen"></div><!--屏幕部分-->
	<div id="btn"></div><!--按钮部分-->
</div>
<p>晚些我又加了点玩意上去</p>
        
        <hr><p>本文2017-07-03首发于<a href='https://zh.moejue.cn/'>阿珏酱のBlog</a>，最后修改于2017-07-03</p>]]>
      </description>
      
        <category>css</category>
      
    </item>
    
  </channel>
</rss>
