Skip to content

Commit 86f61be

Browse files
Create style.css and refactor Component with the stylesheet
- Create `public/style.css` - Refactor `Component.jsx` so it renders valid HTML - Load stylesheet in head
1 parent 2e38245 commit 86f61be

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

‎Component.jsx‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@ module.exports = React.createClass({
66
},
77
render: function() {
88
return (
9-
<div>
10-
<h1>Hello World!</h1>
11-
<p>Isn't server-side rendering remarkable?</p>
12-
<button onClick={this._handleClick}>Click Me</button>
13-
</div>
9+
<html>
10+
<head>
11+
<title>Universal App with React</title>
12+
<link rel='stylesheet' href='/style.css' />
13+
</head>
14+
<body>
15+
<div>
16+
<h1>Hello World!</h1>
17+
<p>Isn't server-side rendering remarkable?</p>
18+
<button onClick={this._handleClick}>Click Me</button>
19+
</div>
20+
</body>
21+
</html>
1422
);
1523
}
1624
});

‎public/style.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
padding: 50px;
3+
font: 14px "Lucida Grande", Helvetica, Arial;
4+
}

0 commit comments

Comments
 (0)