首页 web前端 css教程 如何使用纯CSS3绘制26个英文字母的示例详解

如何使用纯CSS3绘制26个英文字母的示例详解

Jul 22, 2017 am 10:03 AM
css css3

                                                                纯CSS3绘制26个英文字母

     在这里你看到的26个标准的英文字母并不是普通的字体,它们是用CSS在空白的页面上绘制出来的,纯css作品。主要运用了CSS3里的多个新变换功能,需要使用最新的浏览器进行观赏。

       网页代码中用到( 

)和p边距设置和浮动(margin:20px 5px 10px 80px; float: left;)。其中边距Margin四个像素依次代表:上右下左。

       以下按字母表顺序,列出绘制26个字母的CSS。

      

   .A{
      position:relative;
      margin:10px 30px 10px 5px;  /*上右下左 */
      float: left;
      left:30px;
      width:60px;
      height:91px;
      border-bottom:solid 14px #0feee2;
    }
    .A:before{
      transform:skew(-19deg,0);
      position:absolute;
      content:'';
      top:12.5px;
      left:0;
      width:16px;
      height:125px;
      background-color:#0feee2;
    }
    .A:after{
      transform:skew(19deg,0);
      position:absolute;
      content:'';
      top:12.5px;
      left:45px;
      width:16px;
      height:125px;
      background-color:#0feee2;
    }
登录后复制

  .B{
      position:relative;
      margin:10px 20px 10px 30px;
      float: left;
      top:12.5px;
      left:10px;
      width:60px;
      height:125px;
      border-left:solid 16px #2056cd;
    }
    .B:before{
      position:absolute;
      content:'';
      width:52px;
      height:39px;
      border-width:15px 15px 10px 0;
      border-color:#2056cd;
      border-style:solid;
      border-radius:0 240%180%0 /0 180%180%0;
   }
   .B:after{
      position:absolute;
      content:'';
      bottom:0;
      width:58px;
      height:43px;
      border-width:10px 15px 15px 0;
      border-color:#2056cd;
      border-style:solid;
      border-radius:0 180%220%0 /0 180%180%0;
     }
登录后复制


   .C{
       position:relative;
       margin:10px 5px 10px 10px;
       float: left;
       top:12.5px;
       left:10px;
       width:84px;
       height:95px;
       border-width:15px 12px 15px 16px;
       border-color:#87adef;
       border-style:solid;
       border-radius:50%;
     }
     .C:before{
       transform:rotate(45deg);
       position:absolute;
       content:'';
       top:2px;
       left:49px;
       width:90px;
       height:90px;
       background-color:#ffffff;
     }
登录后复制

  .D{
       position:relative;
       margin:10px 20px 10px 5px;
       float: left;
       top:12.5px;
       left:10px;
       border-left:solid 15px #ade081;
       height:125px;
     }
     .D:before{
       position:absolute;
       content:'';
       top:0;
       left:0;
       width:60px;
       height:95px;
       border-width:15px 15px 15px 0;
       border-color:#ade081;
       border-style:solid;
       border-radius:0 300%300%0 /0 180%180%0;
      }
登录后复制

   .E{
        position:relative;
        margin:10px 10px 10px 60px;
        float: left;
        top:12.5px;
        left:10px;
        width:63px;
        height:95px;
        border-width:15px 0 15px 16px;
        border-color:#cd2388;
        border-style:solid;
      }
      .E:before{
        position:absolute;
        content:'';
        top:38px;
        left:0px;
        width:53px;
        height:15px;
        background-color:#cd2388;
      }
登录后复制

   .F{
        position:relative;
        margin:10px 5px 10px 10px;
        float: left;
        top:12.5px;
        left:10px;
        width:63px;
        height:110px;
        border-width:15px 0 0 16px;
        border-color:#668899;
        border-style:solid;
       }
      .F:before{
        position:absolute;
        content:'';
        top:38px;
        left:0px;
        width:53px;
        height:15px;
        background-color:#668899;
      }
登录后复制


   .G{
        position:relative;
        margin:10px 5px 10px 5px;
        float: left;
        top:12.5px;
        left:10px;
        width:84px;
        height:95px;
        border-width:15px 12px 15px 16px;
        border-color:#f0af00;
        border-style:solid;
        border-radius:50%;
       }
       .G:before{
         transform:rotate(45deg);
         position:absolute;
         content:'';
         top:2px;
         left:48px;
         background-color:#ffffff;
         width:90px;
         height:90px;
       }
      .G:after{
        position:absolute;
        content:'';
        bottom:0.5px;
        right:7px;
        width:28px;
        height:36px;
        border-width:13px 14px 0 0;
        border-color:#f0af00;
        border-style:solid;
      }
