Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想像 Newser.com 那样在图像上显示文本。这是一个示例:
乍一看,这似乎很简单。但事实证明,这对我来说非常具有挑战性。
解决方案可能在于 DIV 和 SPAN 的某种组合(可能 span 嵌套在块 DIV 中......?)
想法?
(注 1:注意每个文本跨度如何具有唯一长度的背景 - 例如直接在文本下方)
(注2:暂时不用担心不透明度的值。我基本上只是想做4个黑色文本块(如jpg所示。))
Newser.com 似乎会生成带有文本的图像,但您可以仅使用 html 和 css 来完成此操作。
下面是一个例子:
http://codepen.io/anon/pen/jDdAb