Permalink
Browse files

Made the CSS 'padding' '1em' style apply only to content <div>s.

  • Loading branch information...
maratbn committed Jun 30, 2018
1 parent 891b4ea commit 8366171cce77475b38e7c3daf31513eabe009519
Showing with 6 additions and 3 deletions.
  1. +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>
);

0 comments on commit 8366171

Please sign in to comment.