登录后复制

   .H{
        position:relative;
        margin:10px 10px 10px 5px;
        float: left;
        top:12.5px;
        left:10px;
        width:60px;
        height:125px;
        border-width:0 16px 0 16px;
        border-color:#cde680;
        border-style:solid;
       }
       .H:before{
        position:absolute;
        content:'';
        top:53px;
        left:0;
        width:60px;
        height:14px;
        background-color:#cde680;
       }
登录后复制

   .I{
        z-index:1;
        position:relative;
        margin:10px 10px 10px 10px;
        float: left;
        top:12.5px;
        left:20px;
        width:16px;
        height:125px;
        background-color:#020a0f;
       }
登录后复制

   .J{
         position:relative;
         margin:10px 5px 10px 5px;
         float: left;
         top:12.5px;
         left:-5px;
         width:75px;
         height:66px;
         border-right:solid 16px #b0c0d0;
      }
      .J:before{
         position:absolute;
         content:'';
         bottom:-60px;
         right:-16px;
         width:50px;
         height:60px;
         border-width:0 16px 15px 14px;
         border-color:#b0c0d0;
         border-style:solid;
         border-radius:0 0 75%75%;
       }
       .J:after{
         transform:rotate(-40deg);
         position:absolute;
         content:'';
         top:40px;
         left:-20px;
         width:60px;
         height:60px;
         background-color:#ffffff;
        }
登录后复制

   .K{
       position:relative;
       margin:10px 5px 10px 5px;
       float: left;
       top:12.5px;
       left:10px;
       width:80px;
       height:125px;
       border-left:solid 16px #ce6688;
       overflow:hidden;
      }
      .K:before{
        transform:skew(-43deg,0);
        position:absolute;
        content:'';
        top:0;
        left:16px;
        width:19px;
        height:84px;
        background-color:#ce6688;
      }
      .K:after{
        transform:skew(30deg,0);
        position:absolute;
        content:'';
        bottom:0;
        right:25px;
        width:18px;
        height:80px;
        background-color:#ce6688;
       }
登录后复制

   .L{
        position:relative;
        margin:10px 5px 10px 5px;
        float: left;
        top:12.5px;
        left:10px;
        width:63px;
        height:110px;
        border-width:0 0 15px 16px;
        border-color:#998800;
        border-style:solid;
       }
登录后复制

   .M{
        position:relative;
        margin:10px 5px 10px 5px;
        float: left;
        top:12.5px;
        left:10px;
        width:80px;
        height:125px;
        border-width:0 15px 0 15px;
        border-color:#ff0000;
        border-style:solid;
       }
       .M:before{
        transform:skew(20deg,0);
        position:absolute;
        content:'';
        top:0;
        left:14px;
        width:12px;
        height:110px;
        background-color:#ff0000;
       }
       .M:after{
        transform:skew(-20deg,0);
        position:absolute;
        content:'';
        top:0;
        right:14px;
        width:12px;
        height:110px;
        background-color:#ff0000;
       }
登录后复制

    .N{
        position:relative;
        margin:10px 5px 10px 5px;
        float: left;
        top:12.5px;
        left:10px;
        width:63px;
        height:125px;
        border-width:0 15px 0 15px;
        border-color:#9aff02;
        border-style:solid;
       }
       .N:before{
        transform:skew(30deg,0);
        position:absolute;
        content:'';
        top:0;
        left:24px;
        width:15px;
        height:125px;
        background-color:#9aff02;
      }
登录后复制

   .O{
        position:relative;
        margin:10px 5px 10px 5px;
        float: left;
        top:12.5px;
        left:10px;
        width:70px;
        height:97px;
        border-width:14px 16px 14px 16px;
        border-color:#ffff40;
        border-style:solid;
        border-radius:55% /52%;
       }
登录后复制

    .P{
       position:relative;
       margin:10px 5px 10px 5px;
       float: left;
       top:12.5px;
       left:10px;
       width:60px;
       height:125px;
       border-left:solid 16px #00ffff;
      }
      .P:before{
       position:absolute;
       content:'';
       width:56px;
       height:50px;
       border-width:13px 15px 13px 0;
       border-color:#00ffff;
       border-style:solid;
       border-radius:0 220%220%0 /0 180%180%0;
      }
