2014-11-17 32 views
0

我想对齐垂直文本与左侧的标志,但它似乎并没有工作。有什么建议么?这里是CSS代码:对齐标志与文本 - 二十一十一儿童主题(WordPress的)

* logo above site title */ 
#site-title a { 
    background: url('http://www.cultsotters.org.uk/images/cults_otters_black.png'); 
    background-repeat: no-repeat; 
    display: block; 
    height: 135px; 
    margin: 0; 
    text-align: center; 
    width: auto; 


} 
    #branding hgroup { 
    text-align: center; display: inline; margin:0; align:center;} 

    #site-title, #site-description { 
    margin: 0 auto; text-align: center; 
    } 

HTML代码:

</head> 

<body class="home blog logged-in admin-bar no-customize-support custom-background single-author two-column right-sidebar"> 
<div id="page" class="hfeed"> 
    <header id="branding" role="banner"> 
      <hgroup> 
       <h1 id="site-title"><span><a href="http://cultsotters.org.uk/" rel="home">Cults Otters Amateur Swimming Club</a></span></h1> 
       <h2 id="site-description"></h2> 
      </hgroup> 
+0

请提供所有相关的代码......也许像一些HTML? –

+0

这是Wordpress,所以无法提供HTML - 但URL是http://www.cultsotters.org.uk。 –

+0

转到页面并单击“查看源代码”可以获得您的HTML。备查。 –

回答

0

在WordPress的添加到您的CSS页面设置line-height:35px

#site-title > span > a { 
    line-height: 105px; 
} 

这会降低拉你的文本中心与IMG(如果它不完全是你想要什么,调整line-height

编码快乐:)

+1

谢谢,你的帮助。 –

+0

@LaurensVanOorschot你非常欢迎。 –

0

难没有所有的细节形象化的说法,但一个简单的窍门是你的行高设置元素的高度。假设你的标志和文字具有相同的高度在这里135px,你的标题

相关问题