[HTML] Snippet

Document start, Load favicon, css, js, UTF-8

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="icon" href="..../xxx.ico">
<link rel="stylesheet" type="text/css" href="..../xxx.css">
<script src="..../xxx.js"></script>
</head>
<body>
</body>
</html>
<html>
<head>
<style>
body {
display: flex;
height: 100%;
flex-direction: column;
margin: 0px;
}
main {
overflow: auto;
flex: 1;
}
footer {
background-color: darkgrey;
width: 100%;
height: 100px;
}
</style>
</head>
<body>
<header>
</header>
<main>
</main>
<footer>
</footer>
</body>
</html>

Source with JQuery

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<style type="text/css">
.active {
background-color: #aaaaaa;
}
</style>
<script>
$(document).ready(function() {
$menuItem = $('#menu').children('.item');
$menuItem.each(function() {
$(this).click(onClickMenuItem);
});
});
onClickMenuItem = function() {
$('#menu').children('.item').filter('.active').removeClass('active');
$(this).addClass('active');
}
</script>
</head>
<body>
<div id="menu">
<a class="item active">menu 1</a>
<a class="item">menu 2</a>
<a class="item">menu 3</a>
</div>
</body>
</html>
Share