Challenge: Render an Element in React
All challenges may appear incomplete by default. They include empty sections where you need to add the required code. Once all missing parts are filled in correctly, the completed code will be rendered on the live page.
Each challenge includes two helper buttons:
- Hint: shows small clues to guide you;
- Solution: opens the completed version in a new tab.
You can also watch the short video tutorial below to learn how to work with CodeSandbox.
How to work with Code Sandbox
Task: Creating a Product Card
Create a simple product card using JSX and render it to the DOM. The product card must include:
- The product image (
imgelement).srcattribute must be equal to theimageUrlvariable.altattribute must be equal to the stringComputer.widthattribute must be equal to the256.
- The product title (
h3element).- Its text content must be
Computer.
- Its text content must be
- The product price (
spanelement).- Its text content must be
Price: $129.99.
- Its text content must be
- The product description (
pelement).- Its text content must be
New Model.
- Its text content must be
- TheΒ
srcΒ attribute must contain theΒimageUrlΒ variable as a value. Use curly bracesΒ{}. - TheΒ
altΒ attribute must contain the stringΒ"Computer"Β as a value. Enclose it in double quotes. - TheΒ
widthΒ attribute must contain the numberΒ256Β as a value. Use curly bracesΒ{}. - Ensure that theΒ
h3,Βspan, andΒpΒ elements have correct values.
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 4
Challenge: Render an Element in React
Swipe to show menu
All challenges may appear incomplete by default. They include empty sections where you need to add the required code. Once all missing parts are filled in correctly, the completed code will be rendered on the live page.
Each challenge includes two helper buttons:
- Hint: shows small clues to guide you;
- Solution: opens the completed version in a new tab.
You can also watch the short video tutorial below to learn how to work with CodeSandbox.
How to work with Code Sandbox
Task: Creating a Product Card
Create a simple product card using JSX and render it to the DOM. The product card must include:
- The product image (
imgelement).srcattribute must be equal to theimageUrlvariable.altattribute must be equal to the stringComputer.widthattribute must be equal to the256.
- The product title (
h3element).- Its text content must be
Computer.
- Its text content must be
- The product price (
spanelement).- Its text content must be
Price: $129.99.
- Its text content must be
- The product description (
pelement).- Its text content must be
New Model.
- Its text content must be
- TheΒ
srcΒ attribute must contain theΒimageUrlΒ variable as a value. Use curly bracesΒ{}. - TheΒ
altΒ attribute must contain the stringΒ"Computer"Β as a value. Enclose it in double quotes. - TheΒ
widthΒ attribute must contain the numberΒ256Β as a value. Use curly bracesΒ{}. - Ensure that theΒ
h3,Βspan, andΒpΒ elements have correct values.
Thanks for your feedback!