In: Computer Science
Apply following to header and footer sections of page:
center text
background color rgb(254,198,179)
padding should be 20px
// sample code with asked specification of header and footer sections of page:
center text, background color rgb(254,198,179), padding should be 20px //
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Creating Fixed Header and Footer with
CSS</title>
<style>
body{
padding-top: 20px;
padding-bottom: 20px;
}
.container{
width: 80%;
margin: 0 auto; /* Center the DIV horizontally */
}
.fixed-header, .fixed-footer{
width: 100%;
position: fixed;
text-align: center; /* Centering text */
background: rgb(254,198,179);/* header and footer colour
specification */
padding: 20px 20px; /* padding specification*/
}
.fixed-header{
top: 0;
}
.fixed-footer{
bottom: 0;
}
/* Some more styles to beutify this example */
nav a{
color: #fff;
text-decoration: none;
padding: 7px 25px;
display: inline-block;
}
.container p{
line-height: 100px; /* Create scrollbar to test positioning
*/
}
</style>
</head>
<body>
<div class="fixed-header">
<div class="container">
<nav>
<a href="#">Home</a>
<a href="#">About</a>
<a href="#">Contact</a>
</nav>
</div>
</div>
<div class="container">
<p>
TEST EXAMPLE</p>
</div>
<div class="fixed-footer">
<div class="container">Copyright © 2016 Your
Company</div>
</div>
</body>
</html>
OUTPUT: