css特效大全(css动画效果网站)

admin 530 0

其实css特效大全的问题并不复杂,但是又很多的朋友都不太了解css动画效果网站,因此呢,今天小编就来为大家分享css特效大全的一些知识,希望可以帮助到大家,下面我们一起来看看这个问题的分析吧!

一、css3鼠标移入特效:如何实现div颜色渐变和放大缩小的效果

本篇文章给大家带来的内容是关于css3中如何利用transition实现鼠标悬停的时候div的颜色、高度和宽度都改变的效果,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。

我们平时在浏览web网页的时候会见到这样一种情况:当鼠标悬停的某个区域的时候,该区域的形状会在指定时间内进行放大或者缩小的变化,甚至在变化大小的同时会出现颜色的渐变。这种特殊效果是如何实现的呢?现在由我来向大家介绍一下在css3中如何使用transition属性和hover属性实现div颜色渐变和放大缩小的效果。

transition属性是一个简写属性,用于四个过度属性,分别是transition-property,transition-duration,transition-timing-function和transition-delay。

transition-property:要运动的样式(默认值为all,可以有三种定义:all、attr和none)

transition-duration:运动时间(只有运动时间是必需值并且不能为0,否则transition不会有任何效果)

transition-timing-function:运动形式(用法包括以下六种)

ease-in-out:(先加速后减速)

cubic-bezier贝塞尔曲线:( x1, y1, x2, y2)

注意:其中如果没有定义的话,transition-timing-function默认值为ease。

transition-delay:延迟时间(默认值为0)

transition属性和浏览器的兼容(根据W3C标准)

Internet Explorer 10、Firefox、Opera和Chrome等高版本浏览器支持transition属性标准写法。Safari支持替代的-webkit-transition属性。但是Internet Explorer 9以及更早版本的浏览器不支持transition属性。

<title>transition</title>

transition-timing-function:ease;

<div class="box"></div>

</html> css3鼠标移入特效实现效果如图所示

更多炫酷CSS3、html5、javascript特效代码,尽在:javascript特效大全

二、详解vue、css3如何实现交互特效

本文主要介绍了详解vue+css3做交互特效的方法,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧,希望能帮助到大家。

做项目就难免会开发交互效果或者特效,而我最近开发的项目一直在使用vue,开发技术栈方面,理所当然就使用了vue+css3开发,过程中发现使用vue+css3开发特效,和javascript/jquery+css3的思维方式不一样,但是比javascript/jquery+css3简单一点点。今天就分享三个简单的小实例,希望能起到拓展思维的作用,让大家明白vue+css3应该怎样开发交互效果!如果大家有什么好的建议,或者觉得我哪里写错了,欢迎指出!

1.文章上面的代码,虽然代码很简单,不难理解,但是也是建议大家边写边看,这样不会混乱。

2.文章所提及的小实例,都是很基础的,大家可以参照自己的想法进行扩展,或者修改,可能会有意想不到的效果。我写这类型的文章也是想授人以渔,不是授人以鱼!

3.这几个实例,摘自我自己的平常练习的项目,代码已经提到github上面了(vue-demos)。欢迎大家star。

gif图模糊效果看着跟实际效果不太一样!大家注意!

说到原理分析,其实也没什么可以分析的,就是在页面是下面这个状态的时候,把文字替换掉。至于看到字体缩成一团,就是letter-spacing这个css属性的控制效果。字体模糊就是filter: blur()这个css属性的控制效果!看到有逐渐的变化,就是css3动画(animation)的效果

下面简单分析下,这个动画的几个步骤,从下面看到,这个动画一共8个步骤。

这下就清晰明了了,我们要在下图这个瞬间开始改变文字,也就是页面加载了两秒后,动画执行了两次后就开始改变文字。然后每隔两秒改变一次文字,直到最后!

下面给出vue和javascript两种方式的代码,看下哪种方式更加的简单!

<title>Title</title>

animation: letterspacing 1s 7 alternate ease-in-out;

<h1>{{testText}}</h1>

<script src="vue.min.js"></script>

<script type="text/javascript">

