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
-
Do you get penalized in search results when you use a heading tag, but it's not technically a heading (used for emphasis)?
Do you get penalized in search results when you use a heading tag, but it's not technically a heading? My clients are using heading tags for text they want to emphasize and make stand out. Does this affect search rankings for SEO?
Technical SEO | | jthompson05130 -
Still ok to use
This is the flag to prevent google storing a copy of your webpage. I want to use it for good reasons but in 2013 is it still safe to use. My websites not spammy but it's still very fresh with little to no links. Each item I sell takes a lot of research to both buy and sell with the correct info. Once it's sold one I may just come across another and want to hold my advantage of having already done my research and my sold price to myself. Competitors will easily find my old page from a long tail search. Some off my old sold pages keep getting hits and high bounce rates from people using it as reasearch and price benchmark. I want to stop this. So, No archive first, then 301 to category page once sold. Will the two cause a problem in googles eyes?
Technical SEO | | Peter24680 -
Can I use a 410'd page again at a later time?
I have old pages on my site that I want to 410 so they are totally removed, but later down the road if I want to utilize that URL again, can I just remove the 410 error code and put new content on that page and have it indexed again?
Technical SEO | | WebServiceConsulting.com0 -
Using meta keywords
Hello, I've read conflicting opinions regarding the use of meta keywords. I know Matt Cutts stated a few years ago that Google does not use them as a ranking signal but many still use them. This raises a few questions: 1. Is there any reason to still use meta keywords? 2. Isn't it just a way to let your competitors know what you're optimizing for? 3. How do other search engines treat meta keywords? Thanks!
Technical SEO | | mirel0 -
Using a Feedburner RSS link in your blog's header tag
It was suggested in Quick Sprout's Advanced SEO guide that it's good form to place your Feedburner RSS link into the header tag of your blog. Anyone know if this needs to be done for every page header of the blog, or just the home/main/index page? Thanks
Technical SEO | | Martin_S0 -
Does anyone use paid seo tools
Hi, i see a lot of people claiming that paid seo tools work, i would like to know if anyone uses them. I have a new site that i am building and i am wondering if there are any good paid tools out there that could help me gain exposure quicker. I get a lot of emails from well known companies promoting their paid tools but have never bought any as i believe you should hear from people who have tried them first. If you feel there are any good paid seo tools out there for help with rankings and link building then i would love to hear about them
Technical SEO | | ClaireH-1848860 -
Are building a page using HTML 5 better for seo?
Very general question really, but does anyone know whether Google sees html5 pages as being superior in any way to xhtml or html 4.x pages?
Technical SEO | | jimpannell0 -
How to use overlays without getting a Google penalty
One of my clients is an email subscriber-led business offering deals that are time sensitive and which expire after a limited, but varied, time period. Each deal is published on its own URL and in order to drive subscriptions to the email, an overlay was implemented that would appear over the individual deal page so that the user was forced to subscribe if they wished to view the details of the deal. Needless to say, this led to the threat of a Google penalty which _appears (fingers crossed) _to have been narrowly avoided as a result of a quick response on our part to remove the offending overlay. What I would like to ask you is whether you have any safe and approved methods for capturing email subscribers without revealing the premium content to users before they subscribe? We are considering the following approaches: First Click Free for Web Search - This is an opt in service by Google which is widely used for this sort of approach and which stipulates that you have to let the user see the first item they click on from the listings, but can put up the subscriber only overlay afterwards. No Index, No follow - if we simply no index, no follow the individual deal pages where the overlay is situated, will this remove the "cloaking offense" and therefore the risk of a penalty? Partial View - If we show one or two paragraphs of text from the deal page with the rest being covered up by the subscribe now lock up, will this still be cloaking? I will write up my first SEOMoz post on this once we have decided on the way forward and monitored the effects, but in the meantime, I welcome any input from you guys.
Technical SEO | | Red_Mud_Rookie0