<?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>samuli.hakoniemi.net &#187; opera</title>
	<atom:link href="http://samuli.hakoniemi.net/tag/opera/feed/" rel="self" type="application/rss+xml" />
	<link>http://samuli.hakoniemi.net</link>
	<description></description>
	<lastBuildDate>Thu, 20 Oct 2011 10:03:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<atom:link rel='hub' href='http://samuli.hakoniemi.net/?pushpress=hub'/>
		<item>
		<title>How to Target CSS Only for Opera</title>
		<link>http://samuli.hakoniemi.net/how-to-target-css-only-for-opera/</link>
		<comments>http://samuli.hakoniemi.net/how-to-target-css-only-for-opera/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 14:17:14 +0000</pubDate>
		<dc:creator>Samuli Hakoniemi</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://samuli.hakoniemi.net/?p=613</guid>
		<description><![CDATA[<a href="how-to-target-css-only-for-opera/"><img src="/wp-content/images/opera/operaForBlog.png" alt="" /></a>
Sometimes there is need to write browser-specific CSS declarations. Although every developer should put their best effort on creating structure and layout that doesn't require any proprietary hacks, one may encounter situations where it's impossible to proceed by the book.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fhow-to-target-css-only-for-opera%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fhow-to-target-css-only-for-opera%2F&amp;source=zvona&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="/wp-content/images/opera/operaForBlog.png" alt="Opera" /></p>
<div class="ingress">Sometimes there is need to write browser-specific CSS declarations. Although every developer should put their best effort on creating structure and layout that doesn&#8217;t require any proprietary hacks, one may encounter situations where it&#8217;s impossible to proceed by the book.</div>
<p>My case was about font-size and letter-spacing on Opera (11.10). Opera was displaying selected font way too big to fit in allowed space and I needed a hack to fix this issue.</p>
<h2>Opera 9 and below</h2>
<p>This is pretty straight forward and well known hack:</p>
<pre name="code" class="css:nocontrols">html:first-child p
{
    font-size:12px;
}</pre>
<p>The real issue, in my case, was how to target newer and modern Opera versions 10 and 11.</p>
<h2>Opera 10 and above</h2>
<p>The answer is in media queries. Earlier this was obvious hack while no other browsers supported media-queries properly. However, nowadays more and more browsers support it and therefore we need to tweak the conditions a little:</p>
<pre name="code" class="css:nocontrols">@media not all and (-webkit-min-device-pixel-ratio:0) {
    p {
        font-size:12px;
    }
}</pre>
<p>I&#8217;ve validated this with Opera 10.5 and Opera 11. I also checked on Chrome 11, Chrome 12, Firefox 3.6, Firefox 4.0, Safari 5 and IE 8 that it doesn&#8217;t affect on them.</p>
<p><b>Edit:</b> I haven&#8217;t tested this on Opera 9 or earlier, but according to other resources, this hack should work on those browsers too.</p>
<h2>Conclusion</h2>
<p>It&#8217;s still possible to write browser-specific hacks but it&#8217;s getting more and more complex all the time. In this case we&#8217;re using a hack that is actually targeted to WebKit browsers to get them excluded from the media query hack. However, there is no confidence that this hack would work on Opera 12 or next versions of Safari or Chrome would behave as expected.</p>
<p>And big thanks goes to an article <a rel="external" href="http://grandic.com/html-css/css-hack-or-new-css-file-for-problematic-browsers/" title="CSS Hack or New CSS File for Problematic Browsers?">CSS Hack or New CSS File for Problematic Browsers?</a> and <a rel="external" href="http://css-tricks.com/is-there-any-dedicated-css-hacks-for-safari-or-opera/" title="Is There Any Dedicated CSS Hacks For Safari or Opera?">Is There Any Dedicated CSS Hacks For Safari or Opera?</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://samuli.hakoniemi.net/how-to-target-css-only-for-opera/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Onload Issues with Opera</title>
		<link>http://samuli.hakoniemi.net/onload-issues-with-opera/</link>
		<comments>http://samuli.hakoniemi.net/onload-issues-with-opera/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 08:44:43 +0000</pubDate>
		<dc:creator>Samuli Hakoniemi</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[onload]]></category>
		<category><![CDATA[opera]]></category>

		<guid isPermaLink="false">http://samuli.hakoniemi.net/?p=93</guid>
		<description><![CDATA[<a href="onload-issues-with-opera/"><img src="/wp-content/images/opera/operaForBlog.png" alt="" /></a>
In this article, we will solve Opera's onload issue caused by caching, and another problem, which occurs when adding images dynamically with javascript.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fonload-issues-with-opera%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fonload-issues-with-opera%2F&amp;source=zvona&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img src="/wp-content/images/opera/operaForBlog.png" alt="Opera" /><br />
Today, I read about a problem with Opera&#8217;s onload event not firing when navigating with back / forward buttons. The reason for this is that Opera receives documents directly from cache. Another, similar kind issue is related to firing onload event, when adding images dynamically.</p>
<p>In this article, we will solve Opera&#8217;s onload issue caused by caching, and another problem, which occurs when adding images dynamically with javascript.</p>
<p>Currently, this is tested to work with Windows versions of Opera 10.1, 10.2 and 10.5 pre-alpha. Please, give me feedback if you find issues with other versions of Opera.</p>
<h2>How to force refreshing</h2>
<p>This isn&#8217;t complicated at all:</p>
<pre name="code" class="javascript:nocontrols">if (window.opera)
{
	opera.setOverrideHistoryNavigationMode('compatible');
	history.navigationMode = 'compatible';
}</pre>
<h2>How to solve image.onload</h2>
<p>After banging my head against wall, I found an easy solution:</p>
<pre name="code" class="javascript:nocontrols">var test = new Image();
if (test.addEventListener)
{
	test.addEventListener('load',function()
	{
		alert(this.width);
	}, false);
}

test.setAttribute('src','/images/test.gif');</pre>
<p>The key is to define <i>src</i> attribute <u>after</u> you&#8217;ve bound event listeners.</p>
<h2>Demo</h2>
<p>You can view demo at <a href="http://demo.hakoniemi.net/onloadOpera/">Demo section: Onload issues with Opera</a></p>
]]></content:encoded>
			<wfw:commentRss>http://samuli.hakoniemi.net/onload-issues-with-opera/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cross-browser Rotation Transformation with CSS</title>
		<link>http://samuli.hakoniemi.net/cross-browser-rotation-transformation-with-css/</link>
		<comments>http://samuli.hakoniemi.net/cross-browser-rotation-transformation-with-css/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 11:37:50 +0000</pubDate>
		<dc:creator>Samuli Hakoniemi</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[opera]]></category>
		<category><![CDATA[rotation]]></category>
		<category><![CDATA[transformation]]></category>

		<guid isPermaLink="false">http://samuli.hakoniemi.net/?p=41</guid>
		<description><![CDATA[I was about not to publish anything before Christmas - just calming down, taking some extra time to get my blog design finished, plugins installed, and so on..

..but no. I got way too excited when I heard today that <a title="Opera Labs" href="http://labs.opera.com/news/2009/12/22/">Opera 10.5 pre-alpha for Labs</a> was released. In other words, this means that an updated version of Opera's layout engine, Presto, was out to play with - meaning, that CSS3 Transformations and Transitions are available also for Opera.

In this article, we write some lines of CSS and create rotating transform effect with all the common browsers, including Internet Explorer and the latest version of Opera.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fcross-browser-rotation-transformation-with-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fsamuli.hakoniemi.net%2Fcross-browser-rotation-transformation-with-css%2F&amp;source=zvona&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>[tweetmeme]<br />
I was about not to publish anything before Christmas &#8211; just calming down, taking some extra time to get my blog design finished, plugins installed, and so on..</p>
<p>..but no. I got way too excited when I heard today that <a title="Opera Labs" href="http://labs.opera.com/news/2009/12/22/">Opera 10.5 pre-alpha for Labs</a> was released. In other words, this means that an updated version of Opera&#8217;s layout engine, Presto, was out to play with &#8211; meaning, that CSS3 Transformations and Transitions are available also for Opera.</p>
<p>In this article, we write some lines of CSS and create rotating transform effect with all the common browsers, including Internet Explorer and the latest version of Opera.</p>
<h2>Issues with Opera and IE</h2>
<p>Opera offers <a href="http://www.opera.com/docs/specs/presto23/css/transitions/">CSS3 Transitions support in Opera Presto 2.3</a>, at least partially. By the specification, we&#8217;re able to take advantage of <em>-o-transform:rotate(deg);</em>.</p>
<p>IE is a bit trickier (big surprise). Fortunately there&#8217;s a nice filter available, called <a href="http://msdn.microsoft.com/en-us/library/ms533014%28VS.85%29.aspx">Matrix</a>. The values for matrix are quite complicated, hence some assistance with Javascript is needed.</p>
<p>In my case, I&#8217;ve created some functionality and bound it with HTC file to CSS selectors. The functionality is based on values of property <em>-ms-transformation</em>. I&#8217;ve also implemented <em>-ms-transition</em> for transitions, but this will be examined further on later posts.</p>
<h2>Example code</h2>
<p>In this example, I&#8217;ll be using A-elements for hover support in IE6. I&#8217;ve already written a small implementation similar to <a href="http://www.xs4all.nl/~peterned/csshover.html">Whatever:hover</a>, but that &#8220;project&#8221; is still taking baby steps.</p>
<p>So let&#8217;s cut the chase and create some lines of code:</p>
<h3>HTML</h3>
<p><code>&lt;a href="#" id="one" class="rotate"&gt;This is 45deg -rotated element.&lt;/a&gt;<br />
&lt;a href="#" id="two" class="rotate"&gt;This is 10deg -rotated element, which rotates to 45deg when hovered.&lt;/a&gt;</code></p>
<h3>CSS</h3>
<p><code>#one	{<br />
behavior:url(-ms-transform.htc);<br />
-moz-transform:rotate(45deg);<br />
-webkit-transform:rotate(45deg);<br />
-o-transform:rotate(45deg);<br />
-ms-transform:rotate(45deg);<br />
}<br />
#two	{<br />
behavior:url(-ms-transform.htc);<br />
-moz-transform:rotate(10deg);<br />
-webkit-transform:rotate(10deg);<br />
-o-transform:rotate(10deg);<br />
-ms-transform:rotate(10deg);<br />
}<br />
#two:hover	{<br />
-moz-transform:rotate(45deg);<br />
-webkit-transform:rotate(45deg);<br />
-o-transform:rotate(45deg);<br />
-ms-transform:rotate(45deg);<br />
}</code></p>
<h2>Demo</h2>
<p>You can view demo at <a class="linkForDemo" href="http://demo.hakoniemi.net/Cross-browserRotateTransformationwithCSS/">Demo section: Cross-browser Rotation Transformation with CSS</a>.</p>
<h2>Final thoughts</h2>
<p>Although everything &#8220;is not fully there&#8221;, this article shows the possibility for implementing cross-browser CSS3 Transformations purely with CSS.</p>
<p>In addition, this post works as an opening post of my blog. Feel free to give feedback. Merry Christmas!</p>
]]></content:encoded>
			<wfw:commentRss>http://samuli.hakoniemi.net/cross-browser-rotation-transformation-with-css/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

