设为首页收藏本站
网站公告 | 这是第一条公告
     

 找回密码
 立即注册
缓存时间17 现在时间17 缓存数据 这个世界上很多东西会变,很多人会走。 但你在我心里,从开始的那一天,到现在从来没有变过。 我一直在等,等你的消息。

这个世界上很多东西会变,很多人会走。 但你在我心里,从开始的那一天,到现在从来没有变过。 我一直在等,等你的消息。 -- 盛夏的果实

查看: 1252|回复: 6

css3鼠标滑过实现动画线条边框

[复制链接]

  离线 

TA的专栏

  • 打卡等级:热心大叔
  • 打卡总天数:203
  • 打卡月天数:0
  • 打卡总奖励:2995
  • 最近打卡:2023-08-27 06:14:36
等级头衔

等級:晓枫资讯-上等兵

在线时间
0 小时

积分成就
威望
0
贡献
369
主题
341
精华
0
金钱
4080
积分
736
注册时间
2022-12-23
最后登录
2025-6-1

发表于 2023-5-11 21:08:01 | 显示全部楼层 |阅读模式

前言

  1. 现如今网页越来越趋近于动画,相信大家平时浏览网页或多或少都能看到一些动画效果,今天我们做一个通过 <strong>css3</strong> 鼠标滑过实现动画线条边框,下面一起看看吧。
复制代码

实现效果

220915u8z2l9jjrljfz1jr.gif

CSS3实现的鼠标滑过边框线条动画特效源码

