Skip to content

Instantly share code, notes, and snippets.

@jslvtr
Created August 21, 2020 15:59
Show Gist options
  • Save jslvtr/7b296116c312b39bf0d5f111fe99f05d to your computer and use it in GitHub Desktop.
Save jslvtr/7b296116c312b39bf0d5f111fe99f05d to your computer and use it in GitHub Desktop.
The HTML and CSS Code for our Flask Tutorial for Beginners video (https://youtu.be/lIGKKnfLobA)
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Personal finance</title>
<link rel="stylesheet" href="./style.css" />
</head>
<body>
<h1>Add transaction</h1>
<form>
<div class="form__fieldset">
<label for="date" class="form__label">Date:</label>
<input type="date" name="date" id="date" class="form__input" />
</div>
<div class="form__fieldset">
<label for="amount" class="form__label">Amount:</label>
<input type="number" name="amount" id="amount" class="form__input" />
</div>
<div class="form__fieldset">
<label for="account" class="form__label">Account:</label>
<select name="account" id="account" class="form__input form__select">
<option value="Checking">Checking</option>
<option value="Savings">Savings</option>
<option value="Investment">Investment</option>
</select>
</div>
<div class="form__fieldset">
<input
class="form__submit form__input"
type="submit"
value="Add transaction"
/>
</div>
</form>
</body>
</html>
html {
font-size: 17px;
font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}
body {
max-width: 1000px;
margin: 0 auto;
padding: 20px;
}
.form__fieldset {
padding: 40px 20px;
}
.form__fieldset:not(:last-of-type) {
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.form__input {
font-size: 1rem;
}
.form__select {
padding: 4px 2px;
}
.form__label {
margin-right: 20px;
}
.form__submit {
padding: 8px 16px;
background-color: unset;
border: 2px solid #1c2023;
border-radius: 4px;
cursor: pointer;
float: right;
}
.form__submit:hover {
background-color: #1c2023;
color: white;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment