home ~ socials ~ projects ~ rss

Add Inline CSS To A React Element

August 2021

- Use a style propery with a object inside the {} which results in `stuff ` - Use camleCaseNames instead of kabob-case-names

const element = (
    <div style={{fontStyle: 'italic', backgroundColor: 'red'}}>
        this is inline CSS
    </div>
)
end of line
Share link:
https://www.alanwsmith.com/en/20/eo/kv/yj/?add-inline-css-to-a-react-element