let timer= setInterval(function(){

_this.testText='守候的文章';

_this.testText='愿您浏览愉快';

_this.testText='学到知识';

<title>Title</title>

animation: letterspacing 1s 7 alternate ease-in-out;

var oH1=document.querySelector('h1'),nowIndex=0;

var timer= setInterval(function(){

oH1.innerHTML='守候的文章';

oH1.innerHTML='愿您浏览愉快';

oH1.innerHTML='学到知识';

</html>3.导航滑块运行效果

首先,下面是页面初始化的时候,橙色滑块的位置

鼠标放到第二个tab上面,大家可以看到,橙色滑块就是向右偏移了一个tab的距离

鼠标放到第三个tab上面,大家可以看到,橙色滑块就是向右偏移了两个tab的距离

如果从第一个tab到第六个tab的索引是0,1,2,3,4,5。

那么滑块的公式就是(索引*tab的宽度)。大家看到有逐渐过去的效果,其实是css3过渡(transition)的效果。大家看下面的代码就行了,一看就懂!代码如下:

<title>Title</title>

<link rel="stylesheet" href="reset.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow">

transition: all.5s cubic-bezier(0.4,-0.3, 0.57, 1.38);

<p class="nav clear" id="nav"@mouseleave="nowIndex=0">

<li@mouseenter.stop="nowIndex=0"><span>Tab One</span></li>

<li@mouseenter.stop="nowIndex=1"><span>Tab Two</span></li>

<li@mouseenter.stop="nowIndex=2"><span>Tab Three</span></li>

<li@mouseenter.stop="nowIndex=3"><span>Tab four</span></li>

<li@mouseenter.stop="nowIndex=4"><span>Tab five</span></li>

<li@mouseenter.stop="nowIndex=5"><span>Tab six</span></li>

<p class="slider":style="{'transform':'translate3d('+nowIndex*100+'px,0,0)'}"></p>

<script src="vue.min.js"></script>

<script type="text/javascript">

<title>Title</title>

<link rel="stylesheet" href="reset.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow">

transition: all.5s cubic-bezier(0.4,-0.3, 0.57, 1.38);

<p class="nav clear" id="nav">

<li><span>Tab One</span></li>

<li><span>Tab Two</span></li>

<li><span>Tab Three</span></li>

<li><span>Tab four</span></li>

<li><span>Tab five</span></li>

<li><span>Tab six</span></li>

<p class="slider"></p>

<script type="text/javascript">

var op=document.querySelector("#nav"),oLi=op.querySelectorAll("li"),oSlider=document.querySelector(".slider");

op.addEventListener("mouseleave",function(){

oSlider.style.transform='translate3d(0,0,0)';

for(var i=0;i<oLi.length;i++){

oLi[i].addEventListener("mouseenter",function(e){

oSlider.style.transform='translate3d('+this.index*100+'px,0,0)';

看到上面,其实也就是控制ul的偏移量(transform:translate3d)。计算公式和上面的滑块相似,索引(0|1|2|3)*li的宽度。不同的就是,ul的偏移量是取负数,因为ul是想左偏,上面的滑块是向右偏!

当第一张图片的时候,ul偏移量设置(transform: translate3d(0px, 0px, 0px))。

当第二张图片的时候,ul偏移量设置(transform: translate3d(-1000px, 0px, 0px))。

当第二张图片的时候,ul偏移量设置(transform: translate3d(-2000px, 0px, 0px))。以此类推,偏移量很简单的就能计算出来!

可能我说的大家有点懵,但是,看下面的代码,就不会懵了,因为代码也很简单!

<title>Title</title>

<link rel="stylesheet" href="reset.css" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow">

background: url("http://i1.bvimg.com/1949/4d860a3067fab23b.jpg") no-repeat;

三、css 添加板块背景图片

http://hi.baidu.com/tchzx/blog/item/c8a3d613131cae025baf53b0.html

跟我一起玩百度空间CSS教程+090+(从"零"开始学玩百度空间)

http://hi.baidu.com/tchzx/blog/item/c8a3d613131cae025baf53b0.html

谭诚工作室: http://hi.baidu.com/tchzx

1.让你看懂css各个参数http://hi.baidu.com/tchzx/blog/item/1e0453e7c351052eb838200d.html

2.百度空间CSS使用说明http://hi.baidu.com/tchzx/blog/item/b360d33fddd2b0c27c1e714a.html

3.怎样编写CSS的! http://hi.baidu.com/tchzx/blog/item/d75fd7a2f36821adcaefd0e1.html

4.CSS代码解密http://hi.baidu.com/tchzx/blog/item/f106f71f339b06f5e1fe0bfe.html

5.一个CSS的漏洞http://hi.baidu.com/tchzx/blog/item/c1e74cfb9c6c8164024f560d.html

6.增加自定义模块功能http://hi.baidu.com/tchzx/blog/item/c207c91b9f69d7faae513303.html

7.更换主体及文章的背景http://hi.baidu.com/tchzx/blog/item/f7b0d609ad57ba82d0581b15.html

8.透明flash代码http://hi.baidu.com/tchzx/blog/item/5012e1cd15168a510eb345e3.html

9.百度空间十大宝藏http://hi.baidu.com/tchzx/blog/item/7e3daa6eb9da40da80cb4a62.html

10.制作个性化的标题栏http://hi.baidu.com/tchzx/blog/item/ae077109a6518aaf2fddd434.html

11.看到更多的百度空间http://hi.baidu.com/tchzx/blog/item/dbe16c634f5e47600d33fa07.html

12.百度空间的8个优缺点http://hi.baidu.com/tchzx/blog/item/75d054432e8b9e119213c606.html

13.专栏分割线的代码修改http://hi.baidu.com/tchzx/blog/item/32c416df0880ac1362279831.html

14.添加自己的LOGO图片http://hi.baidu.com/tchzx/blog/item/0bee1a9599002e087af48000.html

15.宣传百度空间的方法http://hi.baidu.com/tchzx/blog/item/a8f9758b7e459512c9fc7a59.html

16.添加多首背景音乐http://hi.baidu.com/tchzx/blog/item/5339282e42b2bd504ec22617.html

17.设置透明背景图http://hi.baidu.com/tchzx/blog/item/f4cb90dd7fad81345882ddb6.html

18.更改空间的鼠标样式http://hi.baidu.com/tchzx/blog/item/50c2c15cc3d17f43faf2c0b6.html

19.在空间里加入滚动条http://hi.baidu.com/tchzx/blog/item/702631d319d09a003bf3cfb6.html

20.透明的背景音乐的播放器http://hi.baidu.com/tchzx/blog/item/97f7b909d38ada246a60fbb6.html

21.透明个性化滚动条http://hi.baidu.com/tchzx/blog/item/3013b5fbeaff41224e4aeab6.html

22.给链接添加背景色效果代码http://hi.baidu.com/tchzx/blog/item/effb6427fc39db03908f9db6.html

23.显示"点击给你发消息"怎么在空间做! http://hi.baidu.com/tchzx/blog/item/62e02f3893d9c524b9998fb6.html

24.去掉文章题目下划线http://hi.baidu.com/tchzx/blog/item/ce8c044f1019db36aec3abb6.html

25.常用插入图片位置的代码http://hi.baidu.com/tchzx/blog/item/83257c89c9b823b30e2444b5.html

26.如何隐藏播放器而不影响音乐播放http://hi.baidu.com/tchzx/blog/item/e4233edbfb147e66d1164eb5.html

27.如何有字体阴影http://hi.baidu.com/tchzx/blog/item/b1d78094e72b511ed31b70b5.html

28.自制闪字空间名称http://hi.baidu.com/tchzx/blog/item/df49ca114a626b10b8127bb5.html

29.解决回车换两行的问题http://hi.baidu.com/tchzx/blog/item/b420a086e4fe533e66096eb5.html

30.调整一下行距http://hi.baidu.com/tchzx/blog/item/b8bc514e84b1fd09b2de05b5.html

31.让空间拥有精美flash背景http://hi.baidu.com/tchzx/blog/item/5fc12af5ea17b525bd3109b5.html

32.让空间自动弹出对话框!http://hi.baidu.com/tchzx/blog/item/5339282e4cd0b7504ec226b5.html

33.修改blog显示的文字颜色大小http://hi.baidu.com/tchzx/blog/item/691c36ad2e075a094a36d6b5.html

34.如何让你的浏览器滚动条变色http://hi.baidu.com/tchzx/blog/item/af686238d73fbd2396ddd8b5.html

35.为评论和链接加上图片http://hi.baidu.com/tchzx/blog/item/b2c26759e6c5f82a2934f0b5.html

36.如何在"其它"下面加上图片http://hi.baidu.com/tchzx/blog/item/6c1f975228ca5e0e0df3e3b5.html

37.百度空间的名称如何用艺术字?http://hi.baidu.com/tchzx/blog/item/0738f00331678cec09fa93b5.html

38.百度空间文字发光的方法http://hi.baidu.com/tchzx/blog/item/d5b9ff19f8f01a7adbb4bdb5.html

39.文字快速插链接http://hi.baidu.com/tchzx/blog/item/ca2b7e3166bd9f19eac4afb5.html

40.空间模块巧移动http://hi.baidu.com/tchzx/blog/item/b4abaa4b8efb5ff083025cb4.html

41.个性化你的IP显示,自定义颜色http://hi.baidu.com/tchzx/blog/item/378ed71659cc8718962b43b4.html

42.全透明http://hi.baidu.com/tchzx/blog/item/c12a7a1e97f322f41ad576b4.html

43.空间背景半透明http://hi.baidu.com/tchzx/blog/item/b4e8bda1faf95e8b461064b4.html

44.如何在百度空间的文章标题周围加花边图案?http://hi.baidu.com/tchzx/blog/item/55a6221fbf22fdc8a68669b4.html

45.关于百度空间照片大小限制的问题!!! http://hi.baidu.com/tchzx/blog/item/f7b0d609ab36b082d0581bb4.html

46.如何在百度空间发表文章时插入FLESH动画?http://hi.baidu.com/tchzx/blog/item/f106f71f32c101f5e1fe0bb4.html

47.怎样换百度空间的背景http://hi.baidu.com/tchzx/blog/item/c94729dd492b50d98c1029b4.html

48.做分割线的方法http://hi.baidu.com/tchzx/blog/item/f6fbb77e136749380dd7dab4.html

49.在百度空间里面添加自己的特效http://hi.baidu.com/tchzx/blog/item/69db8044561f364c500ffeb4.html

50.在文章中快速插入图片http://hi.baidu.com/tchzx/blog/item/437f5eee9b8a79fbb3fb95b4.html

51.添加计数器的两种方法http://hi.baidu.com/tchzx/blog/item/0731f5d3cecb3ddfa8ec9ab4.html

52.如何在空间顶部加入图片http://hi.baidu.com/tchzx/blog/item/4b9b8cd437fbab01a08bb7b4.html

53.发表评论框的图片http://hi.baidu.com/tchzx/blog/item/b4abaa4b8ef45ff083025cab.html

54.改变空间主页名称和简介的字体大小http://hi.baidu.com/tchzx/blog/item/7e3daa6e94237dda80cb4aab.html

55.给超链接添加按钮效果http://hi.baidu.com/tchzx/blog/item/95f73d292412ccfe98250aab.html

56.如何给评论框添加背景http://hi.baidu.com/tchzx/blog/item/c26ece17518b4b09c83d6df9.html

57.Iframe用法的详细讲解http://hi.baidu.com/tchzx/blog/item/e23e207f172e2b0828388a8e.html

58.背景图片素材01 http://hi.baidu.com/tchzx/blog/item/bc11d02aa2db092dd52af10f.html

59.图片素材20060929 http://hi.baidu.com/tchzx/blog/item/6d12563d821675ee3c6d970e.html

60.我的自定义设计 http://hi.baidu.com/tchzx/blog/item/3c6ab5b731ac21f431add193.html

61.CSS鼠标样式大全 http://www.hi128.cn/?250/action_viewspace_itemid_37.html

62.跟我一起玩百度空间的音乐和视频+ http://hi.baidu.com/tchzx/blog/item/398833a85082a0b1ca130c21.html

63.为<好友列表>增加一个滚动条 http://hi.baidu.com/tchzx/blog/item/b54a0bf4d32be5ef7709d70b.html

64.空间模块巧移动+文字快速插链接 http://hi.baidu.com/tchzx/blog/item/d6369b82c9d0e2bf6d811914.html

65.怎么去掉百度空间里模块的框框!http://hi.baidu.com/tchzx/blog/item/5012e1cd2f64b0510eb345b1.html

66.基本颜色代码+ http://hi.baidu.com/tchzx/blog/item/e3f0317aa7d065ed2f73b329.html

67.在你的空间中加入幽默元素.. http://hi.baidu.com/tchzx/blog/item/5612858b86b287d3fc1f10f0.html

68.百度空间吧[精品]贴+ http://hi.baidu.com/tchzx/blog/item/06cf65d06bb7be8fa1ec9cf9.html

69.如何在博客上---中--下加入图片(时钟)http://hi.baidu.com/tchzx/blog/item/8e2cb0452fc7b226cefca333.html

72.教你10个你未必知道的CSS技巧! http://hi.baidu.com/tchzx/blog/item/ee3cb41c0680918b86d6b60e.html

73.用CSS进行百度空间样式设计! http://hi.baidu.com/tchzx/blog/item/f7b0d609a75eac82d0581b0c.html

74.百度空间自动友情链接 http://hi.baidu.com/tchzx/blog/item/f235a64477276882b2b7dc98.html

75.一起玩百度空间帮助 http://hi.baidu.com/tchzx/blog/item/e4233edbfee96366d0164e98.html

76.一起玩百度空间榜单 http://hi.baidu.com/tchzx/blog/item/5173043b98a1f8ea15cecb99.html

77.点对点宣传百度空间 http://hi.baidu.com/tchzx/blog/item/e859cc13444c3823dc540164.html

78.百度空间常见27+问题 http://hi.baidu.com/tchzx/blog/item/9636b38f8c02a5eef11f365a.html

79.怎样让百度、Google搜到你的博客 http://hi.baidu.com/tchzx/blog/item/3c6ab5b70df03df430add15f.html

80.如何加上一个个性时间网页上?http://hi.baidu.com/tchzx/blog/item/f467a7ec9522603d279791a5.html

81.教你怎样让背景自动更新,包括头背景 http://hi.baidu.com/tchzx/blog/item/92eb968f3bd93afa503d927a.html

82.在 CSS中关于字体处理效果的思考 http://hi.baidu.com/tchzx/blog/item/4ac6be3876097ac2d4622526.html

83.如何置顶文章及美化自定意模块! http://hi.baidu.com/tchzx/blog/item/6c1f97523edf440e0df3e382.html

84.如何美化页眉部分 http://hi.baidu.com/tchzx/blog/item/d6f1ecc4d2bb75a98326ac83.html

85.更换背景及滚动轴颜色和空间半透代码 http://hi.baidu.com/tchzx/blog/item/4dd018306adb8e99a8018e8c.html

86.如何设置标题.简介及文章字体为光晕字 http://hi.baidu.com/tchzx/blog/item/55a6221f8acae6c8a786698c.html

87.用CSS来控制网页背景 http://hi.baidu.com/tchzx/blog/item/cce94b08ec6526950b7b8228.html

88.CSS产生的特殊效果 http://hi.baidu.com/tchzx/blog/item/e763a11ebdb7c61f40341728.html

89.用Css控制IE5.5浏览器中滚动条 http://hi.baidu.com/tchzx/blog/item/4dd0183097408399a8018e29.html

90.css语法(百度空间) http://hi.baidu.com/tchzx/blog/item/e5e21ed8ac5b8a3532fa1c29.html

如果你还想了解更多这方面的信息,记得收藏关注本站。