网站链接: 我爱捣鼓
当前位置: 首页 > 前端开发 > css

css实现发光3D文字效果

2022/5/10 21:48:08

大家看看下面图片的文字效果是怎么实现的?可能有的朋友会说这肯定是ps制作的,其实这是用css实现的发光3D文字效果,我们来看看具体如何实现呢?<html class=" -webkit-"><head> <meta charset="UTF-8"> <link rel="app…

        大家看看下面图片的文字效果是怎么实现的?可能有的朋友会说这肯定是ps制作的,其实这是用css实现的发光3D文字效果,我们来看看具体如何实现呢?

image.png

<html class=" -webkit-">
<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" type="image/png"
    href="https://cpwebassets.codepen.io/assets/favicon/apple-touch-icon-5ae1a0698dcc2402e9712f7d01ed509a57814f994c660df9f7a952f3060705ee.png">
  <meta name="apple-mobile-web-app-title" content="CodePen">
  <link rel="shortcut icon" type="image/x-icon"
    href="https://cpwebassets.codepen.io/assets/favicon/favicon-aec34940fbc1a6e787974dcd360f2c6b63348d4b1f4e06c77743096d55480f33.ico">
  <link rel="mask-icon" type="image/x-icon"
    href="https://cpwebassets.codepen.io/assets/favicon/logo-pin-8f3771b1072e3c38bd662872f6b673a722f4b3ca2421637d5596661b4e2132cc.svg"
    color="#111">
  <title>css实现发光3D文字效果www.woaidaogu.com</title>
  <style media="" data-href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
    html,
    body,
    div,
    span,
    applet,
    object,
    iframe,
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    blockquote,
    pre,
    a,
    abbr,
    acronym,
    address,
    big,
    cite,
    code,
    del,
    dfn,
    em,
    img,
    ins,
    kbd,
    q,
    s,
    samp,
    small,
    strike,
    strong,
    sub,
    sup,
    tt,
    var,
    b,
    u,
    i,
    center,
    dl,
    dt,
    dd,
    ol,
    ul,
    li,
    fieldset,
    form,
    label,
    legend,
    table,
    caption,
    tbody,
    tfoot,
    thead,
    tr,
    th,
    td,
    article,
    aside,
    canvas,
    details,
    embed,
    figure,
    figcaption,
    footer,
    header,
    hgroup,
    menu,
    nav,
    output,
    ruby,
    section,
    summary,
    time,
    mark,
    audio,
    video {
      margin: 0;
      padding: 0;
      border: 0;
      font-size: 100%;
      font: inherit;
      vertical-align: baseline
    }
    article,
    aside,
    details,
    figcaption,
    figure,
    footer,
    header,
    hgroup,
    menu,
    nav,
    section {
      display: block
    }
    body {
      line-height: 1
    }
    ol,
    ul {
      list-style: none
    }
    blockquote,
    q {
      quotes: none
    }
    blockquote:before,
    blockquote:after,
    q:before,
    q:after {
      content: '';
      content: none
    }
    table {
      border-collapse: collapse;
      border-spacing: 0
    }
  </style>
  <style>
    @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300&display=swap');
    html,
    body {
      width: 100%;
      height: 100%;
      background: #000;
      overflow: hidden;
      text-align: center;
      font-family: 'Rajdhani', sans-serif;
    }
    div {
      animation: wobble 5s ease-in-out infinite;
      transform-origin: center center;
      transform-style: preserve-3d;
      /*     perspective: 500px; */
    }
    @keyframes wobble {
      0%,
      100% {
        transform: rotate3d(1, 1, 0, 40deg);
      }
      25% {
        transform: rotate3d(-1, 1, 0, 40deg);
      }
      50% {
        transform: rotate3d(-1, -1, 0, 40deg);
      }
      75% {
        transform: rotate3d(1, -1, 0, 40deg);
      }
    }
    h1 {
      position: absolute;
      display: block;
      width: 100%;
      top: 120px;
      font-size: 100px;
      font-weight: bold;
      text-transform: uppercase;
      color: rgba(255, 100, 100, 1);
      text-shadow:
        0 0 5px rgba(255, 0, 0, 1),
        0 0 20px rgba(255, 0, 0, .8),
        0 0 50px rgba(255, 0, 0, .6);
      animation: glow 5s ease-in-out infinite;
    }
    @keyframes glow {
      from {
        filter: hue-rotate(0);
      }
      to {
        filter: hue-rotate(360deg);
      }
    }
    h1:nth-child(2) {
      transform: translateZ(5px);
    }
    h1:nth-child(3) {
      transform: translateZ(10px);
    }
    h1:nth-child(4) {
      transform: translateZ(15px);
    }
    h1:nth-child(5) {
      transform: translateZ(20px);
    }
    h1:nth-child(6) {
      transform: translateZ(25px);
    }
    h1:nth-child(7) {
      transform: translateZ(30px);
    }
    h1:nth-child(8) {
      transform: translateZ(35px);
    }
    h1:nth-child(9) {
      transform: translateZ(40px);
    }
    h1:nth-child(10) {
      transform: translateZ(45px);
    }
  </style>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
  <script>
    if (document.location.search.match(/type=embed/gi)) {
      window.parent.postMessage("resize", "*");
    }
  </script>
</head>
<body translate="no">
  <div>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
    <h1>Glowing 3D TEXT</h1>
  </div>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
  <script
    src="https://cpwebassets.codepen.io/assets/editor/iframe/iframeRefreshCSS-4793b73c6332f7f14a9b6bba5d5e62748e9d1bd0b5c52d7af6376f3d1c625d7e.js"></script>
  <div id="xl_chrome_ext_{4DB361DE-01F7-4376-B494-639E489D19ED}" style="display: none;">
    <div></div>
    <a id="xl_chrome_ext_download" href="javascript:;">下载视频</a>
    <a id="xl_chrome_ext_close" href="javascript:;"></a>
  </div>
</body>
</html>

        查看在线实例

        通过以上内容我们知道了css如何实现发光3D文字效果?感谢您访问“我爱捣鼓(www.woaidaogu.com)”网站的内容,希望对大家有所帮助!引用本文内容时,请注明出处!谢谢合作!


相关资讯

  • 设置英文首字母大写的css属性是什么?

    设置CSS text-transform 的属性为capitalize就可以实现英文首字母大写。 定义和用法  text-transform 属性控制文本的大小写。 属性值 值 描 述 none 默认。定义带有小写字…

    2021/7/14 20:35:17
  • 只让页面显示横滚动条,不显示竖滚动条如何实现?

    只让页面显示横滚动条,不显示竖滚动条的方法其实很简单,主要用到body的两个css属性 overflow和 overflow-y,如下所示:body { overflow:scroll; overflow-y:hidden;}

    2021/2/28 21:45:25
  • 网页的滚动条样式可以修改吗?如何修改?

    网页的滚动条样式可以修改的,主要是使用css来控制那如何修改呢?如下代码:<div class="inner"> <div class="innerbox"> <p style="height:200px;">这是内容111</p> <p style="hei…

    2021/2/28 21:15:24
  • css如何实现6张图片均匀排列在一行?

    css部分如下:img{width:120px; height:80px;float:left;margin-right:16px;}.img3{margin-right:0;}html部分如下:<img src="images/001.jpg" /><img src="images/002.jpg" /><img src="images/003.jpg" /><img src=…

    2021/2/28 21:10:01