Broken Tests on challenge Basic CSS: Use Attribute Selectors to Style Elements
See original GitHub issueDescribe your problem and how to reproduce it:
This is expected to work, and it works in the preview.
There is a space before and after the =
symbol.
[type = 'checkbox'] {
margin-top: 10px;
margin-bottom: 15px;
}
It fails tests with this error, although it is expected to pass.
// running tests
The type attribute selector should be used to select the checkboxes.
The same code without the spaces passes.
Add a Link to the page with the problem: https://www.freecodecamp.org/learn/responsive-web-design/basic-css/use-attribute-selectors-to-style-elements
Tell us about your browser and operating system:
- Browser Name: Google Chrome
- Browser Version: 79.0.3945.130
- Operating System: Fedora 31
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Issue Analytics
- State:
- Created 4 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Basic CSS - Use Attribute Selectors to Style Elements - YouTube
In today's tutorial we continue to learn basic CSS as we use attribute selectors to style elements. Enjoy!
Read more >Use Attribute Selectors to Style Elements Basic CSS via ...
FOLLOW ALONG LINK: https://www.freecodecamp.org/learn/responsive-web-design/ basic - css / use - attribute - selectors-to-style -elementsCheck out the ...
Read more >Use Attribute Selectors to Style Elements
Can someone provide some insight as to what I'm doing wrong? I thought I needed to add my code between style tags but...
Read more >6 Selectors
In CSS, pattern matching rules determine which style rules apply to elements in a document. These patterns, called selectors, may range from simple...
Read more >How to use and create CSS Selectors in Selenium ...
Locating an element using CSS selector may seem a little difficult than using attributes like id, name, link, etc. but it's one of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Whilst I agree there is no reason the tests should not pass, I think it is important to note that having space on either side of the
=
is not good syntax, and could cause issue with integration with SASS. HTML is just so forgiving. https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectorsThat was the best solution I found:
`<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-top: 10px; margin-bottom: 15px;
} </style>`