Challenge: Render an Element in React
メニューを表示するにはスワイプしてください
Note
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
srcattribute must contain theimageUrlvariable as a value. Use curly braces{}. - The
altattribute must contain the string"Computer"as a value. Enclose it in double quotes. - The
widthattribute must contain the number256as a value. Use curly braces{}. - Ensure that the
h3,span, andpelements have correct values.
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 5
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください
セクション 1. 章 5