简体   繁体   English

添加带有html背景的透明图标

[英]Adding transparent icon with html background

I'm having trouble to place a transparent white envelope icon with a green background. 我在放置带有绿色背景的透明白色信封图标时遇到了麻烦。 I don't get what's happening because it worked fine with the telephone icon. 我不知道发生了什么,因为它可以与电话图标正常工作。

Side Question.: Any suggestion on what I should use as an html for something that is on top of the header? 补充问题:关于在标题顶部应使用什么作为html的任何建议? I had created the logo and the nav bar in the header and figured it was easier to create another session on top of it for the phone and e-mail but it's turning into a styling nightmare. 我已经在标题中创建了徽标和导航栏,并认为在顶部为电话和电子邮件创建另一个会话比较容易,但是这已成为样式方面的噩梦。

卡

I've tried about 10 different pictures and none worked. 我尝试了约10张不同的图片,但均无效果。

´´´ ´´´

    <aside class="phone">
        <a href="mailto:cplusc@gmail.com"><img src="../C&C/img/kisspng-paper-black-and-white-envelope-5a7b1ac9f163b2.4908982415180172259887.jpg" width="18" height="18"> contador@gmail.com</a><a href="tel:+1-303-499-7111"><img src="../C&C/img/Call-Icon.png" width="18" height="18"> (303) 499-7111</a>
    </aside>


    <header>
        <div class="containerHeader">
          <div id="Branding">
            <img src="./img/logo.png.png">
          </div>
          <nav>
              <ul>
                  <li class="current"><a href="index.html">Home</a></li> <!––Current makes the current page have a different colour-->
                  <li><a href="quemsomos.html">Quem somos?</a></li>
                  <li><a href="services.html">Serviços</a></li>
              </ul>
          </nav>                        
        </div> 

    </header>  

´´´ ´´´

I see your envelope icon is actually a .jpg, which doesn't support transparency. 我看到您的信封图标实际上是.jpg,不支持透明。 The telephone icon is .png. 电话图标是.png。 I suggest you to look for icons with transparency. 我建议您寻找具有透明度的图标。 Try findicons.com or flaticon.com 尝试findicons.comflaticon.com

Is the Envelope image you insert. 是您插入的信封图像。 It is .jpg format. 它是.jpg格式。 Should save as .png. 应该另存为.png。

Jpg file dont support transparency. jpg文件不支持透明度。

Cheers 干杯

JPG does not allow transparency. JPG不允许透明。 The other icon works because it's a PNG image, which is allow transparency. 另一个图标有效,因为它是PNG图像,允许透明。 You should use a png image for the envelope icon too. 您也应该将png图片用作信封图标。

I did try multiple png images and they didn't work either. 我确实尝试了多个png图像,但它们也不起作用。 :( :(

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

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