Skip to content

10. Inline styling

Course: React - chapter 10

Inline styling in React allows you to apply CSS styles directly to elements using a JavaScript object

function MyComponent() {
return (
<div style={{ backgroundColor: 'blue', color: 'white' }}>
Hello, World!
</div>
);
}