<?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: Speed Up Border-bottom Under Links</title>
	<atom:link href="http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/</link>
	<description>Hypertext rulez™</description>
	<lastBuildDate>Wed, 23 Mar 2011 22:34:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: shokre</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-556</link>
		<dc:creator>shokre</dc:creator>
		<pubDate>Thu, 12 May 2005 15:25:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-556</guid>
		<description>to andr3:
It really depends on the element. If you have a link tag somwhere in paragraph, and if you change link&#039;s border size on hover, relayouting does not happen. Try for yourself, but change for instance from 1px border to 10px, and you&#039;ll see that border flows under text.
But for instance if you have relative positioned div element and change it&#039;s border size on hover, re-layouting does happen.</description>
		<content:encoded><![CDATA[<p>to andr3:<br />
It really depends on the element. If you have a link tag somwhere in paragraph, and if you change link&#8217;s border size on hover, relayouting does not happen. Try for yourself, but change for instance from 1px border to 10px, and you&#8217;ll see that border flows under text.<br />
But for instance if you have relative positioned div element and change it&#8217;s border size on hover, re-layouting does happen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andr3</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-555</link>
		<dc:creator>andr3</dc:creator>
		<pubDate>Thu, 12 May 2005 14:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-555</guid>
		<description>nice shokre.. but i was left wondering. what if i have a 1px border, and on &lt;code&gt;:hover&lt;/code&gt; i change it to a 2px border? re-layouting will take place anyway, right?</description>
		<content:encoded><![CDATA[<p>nice shokre.. but i was left wondering. what if i have a 1px border, and on <code>:hover</code> i change it to a 2px border? re-layouting will take place anyway, right?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-545</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Wed, 11 May 2005 11:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-545</guid>
		<description>shokre, thanks for clearing things out. Nicely explained!</description>
		<content:encoded><![CDATA[<p>shokre, thanks for clearing things out. Nicely explained!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shokre</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-544</link>
		<dc:creator>shokre</dc:creator>
		<pubDate>Wed, 11 May 2005 09:23:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-544</guid>
		<description>&lt;blockquote&gt;&#8220;... browser only has to change border-color, not draw the whole new border.&#8221;&lt;/blockquote&gt;

Not exactly... 
Browser&#039;s rendering engine will allways draw border if specified. Even when it&#039;s color is set to the color of the background, but not when it&#039;s set to transparent.

The slowdown when using:&lt;code&gt;
a { text-decoration: none; }
a:hover { text-decoration: none; border-bottom: 1px solid #0CF; }&lt;/code&gt;
comes from the fact that browser needs to re-layout all elements that are in the relationship with, or come after the link tag, because css has changed. Not in a strict sense, of course. But from the browser&#039;s point of view, when you hovered over the link, you changed it&#039;s css from
&quot;{ text-decoration: none; }&quot; to &quot;{ text-decoration: none; border-bottom: 1px solid #0CF; }&quot; and added extra information for rendering (in a form of browser&#039;s rendering engine internal structures).

Re-layouting involves recalculating positions, invalidating, and redrawing the affected region, all regions affected by the affected region, and all regions in relation to the afected region. 
Even if you don&#039;t see changes when hovering over the link (i.e. if the link is part of the paragraph, and line spacing is big enough), the changes exist.

Reason why using your method, or using &quot;{ text-decoration: underline }&quot; is fast enough is because changing existing properities does not involve adding extra information to the rendering tree, so therefore does not involve re-layouting. 

Anyway, interesting article...</description>
		<content:encoded><![CDATA[<blockquote><p>&#8220;&#8230; browser only has to change border-color, not draw the whole new border.&#8221;</p></blockquote>
<p>Not exactly&#8230;<br />
Browser&#8217;s rendering engine will allways draw border if specified. Even when it&#8217;s color is set to the color of the background, but not when it&#8217;s set to transparent.</p>
<p>The slowdown when using:<code><br />
a { text-decoration: none; }<br />
a:hover { text-decoration: none; border-bottom: 1px solid #0CF; }</code><br />
comes from the fact that browser needs to re-layout all elements that are in the relationship with, or come after the link tag, because css has changed. Not in a strict sense, of course. But from the browser&#8217;s point of view, when you hovered over the link, you changed it&#8217;s css from<br />
&#8220;{ text-decoration: none; }&#8221; to &#8220;{ text-decoration: none; border-bottom: 1px solid #0CF; }&#8221; and added extra information for rendering (in a form of browser&#8217;s rendering engine internal structures).</p>
<p>Re-layouting involves recalculating positions, invalidating, and redrawing the affected region, all regions affected by the affected region, and all regions in relation to the afected region.<br />
Even if you don&#8217;t see changes when hovering over the link (i.e. if the link is part of the paragraph, and line spacing is big enough), the changes exist.</p>
<p>Reason why using your method, or using &#8220;{ text-decoration: underline }&#8221; is fast enough is because changing existing properities does not involve adding extra information to the rendering tree, so therefore does not involve re-layouting. </p>
<p>Anyway, interesting article&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-540</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Mon, 09 May 2005 06:55:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-540</guid>
		<description>Matt, good point! However, one must consider that IE 5.01 will not apply &lt;code&gt;padding&lt;/code&gt; and &lt;code&gt;border&lt;/code&gt; properties to inline HTML elements (such is &lt;code&gt;&lt;a&gt;&lt;/code&gt;), no matter what we do.</description>
		<content:encoded><![CDATA[<p>Matt, good point! However, one must consider that IE 5.01 will not apply <code>padding</code> and <code>border</code> properties to inline HTML elements (such is <code>&#60;a&#62;</code>), no matter what we do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Hampel</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-539</link>
		<dc:creator>Matt Hampel</dc:creator>
		<pubDate>Mon, 09 May 2005 03:26:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-539</guid>
		<description>Using the border-bottom of the parent element also has another benefit: it simplifies height and width properties, especially on older browsers. You no longer have to worry about a box redrawing on :hover because another pixel got added.</description>
		<content:encoded><![CDATA[<p>Using the border-bottom of the parent element also has another benefit: it simplifies height and width properties, especially on older browsers. You no longer have to worry about a box redrawing on :hover because another pixel got added.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: andr3</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-538</link>
		<dc:creator>andr3</dc:creator>
		<pubDate>Sun, 08 May 2005 23:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-538</guid>
		<description>actually, i&#039;ve seen another weird behaviour related to this.. 

i had several links with &lt;code&gt;border-bottom: 1px solid #666&lt;/code&gt; and the &lt;code&gt;:hover&lt;/code&gt; was &lt;code&gt;border-bottom: 0px;&lt;/code&gt;

in a certain linux distro (gentoo) running a particular firefox version (1.0, i think), the whole website&#039;s navbar flickered and the menu was corrupted. i can&#039;t explain it very well, but it was very weird.

i adopted the same solution as you did.. use 1px border, with the parent&#039;s bgcolor. and it worked.</description>
		<content:encoded><![CDATA[<p>actually, i&#8217;ve seen another weird behaviour related to this.. </p>
<p>i had several links with <code>border-bottom: 1px solid #666</code> and the <code>:hover</code> was <code>border-bottom: 0px;</code></p>
<p>in a certain linux distro (gentoo) running a particular firefox version (1.0, i think), the whole website&#8217;s navbar flickered and the menu was corrupted. i can&#8217;t explain it very well, but it was very weird.</p>
<p>i adopted the same solution as you did.. use 1px border, with the parent&#8217;s bgcolor. and it worked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marko</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-528</link>
		<dc:creator>marko</dc:creator>
		<pubDate>Sun, 08 May 2005 18:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-528</guid>
		<description>Yes, in case of background pattern, you can try with the &lt;code&gt;border-bottom: 1px solid transparent;&lt;/code&gt;, although I&#8217;m not absolutely positive wether that renders properly in major browsers.

&lt;em&gt;Edit: I&#8217;ve just checked it &#8212; IE can&#8217;t apply &lt;code&gt;border-color: transparent;&lt;/code&gt;, even though it&#8217;s in the &lt;a href=&quot;http://www.w3.org/TR/REC-CSS2/box.html#border-properties&quot;&gt;CSS2 specs&lt;/a&gt;. Instead of, the &lt;code&gt;color&lt;/code&gt; property value is applied, i.e. &lt;code&gt;color: red; border: 1px solid transparent;&lt;/code&gt; is rendered as &lt;code&gt;color: red; border: 1px solid red;&lt;/code&gt;.&lt;/em&gt;</description>
		<content:encoded><![CDATA[<p>Yes, in case of background pattern, you can try with the <code>border-bottom: 1px solid transparent;</code>, although I&#8217;m not absolutely positive wether that renders properly in major browsers.</p>
<p><em>Edit: I&#8217;ve just checked it &#8212; IE can&#8217;t apply <code>border-color: transparent;</code>, even though it&#8217;s in the <a href="http://www.w3.org/TR/REC-CSS2/box.html#border-properties">CSS2 specs</a>. Instead of, the <code>color</code> property value is applied, i.e. <code>color: red; border: 1px solid transparent;</code> is rendered as <code>color: red; border: 1px solid red;</code>.</em></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philipe</title>
		<link>http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-527</link>
		<dc:creator>Philipe</dc:creator>
		<pubDate>Sun, 08 May 2005 16:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.maratz.com/blog/archives/2005/05/08/speed-up-border-bottom-under-links/#comment-527</guid>
		<description>What if the background is a pattern? Then it wouldn&#039;t look nice. Would something like &lt;code&gt;border: 1px none #0CF;&lt;/code&gt; be better too?</description>
		<content:encoded><![CDATA[<p>What if the background is a pattern? Then it wouldn&#8217;t look nice. Would something like <code>border: 1px none #0CF;</code> be better too?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

