I am having some issues reducing the space on my footer using CSS grid. I've gotten to the point where my list items are on one line but I cannot find a way to reduce the gap in between. This may be because of my centering of it but I cannot figure it out after googling/playing.
https://codepen.io/DanielPeterHill/pen/pxjpzM
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
body {
font-family: 'Oswald', sans-serif;
color: #FEDCD2;
}
.nav-container {
width: 100%;
background: #DF744A;
margin: 0;
}
nav {
max-width: 1720px;
margin: 0 auto;
display: grid;
grid-template-columns: 1fr auto 1fr;
}
.left-menu {
grid-column: 1;
align-self: center;
}
.logo {
grid-column: 2;
}
#nav-toggle,
.burger-menu {
display: none;
}
nav a {
color: white;
text-decoration: none;
text-transform: uppercase;
transition: .3s all ease-in-out;
}
nav a:hover {
opacity: .7;
color: blue;
}
.left-menu a {
padding: 10px 0;
margin-left: 15px;
font-size: 14px;
font-weight: 300;
letter-spacing: 0.5px;
}
.logo {
font-size: 40px;
padding: 1rem;
}
.burger-menu {
grid-column: 1;
align-self: center;
margin-left: 20px;
}
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #DF744A;
color: white;
text-align: center;
}
footer {
display: grid;
grid-template-rows: auto 3fr auto;
}
.footer-left {
grid-column: 1;
align-self: center;
}
.footer-right {
grid-column: 3;
align-self: center;
list-style-type: none;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-row-gap: 50px;
}
.footer-right li {
text-decoration: none;
}
.footer-right li a {
color: white;
}
.footer-right li a:hover {
opacity: .7;
color: blue;
}
.underlineremove {
text-decoration: none;
text-decoration-style: none;
}
@media only screen and (max-width: 1025px) {
.burger-menu {
display: inline-block;
width: 40px;
}
.left-menu {
display: none;
}
#nav-toggle:checked~.left-menu {
display: grid;
grid-row: 2;
}
}
<link href="https://fonts.googleapis.com/css?family=Oswald:600" rel="stylesheet">
<div class="nav-container">
<nav>
<input type="checkbox" id="nav-toggle">
<label for="nav-toggle" class="burger-menu">
<img src="images/hamburger.png" alt="">
</label>
<div class="left-menu">
<a href="#">Shop</a>
<a href="#">Blog</a>
<a href="#">About</a>
<a href="#">Contact</a>
</div>
<a href="#" class="logo">Dill's Delight's</a>
</nav>
</div>
<div class="footer">
<footer>
<p class="footer-left"> © FarHill Deisgns </p>
<ul class="footer-right">
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
</ul>
</footer>
</div>
My example is above and any help would be amazing! My outcome would be to be able to reduce the gap beween the 4 TESTS in the bottom right to make it look a bit cleaner.
Thank you,
Dan
One option...don't use CSS-Grid at all on the footer. Flexbox would be simpler.
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
body {
font-family: 'Oswald', sans-serif;
color: #FEDCD2;
}
.footer {
/* not required for demo
position: fixed;
left: 0;
bottom: 0;
width: 100%;
*/
background-color: #DF744A;
color: white;
text-align: center;
}
footer {
display: flex;
}
.footer-left {
grid-column: 1;
align-self: center;
}
.footer-right {
margin-left: auto;
list-style-type: none;
display: flex;
}
.footer-right li {
text-decoration: none;
margin: .25em;
/* manages spacing */
}
.footer-right li a {
color: white;
}
.footer-right li a:hover {
opacity: .7;
color: blue;
}
.underlineremove {
text-decoration: none;
text-decoration-style: none;
}
<div class="footer">
<footer>
<p class="footer-left"> © FarHill Deisgns </p>
<ul class="footer-right">
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
</ul>
</footer>
</div>
Alternatively, if you must use CSS-Grid, then consider a two column grid and flex the ul...
footer {
display: grid;
grid-template-columns:1fr auto;
}
html,
body {
width: 100%;
height: 100%;
margin: 0;
}
body {
font-family: 'Oswald', sans-serif;
color: #FEDCD2;
}
.footer {
/* not required for demo
position: fixed;
left: 0;
bottom: 0;
width: 100%;
*/
background-color: #DF744A;
color: white;
text-align: center;
}
footer {
display: grid;
grid-template-columns: 1fr auto;
}
.footer-left {
grid-column: 1;
align-self: center;
}
.footer-right {
margin-left: auto;
list-style-type: none;
display: flex;
}
.footer-right li {
text-decoration: none;
margin: .25em;
}
.footer-right li a {
color: white;
}
.footer-right li a:hover {
opacity: .7;
color: blue;
}
.underlineremove {
text-decoration: none;
text-decoration-style: none;
}
<div class="footer">
<footer>
<p class="footer-left"> © FarHill Deisgns </p>
<ul class="footer-right">
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
<li><a href="#" class="underlineremove">TEST</a></li>
</ul>
</footer>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With