登录后复制

   .Q {
       z-index:-1;
       position:relative;
       margin:10px 5px 10px 5px;
       float: left;
       top:12.5px;
       left:10px;
       width:70px;
       height:97px;
       border-width:14px 16px 14px 16px;
       border-color:#deff00;
       border-style:solid;
       border-radius:55% /52%;
     }
     .Q:before{
       transform:rotate(-84deg);
       position:absolute;
       content:'';
       top:82px;
       left:49px;
       width:16px;
       height:48px;
       border-width:16px 0 13px 13px;
       border-color:#deff00;
       border-style:solid;
       border-radius:200%0 0 200% /100%0 0 100%;
     }
     .Q:after{
       transform:rotate(-18deg);
       position:absolute;
       content:'';
       bottom:-35px;
       right:-44px;
       width:30px;
       height:30px;
       background-color:#ffffff;
     }
登录后复制

   .R{
     position:relative;
     margin:10px 5px 10px 5px;
     float: left;
     top:12.5px;
     left:10px;
     width:60px;
     height:125px;
     border-left:solid 16px #a0b0c0;
    }
    .R:before{
     position:absolute;
     content:'';
     width:52px;
     height:44px;
     border-width:13px 15px 13px 0;
     border-color:#a0b0c0;
     border-style:solid;
     border-radius:0 220%220%0 /0 180%180%0;
    }
    .R:after{
     transform:skew(32deg,0);
     position:absolute;
     content:'';
     bottom:0;
     left:38px;
     width:18px;
     height:58px;
     background-color:#a0b0c0;
   }
登录后复制

   .S{
     transform:rotate(14deg);
     position:relative;
     margin:10px 5px 10px 5px;
     float: left;
     width:105px;
     height:150px;
     top:10px;
     left:10px;
   }
   .S:before{
     transform:rotate(18deg);
     position:absolute;
     content:'';
     width:44px;
     height:40px;
     border-width:14px 0 15px 15.5px;
     border-color:#ffaf80;
     border-style:solid;
     border-radius:220%0 0 150% /150%0 0 100%;
   }
   .S:after{
    transform:rotate(198deg);
    position:absolute;
    content:'';
    top:65px;
    left:21px;
    width:52px;
    height:44px;
    border-width:14px 0 15px 15px;
    border-color:#ffaf80;
    border-style:solid;
    border-radius:240%0 0 110% /140%0 0 100%;
    }
登录后复制

   .T{
      position:relative;
      margin:10px 5px 10px 5px;
      float: left;
      top:12.5px;
      left:10px;
      width:100px;
      height:125px;
      border-top:solid 15px #ffd0e0;
    }
   .T:before{
    position:absolute;
    content:'';
    top:0;
    left:42px;
    width:16px;
    height:110px;
    background-color:#ffd0e0;
   }
登录后复制

  .U{
    position:relative;
    margin:10px 5px 10px 5px;
    float: left;
    top:12.5px;
    left:10px;
    width:60px;
    height:80px;
    border-width:0 16px 0 16px;
    border-color:#ff8f01;
    border-style:solid;
   }
   .U:before{
    position:absolute;
    content:'';
    top:65px;
    left:-16px;
    width:60px;
    height:45px;
    border-width:0 16px 15px 16px;
    border-color:#ff8f01;
    border-style:solid;
    border-radius:0 0 200%200% /0 0 300%300%;
   }
登录后复制

  .V{
     position:relative;
     margin:10px 5px 10px 5px;
     float: left;
     top:12.5px;
     left:30px;
     width:59px;
    }
    .V:before{
     transform:skew(18deg,0);
     position:absolute;
     content:'';
     top:0;
     left:0;
     height:125px;
     border-left:solid 16px #008800;
   }
   .V:after{
     transform:skew(-18deg,0);
     position:absolute;
     content:'';
     top:0;
     right:0;
     height:125px;
     border-left:solid 16px #008800;
   }
登录后复制

   .W{
     position:relative;
     margin:10px 5px 10px 40px;
     float: left;
     top:12.5px;
     left:25px;
     width:100px;
    }
    .W:before{
     transform:skew(11deg,0);
     position:absolute;
     content:'';
     top:0;
     left:0;
     width:42px;
     height:125px;
     border-width:0 13px 0 15px;
     border-color:#000000;
     border-style:solid;
    }
    .W:after{
     transform:skew(-11deg,0);
     position:absolute;
     content:'';
     top:0;
     right:0;
     width:42px;
     height:125px;
     border-width:0 15px 0 13px;
     border-color:#000000;
     border-style:solid;
    }
登录后复制

  .X{
     position:relative;
     margin:10px 5px 10px 25px;
     float: left;
     top:12.5px;
     left:50px;
     width:16px;
     height:125px;
    }
    .X:before{
     transform:skew(32deg,0);
     position:absolute;
     content:'';
     top:0;
     left:0;
     width:16px;
     height:125px;
     background-color:#0066ff;
    }
    .X:after{
     transform:skew(-32deg,0);
     position:absolute;
     content:'';
     top:0;
     right:0;
     width:16px;
     height:125px;
     background-color:#0066ff;
    }
