An HTML document is composed of a root <html>
element, containing metadata in the <head>
element and content in the <body>
element. The document uses styles and variables to dynamically generate content and layout properties.
npm run import -- "javadoc template"
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>${TITLE}</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='main.css'>
<style>
html {
padding: 0;
margin: 0;
}
nav {
position: fixed;
overflow: auto;
top: 0;
left: 0;
right: auto;
bottom: 0;
width: 200px;
}
header {
background-color: #EEE;
padding: 10px;
}
body {
padding: 0 0 0 200px;
margin: 0;
}
.gold pre code,
.gold pre code span,
.gold code pre,
.gold code pre span {
color: gold;
}
@media screen and (max-width: 600px) {
body {
padding-left: 0;
}
nav {
display: none;
}
}
</style>
</head>
<body>
<nav>
<h3>${PARENT}</h3>
${CLASSES}
</nav>
<header>
${PARENT} | ${PREV} | ${NEXT} | ${SEARCH}
</header>
${OUTPUT}
</body>
</html>
<%=TITLE%>
<%=PARENT%> |
<%=PREV%> |
<%=NEXT%> |
<%=SEARCH%>
<%=OUTPUT%>
<%-- --%>
<%----%>
HTML Document Breakdown
<!DOCTYPE html>
declaration.<html>
element is the root element of the HTML document.<head>
element contains metadata about the document.<body>
element contains the content of the HTML document.<meta>
elements specify character encoding (utf-8
) and compatibility with Internet Explorer (IE=edge
).<title>
element sets the title of the document, which can be dynamically updated with the ${TITLE}
variable.<meta>
element with name='viewport'
sets the viewport settings for mobile devices.<link>
element links to an external stylesheet (main.css
).<style>
element defines inline styles for the HTML document.html
: resets padding and margin.nav
: positions the navigation menu at the top-left corner of the page.header
: sets the background color and padding for the header element.body
: sets the padding and margin for the body element..gold code pre
: sets the text color to gold for elements with the .gold
class.<nav>
element contains the navigation menu, which includes:
h3
) with the ${PARENT}
variable.${CLASSES}
variable is used to generate content.<header>
element contains a heading with the ${PARENT}
variable, and links for previous (${PREV}
), next (${NEXT}
), and search (${SEARCH}
) functionality.${OUTPUT}
variable is used to generate the main content of the HTML document.