-
Notifications
You must be signed in to change notification settings - Fork 0
/
templates.html
214 lines (205 loc) · 7.58 KB
/
templates.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="only light">
<meta name="Description"
content="HTML templates that can be used as scaffolding for everything from basic web pages to advanced websites">
<title>HTML Haus | Templates</title>
<link rel="icon" type="image/x-icon" href="img/favicon.ico">
<link rel="stylesheet" type="text/css" href="css/sane.css">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<!-- <base href="https://html.haus/"> -->
</head>
<body>
<header>
<nav>
<a id="menu-title" href="index.html">HTML<img class="logo" src="img/house-with-tree.png"
alt="House with tree icon"></a>
<ul>
<li><a href="learn.html">Learn</a></li>
<li><a href="practice.html">Practice</a></li>
<li><a href="reference.html">Reference</a></li>
<li><a href="tools.html">Tools</a></li>
</ul>
</nav>
</header>
<main>
<h1>Use HTML Templates</h1>
<p>
A set of HTML templates that are free to use and help you get started. Each of these templates builds on the next,
so they follow a progression from
very basic starter page to fully fleshed out page with metadata and a skeleton of HTML elements.
</p>
<h2>Basics</h2>
<h3>Starter</h3>
<p>
The first template covers a basic HTML page, which you can use as a template for your index.html. It demonstrates
important metadata in the head,
including how you give your page a title and how to link to a CSS stylesheet:
</p>
<textarea rows="13">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title Appears in Browser Tab</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h1>This is your H1</h1>
<p>I'm a placeholder text</p>
</body>
</html>
</textarea>
<h3>Layout</h3>
<p>
Building on our basic page, this layout template embraces the idea of using semantic HTML to communicate form and
meaning through properly tagging primary sections:
header, main, and footer. In general, every one of your pages should probably have all three of these sections.
Here's how it looks:
</p>
<textarea rows="21">
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title Appears in Browser Tab</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<header>
Site title here, maybe also a navbar? Header things
</header>
<main>
<h1>This is your H1</h1>
<p>I'm a placeholder text</p>
</main>
<footer>
Copyright info, site map, other footer things
</footer>
</body>
</html>
</textarea>
<h3>Metadata</h3>
<p>
Building on the basic layout and page, the following template below also has necessary meta tags needed to pass
basic SEO requirements of a Chrome lighthouse audit,
as well as lang="en" set to English. These additional meta tags tell browsers (and search engines) how to size
their screen and give a description of the website.
</p>
<textarea rows="23">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="Description" content="A meaningful description or synopsis of your page and its contents">
<title>Title Appears in Browser Tab</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<header>
Site title here, maybe also a navbar? Header things
</header>
<main>
<h1>This is your H1</h1>
<p>I'm a placeholder text</p>
</main>
<footer>
Copyright info, site map, other footer things
</footer>
</body>
</html>
</textarea>
<h3>Metadata with Open Graph</h3>
<p>
Enriching the original metadata template with additional meta tags to cover the Open Graph specification. The Open
Graph protocol is primarily
used with social media platforms (like Facebook and Twitter) and tells these sites how to link to, display, and
describe your webpage when someone
shares a link to it on a social platform.
</p>
<textarea rows="23">
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A meaningful description or synopsis of your page and its contents">
<meta property="og:title" content="The title of your object as it should appear within the graph">
<meta property="og:type" content="The type of your object, e.g., webpage. Depending on the type you specify, other properties may also be required">
<meta property="og:url" content="The canonical URL of your object that will be used as its permanent ID in the graph, e.g. https://www.yourwebsite.com/yourwebpage.html/">
<meta property="og:image" content="An image URL which should represent your object within the graph">
<title>Title Appears in Browser Tab</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<header>
Site title here, maybe also a navbar? Header things
</header>
<main>
<h1>This is your H1</h1>
<p>I'm a placeholder text</p>
</main>
<footer>
Copyright info, site map, other footer things
</footer>
</body>
</html>
</textarea>
<h2>Utility</h2>
<h3>Redirect</h3>
<p>
If you ever need to create a redirect, then here's a template to do it in a bulletproof way, which will work
regardless of a user's browser settings, even if they have JavaScript turned off.
</p>
<textarea rows="17">
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta http-equiv="Refresh" content="2; url=https://html.haus/">
<meta charset="utf-8" />
<title>HTML Haus Redirect</title>
<script type="text/javascript">
window.location = "https://html.haus/"
</script>
</head>
<body>
<noscript>
<p>This page will redirect to <a href="https://html.haus/">html.haus</a> in 2 seconds</p>
</noscript>
</body>
</html>
</textarea>
<h2>Other Sources</h2>
<p>
There's an awesome project called <a href="https://html5boilerplate.com/">HTML5 Boilerplate</a>, which gives you a
fully fledged boilerplate to
start from, including CSS that resets baselines, JS to detect browser features, and an excellent set of HTML
defaults.
</p>
<!-- TO DO
- Basic page skeleton
- Navigation/menu bar
- Footer with copyright
- Form example
- Table example
- Full business website with index.html, services.html, products.html, staff.html, contact-us.html
-->
<!-- <h2>Future Images</h2>
<img src="img/valeriy-kryukov-aRvKSkRO-vw-unsplash.jpg" alt="Red bricks with different languages stamped into them by Valeriy Kryukov on Unsplash" width="90%">
<img src="img/hana-barakat-T1uOZ2kEDsA-unsplash.jpg" alt="Wooden staircase and orante wooden frame in red brick building by Hana Barakat on Unsplash" width="90%">
<img src="img/ashkan-forouzani-qhcml9Xo_5k-unsplash.jpg" alt="Bright red door in front of red brick wall by Ashkan Forouzani on Unsplash" width="90%"> -->
</main>
<footer>
<a href="learn.html">Learn</a>
<a href="practice.html">Practice</a>
<a href="reference.html">Reference</a>
<a href="tools.html">Tools</a>
<a href="about.html">About</a>
<a href="index.html"><img alt="House with tree icon" class="logo" src="img/house-with-tree.png"></a>
</footer>
</body>
</html>