登录后复制


  .Y{
     position:relative;
     margin:10px 5px 10px 80px;
     float: left;
     top:92.5px;
     left:52px;
     width:16px;
     height:50px;
     background-color:#22ff55;
    }
    .Y:before{
     transform:skew(28deg,0);
     position:absolute;
     content:'';
     top:-80px;
     left:-21px;
     width:16px;
     height:80px;
     background-color:#22ff55;
    }
    .Y:after{
     transform:skew(-28deg,0);
     position:absolute;
     content:'';
     top:-80px;
     right:-21px;
     width:16px;
     height:80px;
     background-color:#22ff55;
    }
登录后复制


  .Z{
     position:relative;
     margin:20px 5px 10px 80px;
     float: left;
     top:12.5px;
     left:10px;
     width:90px;
     height:95px;
     border-width:15px 0 15px 0;
     border-color:#336699;
     border-style:solid;
    }
    .Z:before{
     transform:skew(-37deg,0);
     position:absolute;
     content:'';
     top:0;
     left:36px;
     width:18px;
     height:95px;
     background-color:#336699;
    }
登录后复制

完整的HTML5+CSS3版Demo。

效果截图:




  
  CSS3绘制26个字母
  


  
  

登录后复制

以上是如何使用纯CSS3绘制26个英文字母的示例详解的详细内容。更多信息请关注PHP中文网其他相关文章!

本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.最佳图形设置
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.如果您听不到任何人,如何修复音频
3 周前 By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25:如何解锁Myrise中的所有内容
3 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

bootstrap按钮怎么用 bootstrap按钮怎么用 Apr 07, 2025 pm 03:09 PM

如何使用 Bootstrap 按钮?引入 Bootstrap CSS创建按钮元素并添加 Bootstrap 按钮类添加按钮文本

bootstrap怎么调整大小 bootstrap怎么调整大小 Apr 07, 2025 pm 03:18 PM

要调整 Bootstrap 中元素大小,可以使用尺寸类,具体包括:调整宽度:.col-、.w-、.mw-调整高度:.h-、.min-h-、.max-h-

bootstrap怎么设置框架 bootstrap怎么设置框架 Apr 07, 2025 pm 03:27 PM

要设置 Bootstrap 框架,需要按照以下步骤:1. 通过 CDN 引用 Bootstrap 文件;2. 下载文件并将其托管在自己的服务器上;3. 在 HTML 中包含 Bootstrap 文件;4. 根据需要编译 Sass/Less;5. 导入定制文件(可选)。设置完成后,即可使用 Bootstrap 的网格系统、组件和样式创建响应式网站和应用程序。

bootstrap怎么插入图片 bootstrap怎么插入图片 Apr 07, 2025 pm 03:30 PM

在 Bootstrap 中插入图片有以下几种方法:直接插入图片,使用 HTML 的 img 标签。使用 Bootstrap 图像组件,可以提供响应式图片和更多样式。设置图片大小,使用 img-fluid 类可以使图片自适应。设置边框,使用 img-bordered 类。设置圆角,使用 img-rounded 类。设置阴影,使用 shadow 类。调整图片大小和位置,使用 CSS 样式。使用背景图片,使用 background-image CSS 属性。

bootstrap怎么看日期 bootstrap怎么看日期 Apr 07, 2025 pm 03:03 PM

答案:可以使用 Bootstrap 的日期选择器组件在页面中查看日期。步骤:引入 Bootstrap 框架。在 HTML 中创建日期选择器输入框。Bootstrap 将自动为选择器添加样式。使用 JavaScript 获取选定的日期。

bootstrap日期怎么验证 bootstrap日期怎么验证 Apr 07, 2025 pm 03:06 PM

在 Bootstrap 中验证日期,需遵循以下步骤:引入必需的脚本和样式;初始化日期选择器组件;设置 data-bv-date 属性以启用验证;配置验证规则(如日期格式、错误消息等);集成 Bootstrap 验证框架,并在表单提交时自动验证日期输入。

bootstrap怎么写分割线 bootstrap怎么写分割线 Apr 07, 2025 pm 03:12 PM

创建 Bootstrap 分割线有两种方法:使用 标签,可创建水平分割线。使用 CSS border 属性,可创建自定义样式的分割线。

bootstrap导航栏怎么设置 bootstrap导航栏怎么设置 Apr 07, 2025 pm 01:51 PM

Bootstrap 提供了设置导航栏的简单指南:引入 Bootstrap 库创建导航栏容器添加品牌标识创建导航链接添加其他元素(可选)调整样式(可选)

See all articles