Is using a Href in Div OK?
-
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 2Is 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>
However I would assume a search engine is smart enought to know its the same thing???
Thanks
-
Many thanks - I'm going to have a serious word with my coders!!
-
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.
-
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!!
-
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.
-
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.
-
Neither option is valid HTML. Browser behavior and crawler behavior would be unpredictable.
The code would be something like:
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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.
Related Questions
-
Duplicate blog - will it be ok to do so
Hello, One of our client is interested in creating a duplicate blog under a new URL. We told them about Google penalizing the new blog since it would have duplicate content. Will it be ok to go ahead with the plan ? Their response was there are multiple news sites that carry the same stories. So, they said that it won't matter. Cheers
Technical SEO | | Johnroger0 -
The use of Markup language
Hi, We were thinking of adding markup language to our site. We have been reading about it to understand the actual benefits of doing so (we have seen many brands are not using it, including moz.com). So I have two questions: 1- Would you recommend using it for our site? www.memoq.com 2- If yes, would it be better to create a snippet of code for our home page as an "organization" and then different snippets for our product pages as "products". Looking forward to your comments,
Technical SEO | | Kilgray0 -
Partial duplicate content (reviews) on product pages - is this ok?
Hello, we recently received some really good reviews about a range of products we sell (there are normally 8 products in a range). Due to the industry we are in it made no sense to try and get reviews on each individual product within the range as they differ only ever so slightly. So my question is we want to add these reviews to each of the 8 products that lie within each range, but by adding them it would mean that each page has around 600 words of unique product description followed by approx 600 words of reviews that are the same on each of the products within that range. Is this ok? my only other option would be to screenshot the reviews and upload them as images below each product description. If anyone could offer advice here that would be much appreciated. Thanks
Technical SEO | | livs20130 -
Does anyone have experience using Attracta with a Miva Merchant website?
I am looking for more information on Attracta, which is now a certified app for Plesk and Parallels Automation. You can apparently install Attracta for Parallels from the Apps Catalog.
Technical SEO | | djlittman0 -
Using Rel=Author with Multiple Contributors
I have multiple contributors who provide content on our page. I have created an authors page that shows the picture and bio of each author along with their Google+ profile link. Each profile link goes to the authors respective profile where I have had them verify themselves as contributors. My question is will Google see each of these authors and attribute the rel=author tag correctly (even though they are listed on the same profile page) or will Google only take the first person I point to for Rel=Author?
Technical SEO | | PLEsearch0 -
What is "evttag=" used for?
I see evttag= used on realtor.com, what looks to be for click tracking purposes. Does anyone know if this is an official standard or something they made up?
Technical SEO | | JDatSB0 -
How do I use only one URL
my site can be reach by both www.site.com and site.com. How do I make it only use www?
Technical SEO | | Weblion0 -
Use target keyword on several page titles or homepage only?
If I want my homepage to rank for a keyword (ie "red widgets"), does it support or dilute the homepage's rank if I use the keyword on other pages? I can see it working either way: The search engine looks at your site, sees that the target keyword is used throughout the site, and ranks the site higher as a result. Using the keyword on several pages makes it so none of them stand out, and ultimately it's harder to rank highly. Thoughts?
Technical SEO | | Kyle_M0