-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise1.html
117 lines (105 loc) · 2.65 KB
/
exercise1.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>ReactJs Exercise 1</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
line-height: 1.5;
height: 100%;
font-family: serif;
}
.root {
min-height: 100%;
position: relative;
}
.main-wrapper,
.footer-wrapper {
width: 90%;
margin: auto;
}
.main-wrapper {
line-height: 2;
}
.footer-wrapper {
text-align: center;
}
footer {
position: absolute;
bottom: 0;
width: 100%;
height: 20px;
}
</style>
</head>
<body>
<div class="root"></div>
<script
crossorigin
src="https://unpkg.com/react@16/umd/react.development.js"
></script>
<script
crossorigin
src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"
></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
const root = document.querySelector('.root');
const person = {
firstName: 'sourov',
lastName: 'Chowdhury',
country: 'Bangladesh',
title: 'Bal Falau',
gender: 'Male',
email: '[email protected]',
phone: '01779378939',
};
const Button = () => <button>submit</button>;
const Input = () => <input type="text" />;
const main = (
<main style={{ backgroundColor: 'tomato' }}>
<div className="main-wrapper">
<h3>
name: {person.firstName} {person.lastName}
</h3>
<h4>country: {person.country}</h4>
<title>title: {person.title}</title>
<h4>gender: {person.gender}</h4>
<address>
<a href={`mailto: ${person.email}`}>{person.email}</a>
<br />
<a href={`tel: ${person.phone}`}>{person.phone}</a>
</address>
</div>
<Button />
<Input />
</main>
);
const footer = (
<footer style={{ width: '100%', backgroundColor: 'aqua' }}>
<div className="footer-wrapper">
<h5>This is Footer</h5>
</div>
</footer>
);
const jsxElm = (
<div style={{ border: '1px solid' }}>
{main}
{footer}
</div>
);
ReactDOM.render(jsxElm, root);
</script>
</body>
</html>