<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Making DIV a Link &#8211; Javascript Vs CSS?</title>
	<atom:link href="http://web-kreation.com/all/making-div-a-link-javascript-vs-css/feed/" rel="self" type="application/rss+xml" />
	<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/</link>
	<description>Web &#38; Graphic Design by Jeremie Tisseau, Web Design Consultant at Calleo</description>
	<lastBuildDate>Mon, 06 Feb 2012 16:52:14 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Minh Vuong Nguyen</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-24872</link>
		<dc:creator>Minh Vuong Nguyen</dc:creator>
		<pubDate>Thu, 02 Feb 2012 06:26:06 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-24872</guid>
		<description>Thanks very much.
But...i&#039;ve a question about &quot;onclick&quot;
May it&#039;d open new windows when i&#039;d click on div Tag? Like &quot;target=&#039;_blank&#039;&quot;?
Thanks!</description>
		<content:encoded><![CDATA[<p>Thanks very much.<br />
But&#8230;i&#8217;ve a question about &#8220;onclick&#8221;<br />
May it&#8217;d open new windows when i&#8217;d click on div Tag? Like &#8220;target=&#8217;_blank&#8217;&#8221;?<br />
Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dan</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-15859</link>
		<dc:creator>dan</dc:creator>
		<pubDate>Tue, 03 Aug 2010 09:59:35 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-15859</guid>
		<description>For example I used js when div doesn&#039;t have any importance (eg. voting)and css on the navigation. I like your site.</description>
		<content:encoded><![CDATA[<p>For example I used js when div doesn&#8217;t have any importance (eg. voting)and css on the navigation. I like your site.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Montana Flynn</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-4562</link>
		<dc:creator>Montana Flynn</dc:creator>
		<pubDate>Sat, 18 Apr 2009 03:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-4562</guid>
		<description>great ways to do it, but their are a few caveats. 

1) The javascript way will not be spidered by search engines (bad seo)

2) The CSS way cannot be used if you have any header tags in the div.

How can one get around these issues?</description>
		<content:encoded><![CDATA[<p>great ways to do it, but their are a few caveats. </p>
<p>1) The javascript way will not be spidered by search engines (bad seo)</p>
<p>2) The CSS way cannot be used if you have any header tags in the div.</p>
<p>How can one get around these issues?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Silver Firefly</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-4516</link>
		<dc:creator>Silver Firefly</dc:creator>
		<pubDate>Wed, 15 Apr 2009 22:08:44 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-4516</guid>
		<description>I would just use CSS for this. I never use Javascript unless it degrades fully.</description>
		<content:encoded><![CDATA[<p>I would just use CSS for this. I never use Javascript unless it degrades fully.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Francis</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-1166</link>
		<dc:creator>Craig Francis</dc:creator>
		<pubDate>Sun, 09 Mar 2008 18:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-1166</guid>
		<description>@Jeremie TisseauI&#039;m using FireFox 2.0.0.12 on a mac... not too sure how I managed it, but I think I was switching tabs at the time, and I think I might have increased the font size... but cannot replicate now unfortunately.Although, another feature... in my last post, I split that second paragraph into multiple paragraphs (line breaks before and after the link).</description>
		<content:encoded><![CDATA[<p>@Jeremie TisseauI&#8217;m using FireFox 2.0.0.12 on a mac&#8230; not too sure how I managed it, but I think I was switching tabs at the time, and I think I might have increased the font size&#8230; but cannot replicate now unfortunately.Although, another feature&#8230; in my last post, I split that second paragraph into multiple paragraphs (line breaks before and after the link).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan Migliorisi</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-1165</link>
		<dc:creator>Bryan Migliorisi</dc:creator>
		<pubDate>Thu, 06 Mar 2008 16:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-1165</guid>
		<description>When I need something similar, I find the best thing to do is to add a link with a specific class to a div (or whatever element you want to be clickable).&#160; In this case lets say we named the class divLink.&#160; Use JS to find each child link element with a class of divLink and apply its hRef attribute as the location.href in an onClick even of the parent element (ex. div).If they have JS on, it will work as you intend it to. If they do not have JS on, they see a normal link and that is fine for most people, search engines, and screen readers.&#160; If they have CSS off it will not affect this technique.&#160;</description>
		<content:encoded><![CDATA[<p>When I need something similar, I find the best thing to do is to add a link with a specific class to a div (or whatever element you want to be clickable).&nbsp; In this case lets say we named the class divLink.&nbsp; Use JS to find each child link element with a class of divLink and apply its hRef attribute as the location.href in an onClick even of the parent element (ex. div).If they have JS on, it will work as you intend it to. If they do not have JS on, they see a normal link and that is fine for most people, search engines, and screen readers.&nbsp; If they have CSS off it will not affect this technique.&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Kolano</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-1164</link>
		<dc:creator>Ken Kolano</dc:creator>
		<pubDate>Thu, 06 Mar 2008 15:13:07 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-1164</guid>
		<description>The CSS method has some other significant advantages over the JS method, mainly related to the CSS method using a real link:-It will work just like every other link (i.e. have right click options to bookmark it, open in new window, etc).-Outside scripts (Greasemonkey, etc.) will recognize it as a link.-CSS applies across the site in a standard manner, but maintaining the described JS method needs custom edits across a site. The JS method probably should pull it&#039;s URL from a DOM lookup to an embedded link tag, but that still seems more fiddley than the CSS method.</description>
		<content:encoded><![CDATA[<p>The CSS method has some other significant advantages over the JS method, mainly related to the CSS method using a real link:-It will work just like every other link (i.e. have right click options to bookmark it, open in new window, etc).-Outside scripts (Greasemonkey, etc.) will recognize it as a link.-CSS applies across the site in a standard manner, but maintaining the described JS method needs custom edits across a site. The JS method probably should pull it&#8217;s URL from a DOM lookup to an embedded link tag, but that still seems more fiddley than the CSS method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremie Tisseau</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-1163</link>
		<dc:creator>Jeremie Tisseau</dc:creator>
		<pubDate>Thu, 06 Mar 2008 12:19:54 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-1163</guid>
		<description>&lt;p&gt;This is just a test as a guest. I don&#039;t see any problem. What browser do you use, Craig?&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>This is just a test as a guest. I don&#8217;t see any problem. What browser do you use, Craig?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremie Tisseau</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-1162</link>
		<dc:creator>Jeremie Tisseau</dc:creator>
		<pubDate>Thu, 06 Mar 2008 12:15:06 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-1162</guid>
		<description>&lt;span style=&quot;font-style: italic;&quot;&gt;@Craig:&lt;/span&gt; Weird, I have tried the text editing area as admin and as a guest. I have never had any problem. &lt;br&gt;</description>
		<content:encoded><![CDATA[<p><span style="font-style: italic;">@Craig:</span> Weird, I have tried the text editing area as admin and as a guest. I have never had any problem. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Francis</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-1161</link>
		<dc:creator>Craig Francis</dc:creator>
		<pubDate>Thu, 06 Mar 2008 09:08:30 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-1161</guid>
		<description>&lt;p&gt;Just to point out, as this method works solely though JavaScript, it&lt;br /&gt;
will not work with browsers (User Agents) that do not support&lt;br /&gt;
JavaScript... for example search engine spiders.&lt;/p&gt;
&lt;p&gt;A better solution is to add one (and only one) link in a &lt;div&gt; as normal, then get&lt;br /&gt;
some JavaScript to find the link, look for the parent element (i.e. the&lt;br /&gt;
div) make that &quot;click able&quot;, and then off-screen the link, so users who cannot use a mouse (screen readers, keyboard navigation) can still use the link.Have a look at:&lt;a href=&quot;http://www.craigfrancis.co.uk/features/code/jsLinkedHolder/&quot; rel=&quot;nofollow&quot;&gt;http://www.craigfrancis.co.uk/features/code/jsLinkedHolder/&lt;/a&gt; Also, can you remove this text editing box, and just use a simple &lt;textarea&gt;... when writing this comment it changed to a read-only mode, where I had to copy the text and reload the page.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Just to point out, as this method works solely though JavaScript, it<br />
will not work with browsers (User Agents) that do not support<br />
JavaScript&#8230; for example search engine spiders.</p>
<p>A better solution is to add one (and only one) link in a &lt;div&gt; as normal, then get<br />
some JavaScript to find the link, look for the parent element (i.e. the<br />
div) make that &#8220;click able&#8221;, and then off-screen the link, so users who cannot use a mouse (screen readers, keyboard navigation) can still use the link.Have a look at:<a href="http://www.craigfrancis.co.uk/features/code/jsLinkedHolder/" rel="nofollow">http://www.craigfrancis.co.uk/features/code/jsLinkedHolder/</a> Also, can you remove this text editing box, and just use a simple &lt;textarea&gt;&#8230; when writing this comment it changed to a read-only mode, where I had to copy the text and reload the page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ext237</title>
		<link>http://web-kreation.com/all/making-div-a-link-javascript-vs-css/#comment-1160</link>
		<dc:creator>ext237</dc:creator>
		<pubDate>Wed, 05 Mar 2008 22:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://web-kreation.com/blog/?p=41#comment-1160</guid>
		<description>Seeing developers use a div as a hyperlink drives me nuts.&#160; Unwillingness to adhere to standards renders my screen reader useless.Then again, when their clients fail usability/accessibility testing or can&#039;t get 508 compliance ... they keep us developers who maintain standards&#160; compliance employed.&#160; Guess its a sliver-lining kinda thing, right?</description>
		<content:encoded><![CDATA[<p>Seeing developers use a div as a hyperlink drives me nuts.&nbsp; Unwillingness to adhere to standards renders my screen reader useless.Then again, when their clients fail usability/accessibility testing or can&#8217;t get 508 compliance &#8230; they keep us developers who maintain standards&nbsp; compliance employed.&nbsp; Guess its a sliver-lining kinda thing, right?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

