- Modify the
font-family
property to fontFamily
.
- The
h1
element should be enclosed within a parent tag such as div
or <></>
. You can take a look at your code here: Your code
If you have made the changes, ensure that your code resembles the following inside the return statement:
<div>
<h3 style={{color: "red", fontFamily:"opensans-bold"}}> Hello World! </h3>
</div>
Alternatively, you can also use this structure:
<>
<h3 style={{color: "red", fontFamily:"opensans-bold"}}> Hello World! </h3>
</>
If the error persists even after these adjustments, try changing the color and inspect the output.
You can refer to my code snippet and output provided below.
App.js
import './App.css';
function App() {
return (
<div>
<h3 style={{color: "red", fontFamily:"opensans-bold"}}> Hello World! </h3>
</div>
);
}
export default App;
Output:
Output screen
If you benefitted from this response, kindly consider voting for it. Thank you.