--- id: bad87fee1348bd9aedf08845 title: Use a span to Target Inline Elements challengeType: 0 forumTopicId: 18370 dashedName: use-a-span-to-target-inline-elements --- # --description-- You can use spans to create inline elements. Remember when we used the `btn-block` class to make the button fill the entire row? That illustrates the difference between an "inline" element and a "block" element. By using the inline `span` element, you can put several elements on the same line, and even style different parts of the same line differently. Nest the word "love" in your "Things cats love" element below within a `span` element. Then give that `span` the class `text-danger` to make the text red. Here's how you would do this with the "Top 3 things cats hate" element: `
Top 3 things cats hate:
` # --hints-- Your `span` element should be inside your `p` element. ```js assert($('p span') && $('p span').length > 0); ``` Your `span` element should have just the text `love`. ```js assert( $('p span') && $('p span').text().match(/love/i) && !$('p span') .text() .match(/Things cats/i) ); ``` Your `span` element should have class `text-danger`. ```js assert($('span').hasClass('text-danger')); ``` Your `span` element should have a closing tag. ```js assert( code.match(/<\/span>/g) && code.match(//g).length === code.match(/ ``` # --solutions-- ```html ```