div+css布局实现不同形状字母表代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现不同形状字母表代码

代码标签: div css 布局 不同 形状 字母 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
 
<meta charset="UTF-8">
 
 
 
<style>
body {
        margin: 0;
        padding: 0;
        width: 100vw;
        height: 100vh;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
}

.content {
        width: 90vmin;
        height: 90vmin;
        /*background: rgb(252, 239, 239);*/
        display: flex;
        flex-wrap: wrap;
        justify-content: space-evenly;
        align-items: center;
}

.content div {
        /*background-color: #fff;*/
        width: 14vmin;
        height: 14vmin;
        position: relative;
}

.letter-a {
        background:
                conic-gradient(from 153deg at 50% 0%, #2196F360 0 7.5%, #fff0 0 100%),
                conic-gradient(from 153deg at 50% 0%, #2196F360 0 15%, #fff0 0 100%);
}

.letter-b {
        background:
                radial-gradient(circle at 70% 70%, #ff660060 0 29%, #fff0 calc(29% + 1px) 100%),
                radial-gradient(circle at 70% 26%, #ff660060 0 24.5%, #fff0 calc(24.5% + 1px) 100%),
                linear-gradient(90deg, #ff660060 0 70%, #fff0 0 100%);
}

.letter-c {
        background:
                linear-gradient(45deg, #1900ff60 0 50%, #fff0 calc(50% + 1px) 100%),
                linear-gradient(135deg, #1900ff60 0 50%, #fff0 calc(50% + 1px) 100%);
        border-radius: 100%;
}

.letter-d {
        background:
                radial-gradient(circle at 50% 50%, #ff00dd60 0 70%, #fff0 calc(70% + 1px) 100%),
                linear-gradient(90deg, #ff00dd60 0 50%, #fff0 0 100%);
}

.letter-e {
        background:
                linear-gradient(90deg, #00a09860 0 75%, #fff0 0 100%),
                linear-gradient(90deg, #00a09860 0 75%, #fff0 0 100%),
                linear-gradient(90deg, #00a09860 0 50%, #fff0 0 100%),
                linear-gradient(0deg, #00a09860 0 33%, #fff0 0 67%, #00a09860 0 100%);
        background-size: 100% 34%, 100% 34%, 100% 100%, 100% 100%;
        background-repeat: no-repeat;
        background-position: 0 50%,0 50%, 0 0, 0 0;
}

.letter-f {
        background:
                linear-gradient(90deg, #c2000060 0 75%, #fff0 0 100%),
                linear-gradient(90deg, #c2000060 0 75%, #fff0 0 100%),
                linear-gradient(90deg, #c2000060 0 50%, #fff0 0 100%),
                linear-gradient(0deg, #fff0 0 67%, #c2000060 0 100%);
        background-size: 100% 34%, 100% 34%, 100% 100%, 100% 100%;
        background-repeat: no-repeat;
        background-position: 0 50%, 0 50%, 0 0, 0 0;
}



.letter-g {
        background:
                radial-gradient(circle at 0 0, #18d10060 0 70%, #fff0 0 100%),
                conic-gradient(from 90deg at 50% 50%, #18d10060 0 88%, #fff0 88% 100%);
        border-radius: 100% 100% 0 100%;
        background-repeat: no-repeat;
        background-size: 50% 50%, 100% 100%;
        background-position: 100% 100% , 0 0;
}

.letter-h {
        background:
                linear-gradient(90deg, #ff008c60 0 100%),
                linear-gradient(0deg, #fff0 0 33%, #ff008c60 0 66%, #fff0 0 100%),
                linear-gradient(90deg, #fff0 0 50%, #ff008c60 0 100%) ;
}

.letter-i {
        background: linear-gradient(90deg, #fff0 0 30%, #fdf900cc 0 70%, #fff0 0 100%) ;
}

.letter-j {
        background:
                radial-gradient(circle at 0 100%, #69b90060 0 70%, #fff0 0 100%),
                conic-gradient(from 0deg at 50% 50%, #69b90060 0 75%, #fff0 75% 100%);
        border-radius: 100% 0 100% 100%;
        background-repeat: no-repeat;
        background-size: 50% 50%, 100% 100%;
        background-position: 100% 0% , 0 0;
}.........完整代码请登录后点击上方下载按钮下载查看

网友评论0