I've been experimenting with a simple template to create a basic website layout featuring a header, footer, and a right-hand sidebar.
However, I'm facing difficulties in setting the right-hand bar to occupy 100% of the page, even after ensuring that all parent elements and the right bar itself are set to 100%:
https://i.sstatic.net/ndY2Y.png
If anyone could provide guidance on where I might be making a mistake, it would be greatly appreciated!
* {
margin: 0;
padding: 0;
}
html {
height: 100%;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
body {
font: 16px/26px Helvetica, Helvetica Neue, Arial;
height: 100%;
}
.wrapper {
width: 100%;
min-height: 100%;
}
/* Header */
.header {
height: 50px;
background: #FFE680;
}
/* Middle */
.middle {
width: 100%;
padding: 0 0 50px;
position: relative;
height: 100%;
}
.middle:after {
display: table;
clear: both;
}
.container {
width: 100%;
float: left;
overflow: hidden;
height: 100%;
}
.content {
height: 100%;
}
/* Right Sidebar */
.right-sidebar {
float: right;
width: 250px;
margin-left: -250px;
position: relative;
background: #FFACAA;
height: 100%;
}
/* Footer */
.footer {
margin: -50px auto 0;
height: 50px;
background: #BFF08E;
position: relative;
}
<div class="wrapper">
<header class="header">
<strong>Header:</strong>Header
</header>
<div class="middle">
<div class="container">
<main class="content">
<strong>Content:</strong>Content
</main>
</div>
<aside class="right-sidebar">
<strong>Right Sidebar:</strong>Right sidebar
</aside>
</div>
</div>
<footer class="footer">
<strong>Footer:</strong>Footer
</footer>