完整源码

  1. <template>
  2. <div class="parentBox">
  3. <div class="contantBox">
  4. <ul class="shelfBox">
  5. <li>
  6. <div class="bigBox">
  7. <div class="itemBox">
  8. <div class="textBox">
  9. <p>1.无需下载安装包</p>
  10. <p>2.可多人同时编辑</p>
  11. <p>3.无需下载安装包</p>
  12. <p>4.可实时预览内容</p>
  13. </div>
  14. <div class="beginbox"></div>
  15. <div class="bomBox"></div>
  16. <div class="leftBox"></div>
  17. <div class="topBox"></div>
  18. <div class="rightBox"></div>
  19. <div class="pictureBox"><i class="circleBox"></i></div>
  20. </div>
  21. <div class="iconBox">
  22. <div class="circleBox">+</div>
  23. </div>
  24. </div>
  25. </li>
  26. </ul>
  27. </div>
  28. </div>
  29. </template>
  30. <style scoped>
  31. .parentBox {
  32. margin: 0;
  33. padding: 0;
  34. border: 0;
  35. font: inherit;
  36. font-size: 100%;
  37. vertical-align: baseline
  38. }
  39. ol,
  40. ul {
  41. list-style: none
  42. }
  43. table {
  44. border-collapse: collapse;
  45. border-spacing: 0
  46. }
  47. caption,
  48. td,
  49. th {
  50. text-align: left;
  51. font-weight: 400;
  52. vertical-align: middle
  53. }
  54. .bigBox img {
  55. border: none
  56. }
  57. .bigBox {
  58. text-decoration: none
  59. }
  60. .bigBox:hover {
  61. cursor: pointer;
  62. }
  63. img {
  64. max-width: 100%;
  65. vertical-align: middle
  66. }
  67. .shelfBox:after,
  68. .shelfBox:before {
  69. content: " ";
  70. display: table
  71. }
  72. .shelfBox:after {
  73. clear: both
  74. }
  75. .contantBox {
  76. position: relative;
  77. background-color: #fff;
  78. zoom: 1
  79. }
  80. .contantBox ul {
  81. position: absolute;
  82. left: 0;
  83. top: 0;
  84. width: 1218px;
  85. height: 432px;
  86. padding-top: 5px;
  87. transition: left .8s ease-in-out
  88. }
  89. .contantBox li {
  90. float: left;
  91. width: 406px;
  92. height: 216px
  93. }
  94. .contantBox li .bigBox {
  95. position: relative;
  96. display: block;
  97. width: 100%;
  98. height: 216px;
  99. padding: 10px 0 0 92px;
  100. zoom: 1
  101. }
  102. .contantBox .itemBox {
  103. position: relative;
  104. width: 274px;
  105. height: 186px;
  106. padding: 20px 0 0 60px;
  107. background: url('https://hovertree.com/texiao/css3/32/images/hovertree10tanjpxxxxblxpxxxxxxxxxx-274-186.png') 0 0 no-repeat;
  108. color: #00a0ff;
  109. zoom: 1
  110. }
  111. .textBox {
  112. color: #666;
  113. }
  114. .textBox p{
  115. margin: 14px 10px;
  116. }
  117. .contantBox .beginbox {
  118. position: absolute;
  119. bottom: -2px;
  120. right: -2px;
  121. width: 34px;
  122. height: 10px;
  123. background-color: #fff
  124. }
  125. .contantBox .bomBox {
  126. position: absolute;
  127. left: -2px;
  128. bottom: -2px;
  129. width: 295px;
  130. height: 15px;
  131. background-color: #fff
  132. }
  133. .contantBox .leftBox {
  134. position: absolute;
  135. left: -2px;
  136. top: -2px;
  137. width: 15px;
  138. height: 189px;
  139. background-color: #fff
  140. }
  141. .contantBox .topBox {
  142. position: absolute;
  143. right: -2px;
  144. top: -2px;
  145. width: 295px;
  146. height: 15px;
  147. background-color: #fff
  148. }
  149. .contantBox .rightBox {
  150. position: absolute;
  151. right: -2px;
  152. bottom: -2px;
  153. width: 15px;
  154. height: 189px;
  155. background-color: #fff
  156. }
  157. .contantBox .iconBox {
  158. position: absolute;
  159. left: 53px;
  160. top: 35px;
  161. width: 100px;
  162. height: 110px;
  163. padding-top: 12px;
  164. background-color: #fff;
  165. z-index: 11
  166. }
  167. .contantBox .iconBox .circleBox {
  168. width: 80px;
  169. height: 80px;
  170. line-height: 80px;
  171. background: url('https://hovertree.com/texiao/css3/32/images/hovertree1.fjxivxxxxbqxvxxxxxxxxxx-80-80.png') 0 0 no-repeat;
  172. text-align: center;
  173. color: #359EFB;
  174. font-size: 28px;
  175. }
  176. .contantBox .iconBox .iconfont {
  177. font-size: 32px;
  178. color: #00a0ff
  179. }
  180. .contantBox .pictureBox {
  181. position: absolute;
  182. right: -8px;
  183. bottom: -3px;
  184. width: 0;
  185. height: 16px;
  186. background-color: #fff;
  187. overflow: hidden
  188. }
  189. .contantBox .pictureBox .circleBox {
  190. float: right;
  191. width: 17px;
  192. height: 16px;
  193. background: url('https://hovertree.com/texiao/css3/32/images/hovertree15pjohvxxxxcaxpxxxxxxxxxx-16-16.png') 0 0 no-repeat
  194. }
  195. .contantBox .bigBox:hover .textBox {
  196. color: #00a0ff
  197. }
  198. .contantBox .bigBox:hover .bomBox {
  199. animation: borderslideBottom .15s linear 0s 1;
  200. animation-fill-mode: forwards
  201. }
  202. .contantBox .bigBox:hover .leftBox {
  203. animation: bordersildeLeft .2s linear .15s 1;
  204. animation-fill-mode: forwards
  205. }
  206. .contantBox .bigBox:hover .topBox {
  207. animation: bordersildeTop .15s linear .35s 1;
  208. animation-fill-mode: forwards
  209. }
  210. .contantBox .bigBox:hover .rightBox {
  211. animation: bordersildeRight .2s linear .5s 1;
  212. animation-fill-mode: forwards
  213. }
  214. .contantBox .bigBox:hover .pictureBox {
  215. animation: bordersildeEnd .1s linear .7s 1;
  216. animation-fill-mode: forwards
  217. }
  218. @-moz-keyframes borderslideBottom {
  219. from {
  220. width: 295px
  221. }
  222. to {
  223. width: 0
  224. }
  225. }
  226. @-webkit-keyframes borderslideBottom {
  227. from {
  228. width: 295px
  229. }
  230. to {
  231. width: 0
  232. }
  233. }
  234. @keyframes borderslideBottom {
  235. from {
  236. width: 295px
  237. }
  238. to {
  239. width: 0
  240. }
  241. }
  242. @-moz-keyframes bordersildeLeft {
  243. from {
  244. height: 189px
  245. }
  246. to {
  247. height: 0
  248. }
  249. }
  250. @-webkit-keyframes bordersildeLeft {
  251. from {
  252. height: 189px
  253. }
  254. to {
  255. height: 0
  256. }
  257. }
  258. @keyframes bordersildeLeft {
  259. from {
  260. height: 189px
  261. }
  262. to {
  263. height: 0
  264. }
  265. }
  266. @-moz-keyframes bordersildeTop {
  267. from {
  268. width: 295px
  269. }
  270. to {
  271. width: 0
  272. }
  273. }
  274. @-webkit-keyframes bordersildeTop {
  275. from {
  276. width: 295px
  277. }
  278. to {
  279. width: 0
  280. }
  281. }
  282. @keyframes bordersildeTop {
  283. from {
  284. width: 295px
  285. }
  286. to {
  287. width: 0
  288. }
  289. }
  290. @-moz-keyframes bordersildeRight {
  291. from {
  292. height: 189px
  293. }
  294. to {
  295. height: 0
  296. }
  297. }
  298. @-webkit-keyframes bordersildeRight {
  299. from {
  300. height: 189px
  301. }
  302. to {
  303. height: 0
  304. }
  305. }
  306. @keyframes bordersildeRight {
  307. from {
  308. height: 189px
  309. }
  310. to {
  311. height: 0
  312. }
  313. }
  314. @-moz-keyframes bordersildeEnd {
  315. from {
  316. width: 0
  317. }
  318. to {
  319. width: 34px
  320. }
  321. }
  322. @-webkit-keyframes bordersildeEnd {
  323. from {
  324. width: 0
  325. }
  326. to {
  327. width: 34px
  328. }
  329. }
  330. @keyframes bordersildeEnd {
  331. from {
  332. width: 0
  333. }
  334. to {
  335. width: 34px
  336. }
  337. }
  338. </style>
