使用属性选择器来设置元素的样式 how to"使用type属性选择器来匹配复选框? "


#1

Tell us what’s happening:
卡了很久 不知道哪裡不能過…

Your code so far


<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;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }

  .silver-background {
    background-color: silver;
  }
  [type ='checkbox']{
  margin: 10px 0px 15px 0px;
}

</style>

<h2 class="red-text">CatPhotoApp</h2>
<main>
  
  <a href="#"><img src="http://cdn.freecodecamp.cn/relaxing-cat.jpg" alt="一只仰卧着的萌猫"></a>
  
  <div class="silver-background">
    <p>猫咪最喜欢的三件东西:</p>
    <ul>
      <li>猫薄荷</li>
      <li>激光笔</li>
      <li>千层饼</li>
    </ul>
    <p>猫咪最讨厌的三件东西:</p>
    <ol>
      <li>跳蚤</li>
      <li>打雷</li>
      <li>同类</li>
    </ol>
  </div>
  
  <form action="/submit-cat-photo" id="cat-photo-form">
  
    <label><input type="checkbox" name="personality" >忠诚</label>
    <label><input type="checkbox" name="personality" >懒惰</label>
    <label><input type="checkbox" name="personality" >积极</label><br>
  
   
    <input type="text" placeholder="猫咪图片地址" required>
    <button type="submit">提交</button>
    
  </form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.one/responsive-web-design/basic-css/use-attribute-selectors-to-style-elements/


#2

重置代碼 再打一次就好了(已解決