您好在freecodecamp.com上开设一门课程,我应该通过课程为图像添加边框宽度颜色和样式。
虽然我没有运气。我看不出我做错了什么。
.thick-green-border {
border-width: 10px border-color: green border-style: solid;
}
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.smaller-image {
width: 100px;
}
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<h2 class='red-text'>CatPhotoApp</h2>
<img class='smaller-image thick-green-border' src='https://bit.ly/fcc-kittens' />
答案 0 :(得分:4)
您需要使用分号border-width:10px border-color:green border-style:solid;
border-width:10px; border-color:green; border-style:solid;
中的每个媒体资源
.thick-green-border {
border: 10px;
border-color: green;
border-style: solid;
}
.red-text {
color: red;
}
h2 {
font-family: Lobster, Monospace;
}
p {
font-size: 16px;
font-family: Monospace;
}
.smaller-image {
width: 100px;
}
&#13;
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<h2 class='red-text'>CatPhotoApp</h2>
<img class='smaller-image thick-green-border' src='https://bit.ly/fcc-kittens' />
&#13;
答案 1 :(得分:3)
你错过了几个分号:
border-width:10px border-color:green border-style:solid;
应该是:
border-width:10px; border-color:green; border-style:solid;
修改后的代码:
<link href='http://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
<style>
.thick-green-border{
border-width:10px; border-color:green; border-style:solid;}
.red-text {
color: red;}
h2 {
font-family: Lobster, Monospace;}
p {
font-size: 16px;
font-family: Monospace;}
.smaller-image {
width: 100px;}
</style>
<h2 class='red-text'>CatPhotoApp</h2>
<img class='smaller-image thick-green-border' src='https://bit.ly/fcc-kittens'/>
答案 2 :(得分:1)