复制代码

到此这篇关于css3鼠标滑过实现动画线条边框的文章就介绍到这了,更多相关css3动画线条边框内容请搜索晓枫资讯以前的文章或继续浏览下面的相关文章,希望大家以后多多支持晓枫资讯!


免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
晓枫资讯-科技资讯社区-免责声明
免责声明:以上内容为本网站转自其它媒体,相关信息仅为传递更多信息之目的,不代表本网观点,亦不代表本网站赞同其观点或证实其内容的真实性。
      1、注册用户在本社区发表、转载的任何作品仅代表其个人观点,不代表本社区认同其观点。
      2、管理员及版主有权在不事先通知或不经作者准许的情况下删除其在本社区所发表的文章。
      3、本社区的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,举报反馈:点击这里给我发消息进行删除处理。
      4、本社区一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
      5、以上声明内容的最终解释权归《晓枫资讯-科技资讯社区》所有。
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~

  离线 

TA的专栏

  • 打卡等级:即来则安
  • 打卡总天数:17
  • 打卡月天数:0
  • 打卡总奖励:231
  • 最近打卡:2025-03-31 10:10:50
等级头衔

等級:晓枫资讯-列兵

在线时间
0 小时

积分成就
威望
0
贡献
0
主题
0
精华
0
金钱
266
积分
38
注册时间
2023-2-18
最后登录
2025-3-31

发表于 2023-5-19 07:21:33 | 显示全部楼层
谢谢分享~~~~~
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~

  离线 

TA的专栏

  • 打卡等级:即来则安
  • 打卡总天数:26
  • 打卡月天数:0
  • 打卡总奖励:344
  • 最近打卡:2025-03-15 10:15:00
等级头衔

等級:晓枫资讯-列兵

在线时间
0 小时

积分成就
威望
0
贡献
0
主题
0
精华
0
金钱
388
积分
56
注册时间
2023-1-27
最后登录
2025-3-15

发表于 2023-8-7 18:56:55 | 显示全部楼层
感谢楼主分享~~~~~
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~

  离线 

TA的专栏

等级头衔

等級:晓枫资讯-列兵

在线时间
0 小时

积分成就
威望
0
贡献
0
主题
0
精华
0
金钱
21
积分
22
注册时间
2022-12-24
最后登录
2022-12-24

发表于 2024-8-20 12:14:44 | 显示全部楼层
顶顶更健康!!!
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~

  离线 

TA的专栏

等级头衔

等級:晓枫资讯-列兵

在线时间
0 小时

积分成就
威望
0
贡献
0
主题
0
精华
0
金钱
11
积分
2
注册时间
2024-10-25
最后登录
2024-10-25

发表于 2024-12-7 01:44:08 | 显示全部楼层
路过,支持一下
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~

  离线 

TA的专栏

等级头衔

等級:晓枫资讯-列兵

在线时间
0 小时

积分成就
威望
0
贡献
0
主题
0
精华
0
金钱
15
积分
10
注册时间
2022-12-29
最后登录
2022-12-29

发表于 2025-1-6 04:34:20 | 显示全部楼层
感谢楼主,顶。
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~

  离线 

TA的专栏

等级头衔

等級:晓枫资讯-列兵

在线时间
0 小时

积分成就
威望
0
贡献
0
主题
0
精华
0
金钱
18
积分
16
注册时间
2022-12-30
最后登录
2022-12-30

发表于 2025-3-17 05:16:36 | 显示全部楼层
感谢楼主分享。
http://bbs.yzwlo.com 晓枫资讯--游戏IT新闻资讯~~~
严禁发布广告,淫秽、色情、赌博、暴力、凶杀、恐怖、间谍及其他违反国家法律法规的内容。!晓枫资讯-社区
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1楼
2楼
3楼
4楼
5楼
6楼
7楼

手机版|晓枫资讯--科技资讯社区 本站已运行

CopyRight © 2022-2025 晓枫资讯--科技资讯社区 ( BBS.yzwlo.com ) . All Rights Reserved .

晓枫资讯--科技资讯社区

本站内容由用户自主分享和转载自互联网,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。

如有侵权、违反国家法律政策行为,请联系我们,我们会第一时间及时清除和处理! 举报反馈邮箱:点击这里给我发消息

Powered by Discuz! X3.5

快速回复 返回顶部 返回列表