前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >GPT代码优化

GPT代码优化

作者头像
破晓之翼
发布2023-05-03 11:10:34
3810
发布2023-05-03 11:10:34
举报
文章被收录于专栏:产品能力产品能力
代码语言:javascript
复制
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>线性渐变</title>
    <style type="text/css">
        .container {
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
            border-radius: 10px;
            padding: 20px;
        }
        .box {
            width: 100px;
            height: 100px;
            margin: 0 50px;
            border-radius: 50%;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 5px;
        }
        .box:nth-child(1) {
            background: linear-gradient(to bottom, yellow, red);
        }
        .box:nth-child(2) {
            background: linear-gradient(to right, yellow, red);
        }
        .box:nth-child(3) {
            background: linear-gradient(to bottom right, red, yellow);
        }
    </style>
</head>
<body>
<!--此处写代码-->
<div class="container">
    <div class="box">上向下发生渐变</div>
    <div class="box">左到右发生渐变</div>
    <div class="box">左上角到右下角发生渐变</div>
</div>
</html>

在CSS中,给.container设置了justify-content: center;和align-items: center;属性,使得三个div元素在水平和垂直方向上都居中显示。另外,添加了box-shadow和border-radius属性,给三个div元素添加了阴影和圆角效果。在.box中,添加了margin: 0 50px;属性,使得三个div元素之间的间隔为50px。
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2023-05-01,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档