<!DOCTYPE html>
<html>
<head>
<!--Look to the left for the style.css file-->
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav id='menu'>
<!--All links will be dynamically inserted here-->
</nav>
</header>
<h1>Index</h1>
<section id='part1'>
<h2>Part1</h2>
</section>
<section id='part2'>
<h2>Part2</h2>
</section>
<section id='part3'>
<h2>Part3</h2>
</section>
<!--Look to the left for the menu.js file-->
<script src="menu.js"></script>
</body>
</html>
// Code goes here
var pages = 3;
var parts = 3;
var pg = [];
var pt = [];
var menu = document.getElementById('menu');
var i, j;
for (i = 0; i < pages; i++) {
var page = 'page' + (i+1);
pg.push(page);
for (j = 0; j < parts; j++) {
var part = 'part' + (j+1);
pt.push(part);
var url = pg[i] + '.html#' + pt[j];
var anchor = document.createElement('a');
anchor.href = url;
anchor.textContent = (i+1) +'.'+(j+1) ;
menu.appendChild(anchor);
}
}
/* Core~~~~~~~~~~~~~~~*/
@import url('https://fonts.googleapis.com/css?family=Open+Sans|Raleway');
html {
box-sizing: border-box;
font: 500 62.5%/1.428 'Open Sans';
height: 100vh;
width: 100vw;
}
*,
*:before,
*:after {
box-sizing: inherit;
margin: 0;
padding: 0;
}
body {
position: relative;
font-size: 1.9rem;
line-height: 1;
height: 100%;
width: 100%;
overflow-x: hidden;
overflow-y: scroll;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4,
h5,
h6,
legend {
font-variant: small-caps;
font-family: "Raleway";
margin-bottom: 15px;
}
h1 {
font-size: 3.2rem;
}
h2 {
font-size: 2.9rem;
}
h3 {
font-size: 2.6rem;
}
h4 {
font-size: 2.4rem;
}
h5 {
font-size: 2.2rem;
}
h6 {
font-size: 2.1rem;
}
legend {
font-size: 2.7rem;
}
p {
margin: 0 5px 15px;
}
img {
display: inline-block;
width: 25em;
height: auto;
margin: 20px 0;
}
a {
color: #Fc0;
text-decoration: none;
margin: 10px 20px;
display: inline-block;
}
a:hover {
color: #CCC;
}
button {
font: inherit;
line-height: 1.5;
padding: 1px 3px;
border-radius: 8px;
border: 1px solid #fc2;
}
.noSel {
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}
code * {
font: 100 1.5rem/1.5 'Consolas';
color: #6F3;
background: #777;
border: 2px inset #CCC;
margin: 10px 10px 15px 15px;
}
#aux {
padding: 10px;
}
#ext {
padding: 30px 10px;
width: 100%;
height: 100%;
position: relative;
}
header {
border-bottom: 5px ridge #FF6;
box-shadow: 0 1px 9px 1px #ccc;
}
section {
padding: 20px 10px;
width: 100%;
border-bottom: 3px ridge #FF6;
margin: 0 5px 20px;
height: 105vh;
}
table.x {
position: relative;
padding: 0;
box-shadow: 0 1px 9px 1px #ccc;
border-radius: 6px;
margin: 20px auto;
table-layout: fixed;
width: 50%;
height: 100%;
max-height: 250px;
}
.x th {
color: #FFF;
background: #2C7EDB;
padding: 10px;
text-align: center;
vertical-align: middle;
}
.x tr:nth-child(odd) {
background-color: #333;
color: #FFF;
}
.x tr:nth-child(even) {
background-color: #D3E9FF;
color: #333;
}
.x td {
border-style: solid;
border-width: 1px;
border-color: #264D73;
padding: 5px;
text-align: left;
vertical-align: top;
position: relative;
}
.x thead th:first-child {
border-top-left-radius: 6px;
}
.x thead th:last-child {
border-top-right-radius: 6px;
}
.x tbody tr:first-child td:first-child {
border-top-left-radius: 6px;
}
.x tbody tr:first-child td:last-child {
border-top-right-radius: 6px;
}
.x tbody tr:last-child td:first-child {
border-bottom-left-radius: 6px;
}
.x tbody tr:last-child td:last-child {
border-bottom-right-radius: 6px;
}
.x thead + tbody tr:first-child td:first-child {
border-top-left-radius: 0;
}
.x thead + tbody tr:first-child td:last-child {
border-top-right-radius: 0;
}
/* Demo #1~~~~~~~~~~~~~~~*/
#styleSwitcher {
margin-bottom: 20px;
}
/* Dark */
.d h1,
.d h2,
.d h3,
.d h4,
.d h5,
.d h6,
.d legend,
.d figcaption {
color: #0ff;
}
body.d {
background: #222;
color: #EEE;
}
/* Light */
.l h1,
.l h2,
.l h3,
.l h4,
.l h5,
.l h6,
.l legend,
.l figcaption {
color: #00F;
}
body.l {
background: #EEE;
color: #222;
}
/* Demo #2~~~~~~~~~~~~~~~*/
/* Demo #3~~~~~~~~~~~~~~~*/
#demo03 img {
opacity: 1;
transition: opacity 0.3s;
width: 25em;
height: auto;
}
#demo03 img[data-src] {
opacity: 0;
}
/* Demo #4~~~~~~~~~~~~~~~*/
#demo04 .ellipse p:last-of-type {
display: block;
position: relative;
outline: 0;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
vertical-align: middle;
width: 100%;
}
/* Demo #5~~~~~~~~~~~~~~~*/
#demo05 * {
font-weight: bold;
text-decoration: none;
}
#demo05 .button {
width: 150px;
padding: 10px;
background-color: rgba(0, 102, 204, .6);
box-shadow: -8px 8px 10px 3px rgba(0, 0, 0, 0.2);
}
#demo05 .cover {
position: fixed;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 5;
width: 100%;
height: 100%;
display: none;
}
#demo05 #modal {
height: 380px;
width: 340px;
margin: 0 auto;
position: relative;
z-index: 10;
display: none;
background: rgba(0, 102, 204, .6);
border: 5px solid #cccccc;
border-radius: 10px;
}
#demo05 #modal:target,
#modal:target + .cover {
display: block;
opacity: 1;
}
#demo05 .cancel {
display: block;
position: absolute;
top: 3px;
right: 2px;
background: rgb(245, 245, 245);
color: black;
height: 30px;
width: 35px;
font-size: 30px;
text-align: center;
border-radius: 10px;
}
/* Demo #6~~~~~~~~~~~~~~~*/
* > a {
position: relative;
color: #000;
text-decoration: none;
}
* > a:hover {
color: #000;
}
* > a:before {
content: "";
position: absolute;
width: 100%;
height: 2px;
bottom: 0;
left: 0;
background-color: #000;
visibility: hidden;
-webkit-transform: scaleX(0);
transform: scaleX(0);
-webkit-transition: all 0.3s ease-in-out 0s;
transition: all 0.3s ease-in-out 0s;
}
* > a:hover:before {
visibility: visible;
-webkit-transform: scaleX(1);
transform: scaleX(1);
}
#part1 {
background: linear-gradient(to bottom, #b5bdc8 0%,#828c95 36%,#28343b 100%);
}
#part2 {
background: linear-gradient(to bottom, rgba(30,87,153,1) 0%,rgba(125,185,232,0) 100%);
}
#part3 {
background: linear-gradient(to bottom, rgba(246,230,180,1) 0%,rgba(237,144,23,1) 100%);
}
<!DOCTYPE html>
<html>
<head>
<!--Look to the left for the style.css file-->
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav id='menu'>
<!--All links will be dynamically inserted here-->
</nav>
</header>
<h1>Part2</h1>
<section id='part1'>
<h2>Part1</h2>
</section>
<section id='part2'>
<h2>Part2</h2>
</section>
<section id='part3'>
<h2>Part3</h2>
</section>
<!--Look to the left for the menu.js file-->
<script src="menu.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!--Look to the left for the style.css file-->
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav id='menu'>
<!--All links will be dynamically inserted here-->
</nav>
</header>
<h1>Page1</h1>
<section id='part1'>
<h2>Part1</h2>
</section>
<section id='part2'>
<h2>Part2</h2>
</section>
<section id='part3'>
<h2>Part3</h2>
</section>
<!--Look to the left for the menu.js file-->
<script src="menu.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!--Look to the left for the style.css file-->
<link rel="stylesheet" href="style.css">
</head>
<body>
<header>
<nav id='menu'>
<!--All links will be dynamically inserted here-->
</nav>
</header>
<h1>Page 3</h1>
<section id='part1'>
<h2>Part1</h2>
</section>
<section id='part2'>
<h2>Part2</h2>
</section>
<section id='part3'>
<h2>Part3</h2>
</section>
<!--Look to the left for the menu.js file-->
<script src="menu.js"></script>
</body>
</html>