<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jonathan Weiß &#187; CSS</title>
	<atom:link href="http://mysterycity.de/blog/category/css/feed" rel="self" type="application/rss+xml" />
	<link>http://mysterycity.de/blog</link>
	<description>Online Marketing</description>
	<lastBuildDate>Tue, 01 Nov 2011 09:28:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>&#8220;I can see what you see not&#8221; &#8211; Inheritance and rendering of CSS properties</title>
		<link>http://mysterycity.de/blog/i-can-see-what-you-see-not-inheritance-and-rendering-of-css-properties</link>
		<comments>http://mysterycity.de/blog/i-can-see-what-you-see-not-inheritance-and-rendering-of-css-properties#comments</comments>
		<pubDate>Thu, 20 Mar 2008 21:10:12 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://mysterycity.de/blog/i-can-see-what-you-see-not-inheritance-and-rendering-of-css-properties</guid>
		<description><![CDATA[The appearance of HTML elements is set by it's style properties. They define dimensions, colors, margins, borders and much more. All styles which are defined in the style attribute inside an element are available to JavaScript in the style attribute of it's corresponding HTML element object. The value of each property is mapped from HTML [...]]]></description>
			<content:encoded><![CDATA[<p>The appearance of HTML elements is set by it's style properties. They define dimensions, colors, margins, borders and much more.<br />
All styles which are defined in the <code>style</code> attribute inside an element are available to JavaScript in the <code>style</code> attribute of it's corresponding HTML element object. The value of each property is mapped from HTML without being translated. This means, that a color value of <em>red</em> becomes a string containing <em>red</em> and not the computed value <em>rgb(255,&nbsp;0,&nbsp;0)</em>.<br />
All styles, including styles from a class definition or inherited styles from a parent element, <a href="http://mysterycity.de/blog/how-to-get-the-actual-style-value-of-an-element">can be retrieved</a> using the standard way <code>window.getComputedStyle(&lt;element&gt;,&nbsp;null)</code> or the Microsoft way <code>&lt;element&gt;.currentStyle[style&nbsp;property]</code>. This values are also translated to the computed value.</p>
<p>Why am I talking about HTML elements appearance? Well, imagine you want to clone an HTML element not only with its content and child nodes, but also with its appearance. To match the original element, every single style property, which applies on it, has to be copied to the clone.<br />
Now that we know so much about computed styles, it should be no problem to get it done, right? Well, this task is not as easy as it first seems.</p>
<h3>Stumbling block no 1: background-color</h3>
<p>When an element has no background color, its computed value of <code>background-color</code> is <em>transparent</em>. So far so well, this makes sense, as this information is used by the browsers rendering engine.<br />
To get the <em>visible</em> color for this property, you have to walk through the element's parent elements and fetch the first background color value that contains an usable color value.</p>
<h3>Stumbling block no 2: text-decoration</h3>
<p>A real head-scratcher for me was the <code>text-decoration</code> property. The value of this property is not inherited, but it's child elements are rendered, as if it were so!</p>
<p>&raquo;<i>This property is not inherited, but descendant boxes of a block box should be formatted with the same decoration (e.g., they should all be underlined).</i>&laquo;<br />
<a href="http://www.w3.org/TR/REC-CSS2/text.html#lining-striking-props">CSS2 Specification</a></p>
<p>So all child elements inside an element with a <code>text-decoration</code> style property it will return <em>none</em> for <code>text-decoration</code> &mdash; even if you can see their text-decoration. As the property is not being inherited it also is not overwritten and an elements can be rendered with several different <code>text-decoration</code> values.</p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-decoration:underline;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Oh
  <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-decoration:overline;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>noes!
    <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-decoration:blink;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>Teh
      <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-decoration:line-through;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      blink
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
      tag
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
    is
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
  back!
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
&nbsp;</pre>
<p><span style="text-decoration:underline;">Oh <span style="text-decoration:overline;">noes! <span style="text-decoration:blink;">Teh <span style="text-decoration:line-through;">blink </span>tag </span>is </span>back!</span></p>
<p>Note that not all browser support the <em>blink</em> value. Luckily... ;-)</p>
<p>I wonder why the specification is that way. Is there some reason for that? I am not aware of any other property that behaves like this.</p>
<p>To retrieve the rendered value, you have to walk through the element's parent elements, as you have to do for the <code>background-color</code>. When the parents have more than one different <code>text-decoration</code> value, it is not possible to clone the element's appearance without adding some extra elements around it.</p>
<h3>Stumbling block no 3: text-decoration color</h3>
<p>And as if that were not enough trouble with the <code>text-decoration</code>, here is one more thing:</p>
<p>&raquo;<i>The color(s) required for the text decoration should be derived from the 'color' property value. [..] The color of decorations should remain the same even if descendant elements have different 'color' values.</i>&laquo;<br />
<a href="http://www.w3.org/TR/REC-CSS2/text.html#lining-striking-props">CSS2 Specification</a></p>
<pre class="html4strict">&nbsp;
<span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-decoration:underline;color:red;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>lorem
  <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-decoration:overline;color:green;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>ipsum
    <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;text-decoration:line-through;color:blue;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      dolor
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
    sit
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
  <span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;color:purple;&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    amet
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span>
&nbsp;</pre>
<p><span style="text-decoration:underline;color:red;">lorem <span style="text-decoration:overline;color:green;">ipsum <span style="text-decoration:line-through;color:blue;">dolor </span>sit </span><span style="color:purple;">amet</span></span></p>
<p>The completely match the element's style, you have to add one parent element for each different text-decoration property that also contains a <code>color</code> style property whose color will be applied on the text-decoration line.</p>
<h3>The quote</h3>
<p>If you are wondering about the quote in title: this is the first line from the <em>Book of the Blind</em> which appears in Blizzard's great game <a href="http://www.blizzard.com/us/diablo/">Diablo</a>. I played it for ages when I was younger. :-)<br />
When I realized that I could see a property, that is not visible to JavaScript (at first glance), this poem was brought back to my mind. Here it is, at full length:</p>
<blockquote><p>I can see what you see not<br />
Vision milky &ndash; then eyes rot.</p>
<p>When you turn they will be gone<br />
Whispering their hidden song,</p>
<p>Then you see what can not be &ndash;<br />
Shadows move where light should be.</p>
<p>Out of Darkness &ndash; out of mind,<br />
Cast down into the Halls of the Blind!</p></blockquote>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://mysterycity.de/blog/i-can-see-what-you-see-not-inheritance-and-rendering-of-css-properties/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A christmas present from Microsoft</title>
		<link>http://mysterycity.de/blog/a-christmas-present-from-microsoft</link>
		<comments>http://mysterycity.de/blog/a-christmas-present-from-microsoft#comments</comments>
		<pubDate>Thu, 20 Dec 2007 17:02:02 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://mysterycity.de/blog/a-christmas-present-from-microsoft</guid>
		<description><![CDATA[After the last "update" of IE 7 and the questionable communication policy in the IEBlog I am very happy to see that things can change. :-) Thanks, Mr. Gates for bringing light into the darkness. Anyway, how can IE 8 render the test correctly? At this moment the test is broken... Ok, I have just [...]]]></description>
			<content:encoded><![CDATA[<p><a href='http://mysterycity.de/blog/wp-content/uploads/2007/12/ie8_acidtest2.png' title='The Acid2 test rendered in IE8' rel="lightbox[59]"><img src='http://mysterycity.de/blog/wp-content/uploads/2007/12/ie8_acidtest2.thumbnail.png' alt='The Acid2 test rendered in IE8' /></a></p>
<p>After the last <a href="http://mysterycity.de/blog/update-of-internet-explorer">"update" of IE 7</a> and the <a href="http://www.arcanology.com/2007/12/05/big-internet-explorer-news/">questionable communication policy</a> in the IEBlog I am very happy to see that <a href="http://blogs.msdn.com/ie/archive/2007/12/19/internet-explorer-8-and-acid2-a-milestone.aspx">things can change</a>. :-)<br />
Thanks, Mr. Gates for <a href="http://developers.slashdot.org/article.pl?sid=07/12/07/1859205">bringing light into the darkness</a>.</p>
<p><del datetime="2007-12-20T21:53:51+00:00">Anyway, <strong>how</strong> can IE 8 render the test correctly? At this moment the <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=289480#c176">test is broken</a>...<br />
</del> Ok, I have just seen <a href="http://channel9.msdn.com/Showpost.aspx?postid=367207">their video</a> and I guess they were working with the correct Acid2 test.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://mysterycity.de/blog/a-christmas-present-from-microsoft/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClearType influences CSS filters in Internet Explorer 6</title>
		<link>http://mysterycity.de/blog/cleartype-influences-css-filters-in-internet-explorer-6</link>
		<comments>http://mysterycity.de/blog/cleartype-influences-css-filters-in-internet-explorer-6#comments</comments>
		<pubDate>Wed, 19 Dec 2007 20:21:12 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://mysterycity.de/blog/cleartype-influences-css-filters-in-internet-explorer-6</guid>
		<description><![CDATA[A few weeks ago I had one of the seldom moments in which I had to use Internet Explorer 6. I examined some memory usage oddities in connection with the AlphaImageLoader object when I noticed a strange rendering behavior regarding the proprietary CSS attribute filter. I just added a simple filter like &#60;span style=&#34;filter:Alpha(opacity=100, style=0)&#34;&#62;&#60;/span&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I had one of the seldom moments in which I had to use Internet Explorer 6. I  examined some memory usage oddities in connection with the <code>AlphaImageLoader</code> object when I noticed a strange rendering behavior regarding the proprietary CSS attribute <code>filter</code>.  I just added a simple filter like</p>
<pre class="html4strict"><span style="color: #009900;"><a href="http://december.com/html/4/element/span.html"><span style="color: #000000; font-weight: bold;">&lt;span</span></a> <span style="color: #000066;">style</span>=<span style="color: #ff0000;">&quot;filter:Alpha(opacity=100, style=0)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/span&gt;</span></span></pre>
<p>and my text just looked blurry.</p>
<div style="float:left;margin-right:20px;"><a href='http://mysterycity.de/blog/wp-content/uploads/2007/12/css_filter_with_cleartyp.gif' title='CSS filter with ClearType' rel="lightbox[54]"><img src='http://mysterycity.de/blog/wp-content/uploads/2007/12/css_filter_with_cleartyp.thumbnail.gif' alt='CSS filter with ClearType' /></a><br><a href='http://mysterycity.de/blog/wp-content/uploads/2007/12/css_filter_with_cleartyp.gif' title='CSS filter with ClearType'>Text with ClearType enabled</a></div>
<div style="float:left;"><a href='http://mysterycity.de/blog/wp-content/uploads/2007/12/css_filter_without_cleartyp.gif' title='CSS filter without ClearType' rel="lightbox[54]"><img src='http://mysterycity.de/blog/wp-content/uploads/2007/12/css_filter_without_cleartyp.thumbnail.gif' alt='CSS filter without ClearType' /></a><br><a href='http://mysterycity.de/blog/wp-content/uploads/2007/12/css_filter_without_cleartyp.gif' title='CSS filter without ClearType'>Text without ClearType</a></div>
<p><br style="clear:both;" /></p>
<p>The text appears blurry only if <a href="http://en.wikipedia.org/wiki/ClearType">ClearType</a> is enabled.</p>
<p>Did your noticed this behavior by yourself? If you have any experiences with the attribute <code>filter</code> in connection with ClearType, please let me know!</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://mysterycity.de/blog/cleartype-influences-css-filters-in-internet-explorer-6/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hidden browser gems &#8211; Part I: text-overflow</title>
		<link>http://mysterycity.de/blog/hidden-browser-gems-part-i-text-overflow</link>
		<comments>http://mysterycity.de/blog/hidden-browser-gems-part-i-text-overflow#comments</comments>
		<pubDate>Sun, 29 Jul 2007 19:23:34 +0000</pubDate>
		<dc:creator>Jonathan</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Hidden Browser Gems]]></category>
		<category><![CDATA[Hidden Gems]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Webkit]]></category>

		<guid isPermaLink="false">http://mysterycity.de/blog/hidden-browser-gems-part-i-text-overflow</guid>
		<description><![CDATA[I just started another series for my blog. :-) Today's browsers are quite huge applications charged with so many features and potentials, that you can hardly know all of them. From time to time I will write about less known, but useful and valuably features: the hidden gems. While playing with the soft hyphen feature [...]]]></description>
			<content:encoded><![CDATA[<p>I just started another series for my blog. :-)<br />
Today's browsers are quite huge applications charged with so many features and potentials, that you can hardly know all of them. From time to time I will write about less known, but useful and valuably features: the <strong>hidden gems</strong>.</p>
<p>While playing with the soft hyphen feature of the <a href="http://www.mysterycity.de/blog/cool-features-in-upcoming-firefox-30">latest version of Firefox</a> I remembered that I had seen a nice way to cut off text if it is too long for its containing element. A few years ago I accidentally found an entry in a wiki about a special CSS property which can be used to improve the look of texts inside an element with an <code>overflow:hidden</code> style property.</p>
<p><a href='http://mysterycity.de/blog/wp-content/uploads/2007/07/text_overflow_ellipsis.gif' title='An example of text-overflow' rel="lightbox[28]"><img src='http://mysterycity.de/blog/wp-content/uploads/2007/07/text_overflow_ellipsis.thumbnail.gif' alt='An example of text-overflow' /></a><br />
<a href='http://mysterycity.de/blog/wp-content/uploads/2007/07/text_overflow_ellipsis.gif' title='An example of text-overflow'>An example of text-overflow</a></p>
<p>In Internet Explorer 6.0 (and above) and in Safari 1.3 (and above) you can use <code>text-overflow:ellipsis</code> together with <code>overflow:hidden</code> to get this three dots if text is to long.</p>
<p><a href='http://mysterycity.de/blog/wp-content/uploads/2007/07/ellipsis_buggy_with_overflow_auto.gif' title='text-overflow seems to be buggy with overflow:auto' rel="lightbox[28]"><img src='http://mysterycity.de/blog/wp-content/uploads/2007/07/ellipsis_buggy_with_overflow_auto.thumbnail.gif' alt='text-overflow seems to be buggy with overflow:auto' /></a><br />
Be careful with <code>overflow:auto</code>! It seems <a href='http://mysterycity.de/blog/wp-content/uploads/2007/07/ellipsis_buggy_with_overflow_auto.gif' title='text-overflow seems to be buggy with overflow:auto'>a bit buggy in Safari</a>, while it works nearly perfect in Internet Explorer.</p>
<p><b>Update:</b><br />
The Opera browser (since version 9.0) supports this property, too. You have to use the proprietary attribute <code>-o-text-overflow</code> and your text will be displayed the same way as in Safari.<br />
I guess once CSS3 goes final, all vendors will use the W3C standard property.</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://mysterycity.de/blog/hidden-browser-gems-part-i-text-overflow/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

