Freecodecamp: 简单的 css 问题 .thick-green-border 类未通过。 我究竟做错了什么?

创建于 2016-07-01  ·  3评论  ·  资料来源: freeCodeCamp/freeCodeCamp

挑战在元素周围添加边框有问题。
用户代理是: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0
请描述如何重现此问题,并尽可能提供屏幕截图的链接。

我的代码:

<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .smaller-image {
    width: 100px;
  }

  .thick-green-border {
    border-width: 10px;
    border-style: solid;
    border-color: green;
  }
</style>

<h2 class="red-text">CatPhotoApp</h2>

<img class="smaller-image" class="thick-green-border"  src="https://bit.ly/fcc-relaxing-cat">

<p class="red-text">Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.</p>
<p class="red-text">Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.</p>

最有用的评论

你的图片标签不应该有两个类属性。 事实上,任何 html 元素都不应该有两个类属性。
您可以通过用空格分隔多个类来向 html 元素添加多个类。 例如,

<h2 class="red-text green-border">Heading</h2>

这个空间不是用来寻求挑战的帮助。 如果您需要帮助,请前往FCC帮助室。

所有3条评论

你的图片标签不应该有两个类属性。 事实上,任何 html 元素都不应该有两个类属性。
您可以通过用空格分隔多个类来向 html 元素添加多个类。 例如,

<h2 class="red-text green-border">Heading</h2>

这个空间不是用来寻求挑战的帮助。 如果您需要帮助,请前往FCC帮助室。

我知道这将是一件简单的事情。 非常感谢 arun1595。

关闭似乎问题已解决。 快乐编码!

此页面是否有帮助?
0 / 5 - 0 等级