react inline style code example
Example 1: inline z-index react
<Input ref="username" type="text" label="Username" placeholder="Enter username" style={{zIndex:1}} />
Example 2: inline style jsx
<div style={{padding:'0px 10px', position: 'fixed'}}>Content</div>
Example 3: inline style react
render() {
return (
<div style={{paddingTop: '2em'}}>
<p>Eh up, me duck!</p>
</div>
)
}
Example 4: react div style
return <div style={{display: 'inline-block'}}>
Example 5: javascript style inline react
<div style={{ width: '200px', backgroundColor: 'red' }}>
Example 6: jsx inline css styling
const box = {
textAlign: 'center',
borderStyle: 'double'
};
const text = {
color: '#ff0000',
backgroundColor: '#888888'
};
renderBox() {
return (
<div style={box}> <p style={text}>
This is just a box, no need to worry.
</p> </div>
);
}
renderBox() {
return (
<div style={{textAlign:'center', borderStyle:'double'}}>
<p style={{color:'#ff0000', backgroundColor:'#888888'}}>
This is just a box, no need to worry.
</p>
</div>
);
}