Я хочу, чтобы нижний колонтитул был внизу страницы, но не отображался внизу. Он уходит в сторону или вверх рядом с навигацией или, если он отображается внизу страницы, то его цвет градиента фона применяется и к верхнему элементу div.
Я пробовал следующий код:
body::after {
content: '';
display: block;
height: 90px;
}
#footerindex {
position: absolute;
bottom: 0;
width: 100%;
height: 90px;
}
Second code-
#footer {clear: both;
position: relative;
height: 40px;
margin-top: -40px;
} <footer style = "background: linear-gradient(to bottom, #4e54c8, #8f94fb)">
<div id = "footerindex">
<a href = "terms.html"> Terms and conditions </a> <a href = "privacy.html" style = "padding-left: 15px;">Privacy Policy</a>
<p>© Copyright 2019 - jobg.xyz, All Rights Reserved. </p>
<p>Website designed and developed by Riven Apwbihls</p>
</div>
</footer>





Вы можете использовать flexbox. Для быстрой информации о flexbox нажмите здесь.
body {
display: flex;
flex-direction: column;
min-height: 100vh;
}
nav {
height: 50px;
width: 100vw;
background-color: green;
}
main {
width: 100vw;
flex: 1;
}
footer {
height: 50px;
width: 100vw;
background-color: grey;
}<body>
<nav>
Nav
</nav>
<main>
Main
</main>
<footer>
Footer
</footer>
</body>Элемент flex: 1 изменяет размер элемента main так, чтобы он занимал оставшееся место.
добавил ваш #footerindex css в footer
footer {
position: absolute;
bottom: 0;
width: 100%;
height: 90px;
}
body::after {
content: '';
display: block;
height: 90px;
}
footer {
position: absolute;
bottom: 0;
width: 100%;
height: 90px;
}
#footer {clear: both;
position: relative;
height: 40px;
margin-top: -40px;
}<footer style = "background: linear-gradient(to bottom, #4e54c8, #8f94fb)">
<div id = "footerindex">
<a href = "terms.html"> Terms and conditions </a> <a href = "privacy.html" style = "padding-left: 15px;">Privacy Policy</a>
<p>© Copyright 2019 - jobg.xyz, All Rights Reserved. </p>
<p>Website designed and developed by Riven Apwbihls</p>
</div>
</footer>