2013-07-23 40 views
1

如果此问题已被回答,请提前致歉,但我最难让我的标识链接到此处:http://testsite.brentthelendesign.com/。这是一个WordPress“基于骨架”的网站。任何帮助将不胜感激!代码如下。标题标题链接问题(WordPress)

HTML

<header class="left full header-bg"> 
    <div class="container"> 
     <div class="container-inside left"> 
      <div class="sixteen columns"> 
       <h1 class="logo abs"><a href="<?php echo get_option('home'); ?>"/></a></h1> 
       <nav> 
        <?php st_navbar(); ?> 
       </nav> 
      </div> 
     </div> 
    </div><!--container--> 
</header> 

CSS

h1.logo { 
left:50%; 
margin-left:-80px; 
float: none; 
text-align: center; 
} 


h1.logo a { 
background:url(images/logo.png) no-repeat; 
width:181px; 
height:127px; 
display:block; 
text-indent:-9999px; 
float: none; 
text-align: center; 
cursor: pointer; 
} 


.header-bg { 
height: 190px; 
background: url(images/bg-header.png) repeat; 
} 

回答

0
> using this css you can display your logo with your home url. 


h1.logo { 
    float: none; 
    left: 50%; 
    margin-left: -80px; 
    text-align: center; 
    z-index: 10000; 
} 

h1.logo a img{ 
       display:block; 
} 

enter image description here

+0

哇。非常感谢...呃。我只是没有定义h1.logo img – beetheezy

0

你的模板被设置为使用WP_HOME值作为链接,这是Settings > General下的WordPress管理配置。您也可以通过在wp-config.php明确设置恒定值覆盖此值:

define('WP_HOME', 'http://example.com'); 
define('WP_SITEURL', 'http://example.com'); 

,如果你想硬编码(这是比较有效的,如果它永远不会改变),用户也可以直接编辑模板文件,用您想要的网址替换<?php echo get_option('home'); ?>

+0

感谢您的答复.. Iv'e想你的建议和标识根本无法点击......难道这是事做它是一个背景图像? – beetheezy

+0

它是锚标签上的背景元素,所以'A'应该是可点击的。你能否使用chrome中的“Inspect Element”来确保DOM元素是可选的? – doublesharp

0

你可以尝试,而不是通过CSS将您的标志设置为背景图像放在这里?

​​

试试这个,告诉我它是怎么回事。

+0

嗯.....我也试过这个,甚至没有显示图像,直到我设置h1.logo a到h1.logo {display:inline;}但图像仍然不可链接。 – beetheezy