undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

Browse the forum for helpful insights and fresh discussions about all things SEO.

  1. Home
  2. SEO Tactics
  3. Technical SEO
  4. Is using a Href in Div OK?

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Is using a Href in Div OK?

Technical SEO
4
7
4.5k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • James77
    James77 last edited by Jul 18, 2011, 7:40 AM

    Hi,

    I was just wondering what your thoughts are on using a Href in a Div, which contains anchor text. We currently use the Href on the div, as opposed to just the anchor text as I want the whole div to be clickable as opposed to just the anchor text.

    So currently I have:

    Keword 1
    Keyword 2

    Is this perfectly fine to do it like this as opposed to using <a tags="" ???<br="">I suppose there are various alternatives - if you must use the</a><a tag="" like:<="" p=""></a>

    <a tag="" like:<="" p=""></a>

    Keword 1
    Keyword 2

    However I would assume a search engine is smart enought to know its the same thing???

    Thanks

    1 Reply Last reply Reply Quote 0
    • James77
      James77 @James77 last edited by Jul 18, 2011, 8:53 AM Jul 18, 2011, 8:53 AM

      Many thanks - I'm going to have a serious word with my coders!!

      1 Reply Last reply Reply Quote 1
      • RyanKent
        RyanKent @James77 last edited by Jul 18, 2011, 8:43 AM Jul 18, 2011, 8:42 AM

        As Dave shared, the W3C is the official organization for determining the validity of code. Generally speaking, you want your code to be valid.

        If you want an area to be a click-able link try Maximise's suggestion.

        1 Reply Last reply Reply Quote 1
        • James77
          James77 @RyanKent last edited by Jul 18, 2011, 8:31 AM Jul 18, 2011, 8:31 AM

          Jesus - Thanks.

          So your telling me that its totally invalud to:
          1/. Wrap a href tag around a div tag.

          2/. Put a href tag as an atribute on a div tag.

          If that is the case I'm going to have so serious words with my coders!!

          RyanKent James77 2 Replies Last reply Jul 18, 2011, 8:53 AM Reply Quote 0
          • blackballonline
            blackballonline last edited by Jul 18, 2011, 8:53 AM Jul 18, 2011, 8:03 AM

            Any time I have a question about valid HTML I go to the Source. W3C has an invaluable tool for HTML . Becoming familiar with this will help you always create clean code.

            1 Reply Last reply Reply Quote 2
            • Maximise
              Maximise last edited by Jul 18, 2011, 8:53 AM Jul 18, 2011, 8:02 AM

              I would try and stay clear of doing this to be honest. It won't validate, older browsers may have problems with it and I'm not sure how search engines would treat it (they may not follow it). There are better ways to do it.

              If you set your anchor tag to 'display:block' you can then set the height and width too. This way the whole div would be the link, not just the text.

              1 Reply Last reply Reply Quote 3
              • RyanKent
                RyanKent last edited by Jul 18, 2011, 8:32 AM Jul 18, 2011, 8:00 AM

                Neither option is valid HTML. Browser behavior and crawler behavior would be unpredictable.

                The code would be something like:

                Keword 1
                  

                James77 1 Reply Last reply Jul 18, 2011, 8:31 AM Reply Quote 1
                • 1 / 1
                1 out of 7
                • First post
                  1/7
                  Last post

                Got a burning SEO question?

                Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                Start my free trial


                Browse Questions

                Explore more categories

                • Moz Tools

                  Chat with the community about the Moz tools.

                • SEO Tactics

                  Discuss the SEO process with fellow marketers

                • Community

                  Discuss industry events, jobs, and news!

                • Digital Marketing

                  Chat about tactics outside of SEO

                • Research & Trends

                  Dive into research and trends in the search industry.

                • Support

                  Connect on product support and feature requests.

                • See all categories

                Related Questions

                • nazfazy

                  Using 2 cache plugin good or not?

                  Hi, Can anyone tell me - whether using  2 cache plugin helps or it cause any issue? Besides, when i used w3 cache plugin in WordPress its found like inline CSS issue to get cleared. So, i tried auto optimized but my website Soc prollect gone crashed in between while using the some.  Is there any solution and can anyone tell me which plugin advantages to speed the site by removing java script and inline css at a time.

                  Technical SEO | Aug 6, 2020, 12:14 AM | nazfazy
                  0
                • jarydcat1

                  Merge 2 websites into one, using a non-existing, new domain.

                  I need to merge https://www.WebsiteA.com and https://www.WebsiteB.com to a fresh new domain (with no content) https://www.WebsiteC.com. I want to do it the best way to keep existing SEO juice. Website A is the companies home page and built with Wordpress Website B is the company product page and built with Wordpress Website C will be the new site containing both website A and B, utilizing Wordpress also. What is the best way to do this? I have research a lot and keep hitting walls on how to do it. It's a little trickier because it's two different domains going to a brand new domain. Thanks

                  Technical SEO | Mar 12, 2018, 9:22 PM | jarydcat1
                  0
                • DebashishB

                  How to track my actual traffic source using Google Analytics which are now showing as referral traffic?

                  Hi Mozzers, I went through many Q&As in the community this morning. I found a solution where I could just remove the referral site in analytics>admin>property>tracking info>referral exclusion list. So I removed paypal.com which was the main referral traffic. I thought the problem is solved. Later today I got another order, now the referral traffic is from eway.com, now what? Yes I know I will add this to the exclusion list but there will be many more referral sites. My main concern is I am not able to track the actual traffic source. How do I do that? 1. Do I need to use google url tracking for all my pages?
                  2. Do I need to add tracking code in each page of the site?
                  3. Is there a way to track the actual source of this traffic, now that the transaction is already made but reflects as referral traffic in Google Analytics? jZjTN

                  Technical SEO | Sep 21, 2016, 10:48 AM | DebashishB
                  0
                • AL123al

                  Is it ok to use H1 tags in breadcrumbs?

                  A client has an e-commerce site and she doesn't want a page title on the products page. She has breadcrumbs though. Her website developer suggests putting the H1 on the breadcrumbs. So: products> Gifts > picture frame with h1 tags round the word "picture frame". Is this ok to do? Or is it a bad thing for SEO purposes? Thanks

                  Technical SEO | Jan 27, 2014, 2:55 PM | AL123al
                  0
                • elytical

                  Using a non-visible H1

                  I have a developer that wants to use style="text-indent:-9999px" to make the H1 non-visible to the user.  Being the conservative person I am, I've never tried this before and worry that Search Engines may think this is a form of cloaking.  Am I worrying about nothing?  And apologies if it's already been covered here.  I couldn't find it.  Thanks in advance!!!!

                  Technical SEO | Nov 19, 2012, 1:07 PM | elytical
                  0
                • blakadz

                  Redirect non-www if using canonical url?

                  I have setup my website to use canonical urls on each page to point to the page i wish Google to refer to. At the moment, my non-www domain name is not redirected to www domain. Is this required if i have setup the canonical urls? This is the tag i have on my index.php page rel="canonical" href="http://www.mydomain.com.au" /> If i browse to http://mydomain.com.au should the link juice pass to http://www.armourbackups.com.au? Will this solve duplicate content problems? Thanks

                  Technical SEO | Feb 28, 2012, 2:53 AM | blakadz
                  0
                • Martijn_Scheijbeler

                  Using Schema.org: Product or Event as the schema type?

                  Hello, Most of you heard from the launch of the new format for microdata: Schema.org and my question is about the different types of Schema they provide. Our websites provide an overview of courses, visitors can search/filter training courses and most important: read peer reviews. Until now we formatted (the source) of those courses with the schema type "Product" because it allows us to provide search engines with metadata about reviews via the "Aggregrated Rating". Recently we updated the information about courses, to also provide start dates and locations to users, just like the schema type for: "Events". Because we would like to provide search engines also with both types of data I would like to know your opinion. Schema.org looks like not to support the Aggregated Rating for Events and vice versa for Startdates/Locations for the Product type. And combining the two Schema types also does not looks like an option because we can't put them on the same level like it should be. So what would you recommend to use for kind of schema type(s), are we able to use the 'Product' type next to the 'Event' type and so to combine them? Thanks a lot!

                  Technical SEO | Sep 22, 2011, 12:55 PM | Martijn_Scheijbeler
                  0
                • 5225Marketing

                  How to handle sitemap with pages using query strings?

                  Hi, I'm working to optimize a site that currently has about 5K pages listed in the sitemap.  There are not in face this many pages.  Part of the problem is that one of the pages is a tool where each sort and filter button produces a query string URL. It seems to me inefficient to have so many items listed that are all really the same page.  Not to mention wanting to avoid any duplicate content or low quality issues. How have you found it best to handle this?  Should I just noindex each of the links?  Canonical links? Should I manually remove the pages from the sitemap?  Should I continue as is? Thanks a ton for any input you have!

                  Technical SEO | Apr 1, 2011, 4:34 AM | 5225Marketing
                  0

                Get started with Moz Pro!

                Unlock the power of advanced SEO tools and data-driven insights.

                Start my free trial
                Products
                • Moz Pro
                • Moz Local
                • Moz API
                • Moz Data
                • STAT
                • Product Updates
                Moz Solutions
                • SMB Solutions
                • Agency Solutions
                • Enterprise Solutions
                Free SEO Tools
                • Domain Authority Checker
                • Link Explorer
                • Keyword Explorer
                • Competitive Research
                • Brand Authority Checker
                • Local Citation Checker
                • MozBar Extension
                • MozCast
                Resources
                • Blog
                • SEO Learning Center
                • Help Hub
                • Beginner's Guide to SEO
                • How-to Guides
                • Moz Academy
                • API Docs
                About Moz
                • About
                • Team
                • Careers
                • Contact
                Why Moz
                • Case Studies
                • Testimonials
                Get Involved
                • Become an Affiliate
                • MozCon
                • Webinars
                • Practical Marketer Series
                • MozPod
                Connect with us

                Contact the Help team

                Join our newsletter
                Moz logo
                © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                • Accessibility
                • Terms of Use
                • Privacy

                Looks like your connection to Moz was lost, please wait while we try to reconnect.