简体   繁体   English

为什么不是我的

[英]Why isn't my <a href working

I am using wordpress and I need to put my privacy policy in my footer.我正在使用 wordpress,我需要将我的隐私政策放在我的页脚中。 I managed to implement my "Disclosure" and "Disclaimer" as links but not my privacy policy.我设法将我的“披露”和“免责声明”作为链接而不是我的隐私政策。 This is the code before my change:这是我更改之前的代码:

    <div class="clearfix container">
        <div class="site-info">
            &copy; <?php echo date('Y'); ?> <?php bloginfo( 'name' ); ?>. All rights reserved.    |     <a href="http://www.example.com/disclaimer">Disclaimer </a &#8226;
        </div><!-- .site-info -->
 <a href="http://www.example.com/disclosure">Disclosure </a abdf;
 </div>

And this is after:这是之后:

<footer id="colophon" class="site-footer" role="contentinfo">
    <div class="clearfix container">
        <div class="site-info">
            &copy; <?php echo date('Y'); ?> <?php bloginfo( 'name' ); ?>. All rights reserved.    |     <a href="http://www.example.com/disclaimer">Disclaimer </a &#8226;
        </div><!-- .site-info -->

 <a href="http://www.example.com/disclosure">Disclosure </a abdf;

 <a href="http://www.example.com/privacy-policy">Privacy-Policy </a abdf;


    </div>

So I have "privacy policy" at my site but you cant click on it.所以我在我的网站上有“隐私政策”,但你不能点击它。 Where did I go wrong?我哪里做错了?

You've got a typo when closing your a tags, you're missing the closing > 's;你在关闭 a 标签时有一个错字,你错过了结束>

<a href="http://www.example.com/disclosure">Disclosure</a>
<a href="http://www.example.com/privacy-policy">Privacy-Policy</a>

you are missing the closing tags for anchor tag您缺少锚标记的结束标记

<a href="http://www.example.com/disclosure">Disclosure</a>

you missed </a>你错过了</a>

Browsers are the ones that close opened tags, it doesnt work by itself.浏览器是关闭打开标签的浏览器,它本身不起作用。 But not closing, it could lead you to having hierachical problems.但不是关闭,它可能会导致您遇到等级问题。 Child elements can mix up with parent elements and loose your layout completely.子元素可以与父元素混合并完全松散您的布局。 In your case, disclosure link becomes a parent link because you have not closed the end tag for it.在您的情况下,披露链接成为父链接,因为您尚未关闭它的结束标记。 That is the reason first link is working and PP is getting mixed up with disclosure and lost an identity.这就是第一个链接正在工作并且 PP 与披露混淆并失去身份的原因。

Hope this helps!!希望这可以帮助!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM