2016-08-02 61 views
0

我无法让我的社交媒体按钮在我的网站页脚上左右对齐。我不确定我做错了什么,任何人都可以请帮忙吗?如何在页脚中对齐

我已经试过margin-leftmargin-rightfloat: leftfloat: right

这是我和它是所有中心。

HTML

<footer class="container-fluid text-center"> 
    <div class="row" id="contact"> 
    <p class="col-sm-4"></p> 
    <h1>Reach me here</h1> 
    <br> 
    <br> 
    <a href="https://twitter.com/Aarons_coding" target="_blank"> 
     <img src="images/twitter.png" alt="twitter" id="twitt"> 
     <br/> Follower me 
    </a> 
    <a href='https://www.facebook.com/freelancecoding/posts/1534409766779543' target="_blank"> 
     <img src="images/fb.png" alt="fb" id="fb"> 
     <br/>Like Me on FB 
    </a> 
    <a href='https://www.linkedin.com/in/aaron-s-706193125' target="_blank"> 
     <img src="images/link.png" alt="linkedin" id="link"> 
     <br/>Connect with me 
    </a> 

    </div> 
    <ul> 
    <li><a href="#top">Top</a></li> 
    <li><a href="#design">About the Designer</a></li> 
    </ul> 
    <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d401398.0917589909!2d-85.9569564028764!3d38.18847214627973!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x88690b1ab35bd511%3A0xd4d3b4282071fd32!2sLouisville%2C+KY!5e0!3m2!1sen!2sus!4v1470171263135" 
    width="350" height="250" frameborder="0" style="border:0" allowfullscreen></iframe> 
    <div style="clear: both"></div> 
</footer> 

CSS

#twitt { 
    width: 95px; 
    height: 95px; 
    margin: 5px 5px 0 18px; 
} 

#fb { 
    width: 95px; 
    height: 95px; 
    margin: 5px 0 5px; 
} 

#link { 
    width: 95px; 
    height: 95px; 
    margin: 5px 5px 0 5px; 
} 

footer { 
    background-color: rgba(0, 0, 0, 1); 
    font-size: 12px; 
    padding: 20px 0; 
    text-align: center; 
} 

footer .col-sm-4 { 
    display: flex; 
    justify-content: flex-end; 
} 

footer ul { 
    float: right; 
    text-align: right; 
    list-style: none; 
} 

footer li img { 
    width: 32px; 
    height: 32px; 
} 
+0

Hiya,有人似乎已经回答了你的问题,但只是为了让你知道如果你不知道,你可以使用[fontawesome](https://fontawesome.io/icons/)哪些船风趣h bootstrap或自举图形类插入社交媒体图标。它们将它作为文本插入,因此它使得样式变得更容易(您可以在其上执行诸如“文本对齐”或“字体大小”之类的操作。) –

回答

0

你可能没有设置正确的元素的样式。

如果你做这样的工作原理:

#contact a{ 
    float: left; 
} 

例这里https://jsfiddle.net/hw3odrba/

+0

谢谢!为你提供帮助:) – ctapn1307

+1

我很高兴我的帮助。如果它解决了您的问题,请考虑通过点击绿色复选标记来接受我的答案。 – jakob

0

您需要设置新的风格在你的CSS,如果你要对齐项目的权利:

#contact a{ 
    float: right; 
}