C. Lagos C. Lagos - 2 months ago 12
CSS Question

Creating Footer HTML/CSS - Not Working

I'm trying to create a footer with 2 classes but for some reason they are not in the same line as each other. I've tried everything and I have no idea what the issue is. There is also additional white space below the footer. I want the footer to be a fixed height and keep the 2 elements on the same line (Copyright is centered and the icons are to the right). Can someone please help?

HTML:

<footer>

<div class="footer">

<div class="copyright">Copyright</div>

<div class="social-icons-footer">
<ul>
<li><a href="#" target="_blank"><i class="fa fa-instagram" style="font-size:30px"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-facebook" style="font-size:30px"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-twitter" style="font-size:30px"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-linkedin" style="font-size:30px"></i></a></li>
</ul>
</div>
</div>


</footer>


CSS:

footer {
clear: both;
position: relative;
width: 100%;
height: 60px;
background-color: black;
}

footer .copyright {
text-align: center;
padding: 12px;
font-size: 12px;
color: white;
}


footer .social-icons-footer ul {
list-style: none;
float: right;
}

footer .social-icons-footer li {
display: inline-block;
}

.social-icons-footer ul a {
color: white;
margin: 14px;
}

.social-icons-footer ul a:hover {
color: grey;
}


Currently, it looks like this Image - I want copyright to be in the center and the social icons to be to the right on the SAME line.

Answer

http://codepen.io/anon/pen/KgzvrY

The changed settings are (in addition to the other settings):

footer {
   line-height: 60px;
 }
footer .social-icons-footer ul {
   position: absolute;
   top: 0px;
   right: 12px;
   margin: 0;
 }
footer .social-icons-footer li {
   line-height: 0px;
 }
Comments