2014-11-17 33 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,你的標題

相關問題