JSX Gaya Inline
//Multiple inline styles
<div style={{padding:'0px 10px', position: 'fixed'}}>Content</div>
Puzzled Puffin
//Multiple inline styles
<div style={{padding:'0px 10px', position: 'fixed'}}>Content</div>
// You are actuallty better off using style props
// But you can do it, you have to double brace
// and camel-case the css properties
render() {
return (
<div style={{paddingTop: '2em'}}>
<p>Eh up, me duck!</p>
</div>
)
}
function MyComponent(){
2
3return <div style={{ color: 'blue', lineHeight : 10, padding: 20 }}> Inline Styled Component</div>
4
5}
//Use backgroundColor instead of background-color:
const Header = () => {
return (
<>
<h1 style={{backgroundColor: "lightblue"}}>Hello Style!</h1>
<p>Add a little style!</p>
</>
);
}
// Change the background color to red
document.body.style.backgroundColor = "red";