分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 运营维护

前端每日实战3.纯 CSS 创作一个容器厚条纹边框特效

发布时间:2023-09-06 02:25责任编辑:沈小雨关键词:CSS前端

原文地址:3.纯 CSS 创作一个容器厚条纹边框特效

没有啥好点子呀,不爽

HTML代码:

<div class="box"> ???????<div class="content"> ?????????????<h2>What is Lorem Ipsum?</h2> ?????????????<p>Mauris volutpat risus quis nisi tempus hendrerit. Nullam nisi urna, suscipit quis risus sed, congue congue quam. Morbi sit amet suscipit ex. Vivamus vel nulla ac libero volutpat ultrices. ???</p> ??????</div></div>

css代码:

/* 内容居中显示: */html,body,.box .content { ???height: 100%; ???display: flex; ???align-items: center; ???justify-content: center;}/* 画条纹背景: */.box { ???width: 300px; ???height: 300px; ???/* linear-gradient的解说: http://www.runoob.com/cssref/func-linear-gradient.html */ ???background: linear-gradient( ???????-45deg, ???????white 0%, ???????white 25%, ???????hotpink 25%, ???????hotpink 50%, ???????white 50%, ???????white 75%, ???????hotpink 75%, ???????hotpink 100% ???); ???background-size: 10%; ???box-sizing: border-box; ???padding: 15px; ???animation: animate 2s linear infinite;}.box .content { ???background-color: white; ???flex-direction: column; ???box-sizing: border-box; ???padding: 30px; ???text-align: center; ???font-family: sans-serif;}.box,.box .content { ???box-shadow: 0 0 2px deeppink, ???????????????0 0 5px rgba(0, 0, 0, 1), ???????????????inset 0 0 5px rgba(0, 0, 0, 1); ???border-radius: 10px;}.box .content h2 { ???color: deeppink;}.box .content p { ???color: dimgray;}@keyframes animate { ???from { ???????background-position: 0; ???} ???????to { ???????background-position: 10%; ???}}

前端每日实战3.纯 CSS 创作一个容器厚条纹边框特效

原文地址:https://www.cnblogs.com/FlyingLiao/p/10089602.html

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved