Greetings! I'm new to the semantic-ui framework and I'm encountering an issue with the footer. My goal is to have the footer always stay at the bottom of the page without being fixed.
Here's a snippet of my simple HTML code:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<nav class="ui borderless menu">
</nav>
<div class="desc">
</div>
<div class="ui container">
</div>
<div class="ui container">
</div>
<footer class="footer">
</footer>
</body>
</html>
I've attempted using the following CSS:
body {
position: relative;
height: 100%;
}
.footer {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
}
Unfortunately, it doesn't seem to work as expected. The footer only stays at the bottom when the page's height is less than 100% of the monitor's height. When the height exceeds 100%, the footer floats. You can see what I mean in this image: https://i.sstatic.net/RqJD2.png.
I even tried modifying the body CSS like this:
body {
position: relative;
min-height: 100%;
}
However, the issue persists. Can anyone provide some assistance?
To give you a better understanding, here is the complete code. I included a lengthy table so you can see that when you click the filter, it pushes the table down and messes up the footer alignment.
body {
height: 100%;
color: #696F84;
position: relative;
}
.menu {
border-radius: 0 !important;
}
.item {
color: #696F84 !important;
}
.logo {
margin-right: 7px !important;
}
.company {
font-family: 'Righteous', cursive;
font-weight: normal;
font-size: 27px;
color: #515151;
padding-bottom: 2px;
}
.desc {
position: relative;
background-color: #EEEEEE;
margin-top: -1rem;
padding: 30px 0;
font-family: Raleway;
font-size: 24px;
color: #757575;
}
#filter {
width: 100%;
margin: 20px 0;
}
.footer {
background-color: #212121;
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 15px 0;
}
<link href="//oss.maxcdn.com/semantic-ui/2.1.6/semantic.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="//oss.maxcdn.com/semantic-ui/2.1.6/semantic.min.js"></script>
<nav class="ui borderless menu">
<div class="header item">
<img class="logo" src="./img/logo.jpg" alt="logo">
<div class="company">Company Name</div>
</div>
<!-- end left menu -->
</nav>
<!-- end navbar -->
<div>
<div class="ui container">
<p>"Description here | Lorem Ipsum... (This text has been truncated)