如何解决 .png 背景色问题?
How can I solve .png background-color problem?
我添加了两个 png 图像,但我无法更改它们的背景颜色,虽然第一个图像是山图像,但没有同样的问题。
我应该怎么办?我该如何解决?
谢谢...
/* 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>Y.E.S.</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>
那是因为云 png 没有透明背景。要使背景颜色起作用,您必须摆脱背景。您可以使用 remove.bg
这样的网站
我添加了两个 png 图像,但我无法更改它们的背景颜色,虽然第一个图像是山图像,但没有同样的问题。 我应该怎么办?我该如何解决? 谢谢...
/* 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>Y.E.S.</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>
那是因为云 png 没有透明背景。要使背景颜色起作用,您必须摆脱背景。您可以使用 remove.bg
这样的网站