Code Editor
Learn

In regular JavaScript, style names are written in hyphenated-lowercase:

var styles = { 'margin-top': "20px", 'background-color': "green" };

In React, those same names are instead written in camelCase:

var styles = { marginTop: "20px", backgroundColor: "green" };

This has zero effect on style property values, only on style property names.

Report a Bug
If you see a bug or any other issue with this page, please report it here.