For some strange reason

Tell us what’s happening:

Your code so far


const styles = {
  color: 'purple',
  fontSize: 40,
  border: "2 solid purple",
}
class Colorful extends React.Component {
 render() {
   // change code below this line
   return (
     <div style={styles}>Style Me!</div>
   );
   // change code above this line
 }
};

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:76.0) Gecko/20100101 Firefox/76.0.

Challenge: Add Inline Styles in React

Link to the challenge:

Hey guys! For some strange reason, when I press “Run the Tests”, it won’t do anything really, it just keeps loading and loading. Do any of you know why? I think my code is right.

Thank you for your help.

There’s minor typo in styles.border, try to fix it and see if it helps

Is it because I am missing px?

Because if that’s the problem, it still didn’t work.

Can we see your updated code? Because it passes for me when I add px to the border width.

const styles = {
   color: 'purple',
   fontSize: 40,
   border: "2px solid purple",
 }
class Colorful extends React.Component {
  render() {
    // change code below this line
    return (
      <div style={styles}>Style Me!</div>
    );
    // change code above this line
  }
};

Here you go

Your code is passing for me. Try resetting the challenge.


I’ve edited your post for readability.

Please use the “preformatted text” tool in the editor (</>) to add backticks around text.

1 Like

Thank you. I guess I just had to reload the page.