Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Made the CSS 'padding' '1em' style apply only to content <div>s.
- Loading branch information
Showing
with
6 additions
and
3 deletions.
-
+6
−3
webpack_in/entry.jsx
|
@@ -12,16 +12,19 @@ import ReactDOM from 'react-dom'; |
|
|
|
|
|
const objStyleCommon = { |
|
|
margin: '1em', |
|
|
padding: '1em', |
|
|
border: 'solid 2px green', |
|
|
textAlign: 'center' |
|
|
}; |
|
|
|
|
|
const objStyleContent = { |
|
|
padding: '1em' |
|
|
}; |
|
|
|
|
|
|
|
|
class HelloWidget extends React.Component { |
|
|
render() { |
|
|
return ( |
|
|
<div style={ objStyleCommon }> |
|
|
<div style={{ ...objStyleCommon, ...objStyleContent }}> |
|
|
Hello! I'm a React app!! |
|
|
</div> |
|
|
); |
|
@@ -32,7 +35,7 @@ class TextWidget extends React.Component { |
|
|
render() { |
|
|
return ( |
|
|
<div style={ objStyleCommon }> |
|
|
<div>Some text here....</div> |
|
|
<div style={ objStyleContent }>Some text here....</div> |
|
|
<button>Change text...</button> |
|
|
</div> |
|
|
); |
|
|