【问题标题】:Problems with logo positioning标志定位问题
【发布时间】:2015-01-21 10:23:21
【问题描述】:

网址:http://ruslanchik.ru/go

您好,我在尝试使我的徽标位于页面中心时遇到了特定的困难。我尝试了 margin:autovertical-align:middle, text-align:center,但完全没有帮助。 p>

div的样式:

#logo {
width:100%;
top:25%;
margin:auto;
position:absolute;
width:667px;
height:32px;
background:url(../i/logo.png) no-repeat;

需要:水平居中的徽标。

非常感谢。

【问题讨论】:

    标签: html css position center


    【解决方案1】:

    试试这个并将#logo移出中心标签。你不再需要中心标签了。

    #logo {
        width: 100%;
        height: 190px;
        background: url(../i/logo.png) no-repeat center;
    }
    

    【讨论】:

    • @ruslanchik 我在你的网站上看到 css 不是我在这里写的。将高度设置为 190px 并删除 position:absolute 和 top:25%。如果你愿意,我会发布编辑器的截图。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多