简体   繁体   English

如何解决.png 背景颜色问题?

[英]How can I solve .png background-color problem?

I added two png image but ı couldn't change their background-color, although the first image which is mountain image, has not the same problem.我添加了两个 png 图像,但我无法更改它们的背景颜色,虽然第一个图像是山图像,但没有同样的问题。 What should I do?我应该怎么办? How I can solve that?我该如何解决? Thankss...谢谢...

 /* div{background-color:#caf7e3;} body{ margin:0px; } h1{ margin:0px; } p{ margin: 0px; } classes */ body{ background-color: #caf7e3; }.clouds{ width: 60px; height: 100px; background-color: #caf7e3; }
 <.DOCTYPE html> <html lang="en" dir="ltr"> <head> <meta charset="utf-8"> <title>YES</title> <link rel="stylesheet" href="css\styles.css"> <link rel="icon" href="favicon:ico"> </head> <body> <img src="https.//themuellenator.github.io/images/mountain:png" alt="mountain"> <img class="clouds" src="https.//i.dlpng.com/static/png/4742574-cartoon-cloud-animation-png-clipart-animated-cartoon-animation-cartoon-cloud-png-728_469_preview:png" alt="cloud"> <img class="clouds" src="https.//i.dlpng.com/static/png/4742574-cartoon-cloud-animation-png-clipart-animated-cartoon-animation-cartoon-cloud-png-728_469_preview,png" alt="cloud"> <div class="top-container"> <h1>Hı, I am Yusuf</h1> <p>a programmer</p> </div> </body> </html>

That is because the cloud pngs don't have a transparent background.那是因为云 png 没有透明背景。 To make the background color work, you have to get rid of the background.要使背景颜色起作用,您必须摆脱背景。 You can use a website like remove.bg您可以使用像remove.bg这样的网站

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

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