-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4_class-attribute.html
More file actions
36 lines (36 loc) · 1018 Bytes
/
Copy path4_class-attribute.html
File metadata and controls
36 lines (36 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Class attribute example</title>
<style>
.red {color:red;}
</style>
</head>
<body>
<p>There is some restrictions in react, for example you can't use class name.</p>
<div id="app"></div>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.min.js" crossorigin></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.min.js" crossorigin></script>
<script type='text/babel'>
function Person(){
return (
<div><h3 class="red">Person</h3></div>
);
}
function Dog(){
return (
<div><h3 className="red">Dog</h3></div>
);
}
var app = (
<div>
<Person />
<Dog />
</div>
)
ReactDOM.render(app,document.querySelector("#app"));
</script>
</body>
</html>