文字拉伸css

The technique I am demonstrating here isn’t one I made from scratch; as far as I am aware, credit for origination should go to Mark Otto, a designer at Twitter; the version that I’m showing derives from patterns created by Trent Walton. This is not “true 3D” but a fake-out; real 3D text will have to wait for lessons in WebGL and CSS 3D transforms.

我在这里演示的技术不是我从头开始做的。 据我所知,推特应该归功于Twitter的设计师Mark Otto ; 我要显示的版本来自Trent Walton创建的模式。 这不是“真正的3D”,而是伪造品。 真正的3D文本必须等待WebGL和CSS 3D转换的课程。

Very simply, we create extruded text appearance by creating a stacked series of CSS text-shadows. As we’ll see later, transferring the same technique to box-shadow can also create the effect of a raised or sunken button in CSS.

很简单,我们通过创建一系列堆叠的CSS文本阴影来创建拉伸文本外观。 稍后我们将看到,将相同的技术转移到box-shadow中也可以在CSS中产生凸起或凹陷的按钮效果。

The CSS code is somewhat repetitive; the main aspect to focus on is the changing vertical offset of the main shadows. Thankfully, text-shadow does not require CSS vendor prefixes.

CSS代码有些重复。 要关注的主要方面是主阴影的垂直偏移量不断变化。 幸运的是, text-shadow不需要CSS供应商前缀 。

The code for the example at the top of this article is:

本文顶部示例的代码为:

h1 {background: #ccc;font-size: 4vm;padding: 1.2rem;color: #fff;font-family: Blue Highway; Arial Black, sans-serif;text-align: center;letter-spacing: 1rem;text-shadow:0 .01em 0px #dededa,0 .015em 0 #dededa,0 .02em  0 #dededa,0 .028em 0 #dededa,0 .035em 0 #dededa,0 .04em  0 #dededa,0 .045em 0 #dbdbd6,0 .055em 0 #dbdbd6,0 .06em  0 #dbdbd6,0 .065em 0 #d9d9d4,0 .07em  0 #d9d9d4,0 .08em  0 #d8d8d3,0 .085em 0 #d8d8d3,0 .09em  0 #d8d8d3,0 .095em 0 #d6d6d1,0 .105em 0 #d6d6d1,0 .06em .06rem rgba(104, 104, 92, 0.15),.07em .105em .04em rgba(0, 0, 0, .015),-.02em .09em .05em rgba(104, 104, 92, 0.25),-.03em .07em .065em rgba(104, 104, 92, 0.1),-.075em .08em .09em rgba(104, 104, 92, 0.06),-.09em .06em .195em rgba(104, 104, 92, 0.095);
}

Just as with multiple background images in CSS, we separate multiple text shadows with commas, starting with those originating nearest the text element and working outwards. (For this example I’m using em units rather than px for enhanced scalability, but almost any CSS unit of measurement would work).

就像CSS中的多个背景图片一样 ,我们用逗号分隔多个文本阴影,从最接近text元素并向外展开的阴影开始。 (对于此示例,我使用em单位而不是px来增强可伸缩性,但是几乎任何CSS度量单位都可以使用)。

The first 16 shadows are solid, slowly and subtly growing darker as they descend, creating the appearance of extruded text. The final six shadows in the declaration actually serve the purpose of ambient shadows, being offset to the left, right, and top of each letter, with added blur and transparency (in the form of rgba color values).

前16个阴影是固体,随着它们下降,缓慢而微妙地逐渐变暗,从而形成挤压文本的外观。 声明中的最后六个阴影实际上是用于环境阴影的目的,向每个字母的左侧,右侧和顶部偏移,并增加了模糊和透明度(以rgba颜色值的形式)。

Naturally, this effect will only work in modern browsers – IE9 does not support text-shadow, although IE10 does. It’s therefore wise to make sure that make that the base color of the text is distinct from the background, as is the example at the top of this article; try to avoid “white on white”, ensuring that your content is still readable in IE.

自然,此效果仅在现代浏览器中有效– IE9不支持text-shadow ,尽管IE10可以。 因此,明智的做法是确保使文本的底色与背景不同,如本文顶部的示例所示。 尝试避免“白底白字”,以确保您的内容在IE中仍然可读。

If you’d prefer not to step through the process of making this shadow effect yourself, there are now automated CSS generators for 3D CSS Text.

如果您不想自己一步一步地制作阴影效果,现在可以使用3D CSS Text的自动CSS生成器 。

翻译自: https://thenewcode.com/471/CSS-3D-Extruded-Text

文字拉伸css

