Challenge: Render an Element in React
Note
All challenges may appear broken by default since they contain whitespace sections where you need to input the necessary code. Once you correctly fill in these whitespace sections, the completed code will be displayed on the live page.
Additionally, every challenge features two buttons:
HintandSolution. Clicking onHintprovides small hints for the current challenge, while selecting theSolutionbutton opens a new tab with the completed challenge.
How to work with Code Sandbox
Task: Creating a Product Card
Create the product card and render it to the DOM. The product card needs:
- 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
Can you explain how to use the Hint and Solution buttons?
What should I do if the live page doesn't render after making changes?
Can you walk me through creating the product card step by step?
Awesome!
Completion rate improved to 2.17
Challenge: Render an Element in React
Swipe to show menu
Note
All challenges may appear broken by default since they contain whitespace sections where you need to input the necessary code. Once you correctly fill in these whitespace sections, the completed code will be displayed on the live page.
Additionally, every challenge features two buttons:
HintandSolution. Clicking onHintprovides small hints for the current challenge, while selecting theSolutionbutton opens a new tab with the completed challenge.
How to work with Code Sandbox
Task: Creating a Product Card
Create the product card and render it to the DOM. The product card needs:
- 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!