开发者

Does display: none affects SEO on a navigation menu?

开发者 https://www.devze.com 2023-01-11 08:12 出处:网络
i want to know if using display:none (via CSS) on a menu will affect SEO (make it les开发者_开发问答s efficient) than using only display:none (via jQuery)

i want to know if using display:none (via CSS) on a menu will affect SEO (make it les开发者_开发问答s efficient) than using only display:none (via jQuery)

Thank you


From a usability AND SEO perspective, you shouldn't hide elements that are crucial to the webpage - i.e. the primary navigation.

If your requirement is to first hide it and show based on some user action, I would use jQuery to do the hiding.

EDIT: I understand your problem that the navigation might be visible for a brief second before jQuery "kicks in", however this can be solved using inline javascript instead of the usual $(document).load() event.

<ul id="menu"></ul>
<script type="text/javascript">
    document.getElementById('menu').style.display = 'none'; // OR
    $("#menu").hide();
</script>

Hope this helps,

Marko

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号