Skip to content

Commit 2d2d2cb

Browse files
committed
Add styles
1 parent 9022c42 commit 2d2d2cb

File tree

3 files changed

+64
-3
lines changed

3 files changed

+64
-3
lines changed

static/styles/main.css

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
html {
2+
box-sizing: border-box;
3+
}
4+
5+
*,
6+
*:before,
7+
*:after {
8+
box-sizing: inherit;
9+
}
10+
11+
html,
12+
body {
13+
margin: 0;
14+
padding: 0;
15+
}
16+
17+
body {
18+
font-family: sans-serif;
19+
}
20+
21+
main {
22+
margin: 0 auto;
23+
max-width: 100%;
24+
padding: 20px;
25+
width: 1200px;
26+
}
27+
28+
label,
29+
input,
30+
button {
31+
display: block;
32+
font-size: 16px;
33+
margin: 0 0 8px 0;
34+
width: 100%;
35+
}
36+
37+
form {
38+
border: 1px solid #444;
39+
max-width: 100%;
40+
padding: 20px;
41+
width: 400px;
42+
}
43+
44+
button {
45+
background: transparent;
46+
border: 1px solid #444;
47+
border-radius: 4px;
48+
cursor: pointer;
49+
margin: 0;
50+
padding: 4px 0;
51+
}
52+
53+
button:hover {
54+
background: #444;
55+
color: #fff;
56+
}

templates/index.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
{% extends "layout.html" %}
22

33
{% block body %}
4+
<h1>Add a user</h1>
45
<form action="{{ url_for('user') }}" method="post">
56
<label for="name">Name</label>
6-
<input id="name" type="text" name="name" placeholder="John Smith"/>
7+
<input id="name" type="text" name="name" placeholder="John Smith" required />
78
<label for="email">Email</label>
8-
<input id="email" type="text" name="email" placeholder="[email protected]"/>
9+
<input id="email" type="email" name="email" placeholder="[email protected]" required />
910
<button type="submit">Save</button>
1011
</form>
12+
<h2>List of users</h2>
1113
{% for u in users %}
1214
<p>{{ u.name }} -- {{ u.email }}</p>
1315
{% endfor %}

templates/layout.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<!DOCTYPE html>
22
<html lang="en">
33
<head>
4+
<link rel="stylesheet" href="{{ url_for('static', filename='styles/main.css') }}" />
45
</head>
56
<body>
6-
{% block body %}{% endblock %}
7+
<main>
8+
{% block body %}{% endblock %}
9+
</main>
710
</body>
811
</html>

0 commit comments

Comments
 (0)