文字拉伸css_CSS 3D拉伸文字相关推荐

  1. java文字云_Canvas 3D球形文字云动画特效

    Canvas 3D球形文字云动画特效 body { color:#555555; } h4 { font-family:sans-serif; color:#555555; font-size:16p ...

  2. [css] 用css3实现伪3D的文字效果

    [css] 用css3实现伪3D的文字效果 <!DOCTYPE html> <html lang="en"><head><meta cha ...

  3. C#+OpenGL+FreeType显示3D文字(3) - 用PointSprite绘制文字

    C#+OpenGL+FreeType显示3D文字(3) - 用PointSprite绘制文字 上一篇实现了把文字绘制到OpenGL窗口,但实质上只是把含有文字的贴图贴到矩形模型上.本篇我们介绍用Poi ...

  4. #今日论文推荐# 文字秒变3D?苹果发布最新AI生成模型GAUDI,根据文字提示创建3D场景

    #今日论文推荐# 文字秒变3D?苹果发布最新AI生成模型GAUDI,根据文字提示创建3D场景 继 AI 将文字变成图片后,又有 AI 可以将文字变成 3D 场景了. 苹果发布新 AI 系统 GAUDI ...

  5. Cesium之3D拉伸显示行政区

    转自原文 Cesium之3D拉伸显示行政区含GeoJSON数据生成过程GDAL的ogr2ogr Cesiumjs 是一套javascript库,用来渲染3D地球,2D区域地图,和多种GIS要素.不需要 ...

  6. Canvas 3D球形文字云动画特效

    Canvas 3D球形文字云动画特效 Canvas 3D球形文字云动画特效 效果图: 代码如下,复制即可使用: (适用浏览器:360.FireFox.Chrome.Opera.傲游.搜狗.世界之窗. ...

  7. CSS实现的阴影的3D立体文字动画网页源码

    大家好,今天给大家介绍一款,炫酷的阴影的3D立体文字动画网页源码(图1).送给大家哦,获取方式在本文末尾. 图1 由两组文字构成,都有阴影,加上左右晃动,3D效果很明显(图2) 图2 响应式页面,支持 ...

  8. canvas在画布上创建向上下左右3D影子文字

    canvas在画布上创建向上下左右3D影子文字 简单实现canvas中的文字3D影子;如有代码问题请留言,谢谢; <!DOCTYPE html> <html><head& ...

  9. 下列哪个可以选中矩形文字块_AI制作字母块文字效果

    先来看看最终的效果: 嗯,老规矩,先分析一下子: 1.整体色彩比较明亮,五彩斑斓 2.很写实的风格 3.很直观的3D效果 OK,接下来我们开始动手制作: 首先,新建一个图层.850*620px,颜色模 ...

最新文章

  1. 哈希表(HashMap)分析及实现(JAVA)
  2. (28)SpringBoot启动时的Banner设置【从零开始学Spring Boot】
  3. 【电信增值业务学习笔记】7 USSD增值业务提供技术
  4. Python 列表(List)操作方法详解
  5. 深度学习已经取得的进展
  6. OVER(PARTITION BY)函数用法
  7. 【译】PGP Web of Trust: Core Concepts Behind Trusted Communication
  8. js06--函数库jq与prototype
  9. ESFramework介绍之(14)-- AS与FS通信方案
  10. Linux中的crontab详解
  11. 基于X-Engine引擎的实时历史数据库解决方案揭秘
  12. 小猿圈Linux 之用户和用户组管理(二)
  13. 药师帮完成1.33亿美元D轮融资,投资方为老虎环球基金、H Capital和DCM...
  14. xshell 自动断开解决方法
  15. 60.Linux 启动过程
  16. 基于java图书销售系统
  17. 神奇网盘搜索 只搜网盘不搜其它 一键搜索所有网盘资源
  18. 英语知识系列:26个字母在单词中的发音总结
  19. 用python下载视频代码_python实现视频下载
  20. linux平台运行 mr程序,MR程序的几种提交运行模式

热门文章

  1. 外贸企业邮箱网页登录入口,免费注册电子邮箱教你如何登录企业邮箱
  2. 拉塞尔不变性定理 ( LaSalle's invariance principle )
  3. CSS中margin和padding的上下左右
  4. 论文翻译——Weighted Residuals for Very Deep Networks
  5. 穿透中手游2021年H1财报,挖掘其内在进化逻辑
  6. matlab凸透镜防仿真,西安邮电大学matlab仿真解剖.doc
  7. 数影周报:恶意插件可远程控制Google Chrome,Meta裁员超1.1万名员工
  8. 2020诺瓦科技一面
  9. css绝对定位后居中显示文字
  10. 原生android怎么安装到手机,如果谷歌强推手机安装原生安卓系统你支持吗?