CSS字体边框? [英] CSS Font Border?

查看:113
本文介绍了CSS字体边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着所有新的CSS3边框的东西继续( -webkit ,...)现在可以添加一个边框到你的字体? (像蓝色Twitter徽标周围的纯白色边框)。如果没有,是否有任何不太丑的黑客会在CSS / XHTML中实现这一点,还是需要启动Photoshop?

解决方案

正确的答案是:



  h1 {color:yellow ; text-shadow:-1px 0 black,0 1px black,1px 0 black,0 -1px black;}  

 < h1> Hello World< / h1>  

这将从四边设置四个相同类型的阴影。


With all the new CSS3 border stuff going on (-webkit, ...) is it now possible to add a border to your font? (Like the solid white border around the blue Twitter logo). If not, are there any not-too-ugly hacks that will accomplish this in CSS/XHTML or do I still need to fire up Photoshop?

解决方案

The right answer is:

h1 {
    color: yellow;
    text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
}

<h1>Hello World</h1>

This will set four same type shadows from the four sides.

这篇关于CSS字体边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