【问题标题】:Add Icon to Footer将图标添加到页脚
【发布时间】:2013-12-06 19:22:43
【问题描述】:

如何将图标添加到页脚?这是我完成的以下代码。

CSS:

#footer {
    padding: 0 10px;
    background:#EEE;
    bottom:0px;
    right:0px;
    left:0px;
    position:fixed;
    box-shadow: 0px 0px 8px 0px #000000;

    }
    #footer p {
    margin: 0;
    padding: 10px 0;
}

和 HTML:

<div id="footer">
    <p><center>2013 - Index</center>
    <img style="text-align:right" src="./images/ranbir.jpg"  height="25" width="25"></p>
</div>

感谢您的帮助!

我正在尝试将 2013 - 索引放在中间,并且图标向右。但这似乎一点也不对。

【问题讨论】:

    标签: html icons footer


    【解决方案1】:

    试试:

    <img style="float:right" src="./images/ranbir.jpg"  height="25" width="25"></p>
    

    <img style="position:absolute; right:0;" src="./images/ranbir.jpg"  height="25" width="25"></p>
    

    如果这对你有帮助,请告诉我,如果你想看看它是否有效,请查看 http://jsfiddle.net/s89s7

    编辑:澄清一下,text-align 仅适用于该元素内的内容。例如

    <body>
        <p style="text-align:center">Text</p>
    </body>
    

    将在“p”内对齐“Text”,但不会在“body”内对齐“p”。希望这是有道理的。

    【讨论】:

    • 谢谢它有效。我如何让图标上升一点,与文本相同的行?你知道我的意思? @joshhunt
    • 我建议使用 position:absolute,这样你就可以控制它,并通过使用 top、bottom、left 和 right 让它去任何你想去的地方。例如。 destil.cz/images/stackoverflow.png" height="25" width="25"> 看看更新的小提琴。
    猜你喜欢
    • 1970-01-01
    • 2017-12-08
    • 2018-10-21
    • 2016-04-30
    • 2015-10-09
    • 2015-09-23
    • 2016-07-16
    • 1970-01-01
    • 2021-11-30
    相关资源
    最近更新 更多