【发布时间】:2018-04-18 14:19:59
【问题描述】:
我的网站上有我的 SoundCloud 链接,但我无法更改背景颜色。我的代码如下:
<!DOCTYPE html>
<html>
<head>
<title> Music</title>
<style type="text/css">
body {
color:black;
}
#img {
float: under;
}
#img2 {
float: center;
}
.right {
/* border: 3px solid black;*/
margin-top: 20px;
padding: 50px 50px;
width: 500px;
border-radius: 30px;
margin: auto;
position: relative;
}
}
</style>
</head>
<body>
<div class = "right">
<p> <h2>These are some of the songs that I listen to on the daily!</h2></p>
</div>
<div id = "img">
<iframe width="400" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/97939459&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe></div>
<div id = "img2">
<iframe width="400" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/142830556&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
</div>
<iframe width="400" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/396615804&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
<p><a href="index.html"> Link back to Home Page!</a></p>
</body>
</html>
【问题讨论】:
-
<h2>在<p>标记内无效,并且您的 CSS 末尾还有一个额外的}。您实际上并没有在任何地方设置背景颜色。您是在谈论您在body上设置的color吗?设置 text 颜色;你想要background-color作为背景。