简体   繁体   English

如何显示带有透明背景和白色边框的图标?

[英]How can I show icon with transparent background and white border?

I have an PSD that has this icon 我有一个带有此图标的PSD IMG1

but what i tried is here 但是我尝试过的在这里 在此处输入图片说明

here is my css 这是我的CSS

.box_bg_org i{
    background-color: #e98b39;
    /*background: transparent;*/
    font-size: 30px;
    color: #fff;
    padding: 30px;
}
.box_bg_org i.fa-phone{
color: transparent;
-moz-text-shadow: 2px 2px 0px #fff;  
text-shadow: 2px 2px 0px #fff;
}

please help me 请帮我

EDIT: Actually, I tried creating that and it doesn't work the way you want it, creating this using pure CSS/JS seems like a much harder thing to do than just add that image. 编辑:实际上,我尝试创建它,但它并不能按照您想要的方式工作,使用纯CSS / JS创建它似乎比仅添加该图像要困难得多。

Use the inverse version of the phone and give it the right color to match your background. 使用手机的反面版本,并为其提供正确的颜色以匹配您的背景。 ie <i class="fa fa-phone-square"></i> <i class="fa fa-phone-square"></i>

First make sure you have a transparent background image. 首先,请确保您具有透明的背景图像。 Next save your image with a "PNG" file extension and you can do that on Photoshop by going to file menu and selct "Save As" from the options and make sure you select the PNG file extension while saving. 接下来,使用“ PNG”文件扩展名保存图像,然后可以在Photoshop上执行以下操作:转到文件菜单,然后从选项中选择“另存为”,并确保在保存时选择了PNG文件扩展名。

The rest is easy you just have to include your PNG image in our HTML and change the container DIV background using CSS. 剩下的事情很容易,您只需要在我们的HTML中包含PNG图像并使用CSS更改容器DIV背景即可。

Good Luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM