<?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>Webpoint</title>
	<atom:link href="http://blog.alexandremagno.net/en/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.alexandremagno.net/en/</link>
	<description>Weblosophy with web development</description>
	<lastBuildDate>Sat, 05 May 2012 01:11:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Fancy navigation indicator with css3</title>
		<link>http://blog.alexandremagno.net/en/2012/05/creating-navigation-menus-for-carousels-with-css3/</link>
		<comments>http://blog.alexandremagno.net/en/2012/05/creating-navigation-menus-for-carousels-with-css3/#comments</comments>
		<pubDate>Tue, 01 May 2012 21:43:34 +0000</pubDate>
		<dc:creator>alexanmtz</dc:creator>
				<category><![CDATA[HTML/CSS @en]]></category>
		<category><![CDATA[carousel]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[navigation]]></category>

		<guid isPermaLink="false">http://blog.alexandremagno.net/?p=350</guid>
		<description><![CDATA[In this tutorial I will show how to make a beatiful indicator using CSS3. This kind of navigation is recommended to slide throught carousels like these: First of all, it&#8217;s important to remember that this solution will not work in versions earlier than Internet Explorer 9, but will degrade gracefully, without losing any of their [...]]]></description>
			<content:encoded><![CDATA[<p>In this tutorial I will show how to make a beatiful indicator using CSS3. This kind of navigation is recommended to slide throught carousels like these:</p>

<a href='http://blog.alexandremagno.net/en/2012/05/creating-navigation-menus-for-carousels-with-css3/yahoo-carousel-accordion-3/' title='Setting up a beatiful ball navigation with CSS3'><img width="150" height="150" src="http://blog.alexandremagno.net/wp-content/uploads/2012/03/yahoo-carousel-accordion-3-150x150.png" class="attachment-thumbnail" alt="This tutorial show how to make a beatiful navigation indicator with css3" title="Setting up a beatiful ball navigation with CSS3" /></a>
<a href='http://blog.alexandremagno.net/en/2012/05/creating-navigation-menus-for-carousels-with-css3/screen-shot-2012-03-30-at-7-12-42-pm/' title='A CSS navigation indicator'><img width="150" height="83" src="http://blog.alexandremagno.net/wp-content/uploads/2012/05/Screen-shot-2012-03-30-at-7.12.42-PM-150x83.png" class="attachment-thumbnail" alt="A CSS navigation indicator" title="A CSS navigation indicator" /></a>
<a href='http://blog.alexandremagno.net/en/2012/05/creating-navigation-menus-for-carousels-with-css3/screen-shot-2012-05-01-at-6-35-26-pm/' title='Example of a carousel navigation'><img width="150" height="150" src="http://blog.alexandremagno.net/wp-content/uploads/2012/05/Screen-shot-2012-05-01-at-6.35.26-PM-150x150.png" class="attachment-thumbnail" alt="A carousel navigation" title="Example of a carousel navigation" /></a>

<p>First of all, it&#8217;s important to remember that this solution will not work in versions earlier than Internet Explorer 9, but will degrade gracefully, without losing any of their functionality.</p>
<p>First, you will need a simple unordered list:</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple"><table class="html4strict"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
</pre></td><td class="de1"><pre class="de1"><span class="sc2">&lt;<span class="kw2">ul</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;navigation&quot;</span>&gt;</span>
&nbsp; &nbsp; <span class="sc2">&lt;<span class="kw2">li</span>&gt;&lt;<span class="kw2">a</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;default&quot;</span> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span>&gt;&lt;<span class="kw2">span</span>&gt;</span>link 1<span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">span</span>&gt;&lt;<span class="sy0">/</span><span class="kw2">a</span>&gt;&lt;<span class="sy0">/</span><span class="kw2">li</span>&gt;</span>
&nbsp; &nbsp; <span class="sc2">&lt;<span class="kw2">li</span>&gt;&lt;<span class="kw2">a</span> &nbsp;<span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;active&quot;</span> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span>&gt;&lt;<span class="kw2">span</span>&gt;</span>link 2<span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">span</span>&gt;&lt;<span class="sy0">/</span><span class="kw2">a</span>&gt;&lt;<span class="sy0">/</span><span class="kw2">li</span>&gt;</span>
&nbsp; &nbsp; <span class="sc2">&lt;<span class="kw2">li</span>&gt;&lt;<span class="kw2">a</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;default&quot;</span> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span>&gt;&lt;<span class="kw2">span</span>&gt;</span>link 3<span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">span</span>&gt;&lt;<span class="sy0">/</span><span class="kw2">li</span>&gt;</span>
&nbsp; &nbsp; <span class="sc2">&lt;<span class="kw2">li</span>&gt;&lt;<span class="kw2">a</span> <span class="kw3">class</span><span class="sy0">=</span><span class="st0">&quot;default&quot;</span> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;#&quot;</span>&gt;&lt;<span class="kw2">span</span>&gt;</span>link 4<span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">span</span>&gt;&lt;<span class="sy0">/</span><span class="kw2">a</span>&gt;&lt;<span class="sy0">/</span><span class="kw2">li</span>&gt;</span>
<span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">ul</span>&gt;</span></pre></td></tr></tbody></table></div>
<div class="bwp-syntax-source"><pre class="no-parse">&lt;ul class="navigation"&gt;
    &lt;li&gt;&lt;a class="default" href="#"&gt;&lt;span&gt;link 1&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a  class="active" href="#"&gt;&lt;span&gt;link 2&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a class="default" href="#"&gt;&lt;span&gt;link 3&lt;/span&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a class="default" href="#"&gt;&lt;span&gt;link 4&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</pre></div></div>

<p>This unordered list with a simple basic style and any checked item will be a different class called <strong>active </strong>and the others one with <strong>default.</strong></p>
<p><strong></strong> The reason why there&#8217;s a span inside the links is just because we will use this extra markup to hide the text, keeping the semantic correct, but throught css we will hide the text inside span, and will make the link a square that applying a border-radius of 50% it will become a elegant ball, with a more fancier shadow and gradient. It&#8217;s possible to achieve this effect with no images:</p>
<iframe style="width: 100%; height: 200px" src="http://jsfiddle.net/RcMMn/embedded/result,css"></iframe>
<p>This is the CSS Applied:</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar" style="right: 15px;" ><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple"style=" height: 252px;"><table class="css"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="de1"><pre class="de1"><span class="re1">.navigation</span> li a span <span class="br0">&#123;</span>
&nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">none</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="re1">.navigation</span> li a.<span class="kw2">default</span><span class="sy0">,</span> <span class="re1">.navigation</span> li a<span class="re1">.active</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span>
&nbsp; <span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span>
&nbsp; <span class="kw1">margin</span><span class="sy0">:</span> <span class="re3">20px</span> <span class="re3">10px</span><span class="sy0">;</span>
&nbsp; <span class="kw1">width</span><span class="sy0">:</span> <span class="re3">30px</span><span class="sy0">;</span>
&nbsp; <span class="kw1">height</span><span class="sy0">:</span> <span class="re3">30px</span><span class="sy0">;</span>
&nbsp; -webkit-border-radius<span class="sy0">:</span> <span class="re3">50%</span><span class="sy0">;</span>
&nbsp; -moz-border-radius<span class="sy0">:</span> <span class="re3">50%</span><span class="sy0">;</span>
&nbsp; border-radius<span class="sy0">:</span> <span class="re3">50%</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="re1">.navigation</span> li a.<span class="kw2">default</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw1">background-color</span><span class="sy0">:</span> <span class="re0">#CACACA</span><span class="sy0">;</span>
&nbsp; box-shadow<span class="sy0">:</span> <span class="re3">3px</span> <span class="re3">3px</span> <span class="re3">1px</span> <span class="re3">1px</span> <span class="re0">#b9b9b9</span> <span class="kw2">inset</span><span class="sy0">;</span>
&nbsp; -webkit-box-shadow<span class="sy0">:</span> <span class="re3">3px</span> <span class="re3">3px</span> <span class="re3">1px</span> <span class="re3">1px</span> <span class="re0">#b9b9b9</span> <span class="kw2">inset</span><span class="sy0">;</span>
&nbsp; -moz-box-shadow<span class="sy0">:</span> <span class="re3">3px</span> <span class="re3">3px</span> <span class="re3">1px</span> <span class="re3">1px</span> <span class="re0">#b9b9b9</span> <span class="kw2">inset</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="re1">.navigation</span> li a<span class="re1">.active</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#85d945</span><span class="sy0">;</span> <span class="coMULTI">/* Old browsers */</span>
<span class="kw1">background</span><span class="sy0">:</span> -moz-linear-gradient<span class="br0">&#40;</span><span class="kw1">top</span><span class="sy0">,</span> <span class="re0">#85d945</span> <span class="re3">0%</span><span class="sy0">,</span> <span class="re0">#749f54</span> <span class="re3">100%</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="coMULTI">/* FF3.6+ */</span>
<span class="kw1">background</span><span class="sy0">:</span> -webkit-gradient<span class="br0">&#40;</span>linear<span class="sy0">,</span> <span class="kw1">left</span> <span class="kw1">top</span><span class="sy0">,</span> <span class="kw1">left</span> <span class="kw1">bottom</span><span class="sy0">,</span> color-stop<span class="br0">&#40;</span><span class="re3">0%</span><span class="sy0">,</span><span class="re0">#85d945</span><span class="br0">&#41;</span><span class="sy0">,</span> color-stop<span class="br0">&#40;</span><span class="re3">100%</span><span class="sy0">,</span><span class="re0">#749f54</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="coMULTI">/* Chrome,Safari4+ */</span>
<span class="kw1">background</span><span class="sy0">:</span> -webkit-linear-gradient<span class="br0">&#40;</span><span class="kw1">top</span><span class="sy0">,</span> <span class="re0">#85d945</span> <span class="re3">0%</span><span class="sy0">,</span><span class="re0">#749f54</span> <span class="re3">100%</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="coMULTI">/* Chrome10+,Safari5.1+ */</span>
<span class="kw1">background</span><span class="sy0">:</span> -o-linear-gradient<span class="br0">&#40;</span><span class="kw1">top</span><span class="sy0">,</span> <span class="re0">#85d945</span> <span class="re3">0%</span><span class="sy0">,</span><span class="re0">#749f54</span> <span class="re3">100%</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="coMULTI">/* Opera 11.10+ */</span>
<span class="kw1">background</span><span class="sy0">:</span> -ms-linear-gradient<span class="br0">&#40;</span><span class="kw1">top</span><span class="sy0">,</span> <span class="re0">#85d945</span> <span class="re3">0%</span><span class="sy0">,</span><span class="re0">#749f54</span> <span class="re3">100%</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="coMULTI">/* IE10+ */</span>
<span class="kw1">background</span><span class="sy0">:</span> linear-gradient<span class="br0">&#40;</span><span class="kw1">top</span><span class="sy0">,</span> <span class="re0">#85d945</span> <span class="re3">0%</span><span class="sy0">,</span><span class="re0">#749f54</span> <span class="re3">100%</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="coMULTI">/* W3C */</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="re1">.navigation</span> li a.<span class="kw2">default</span><span class="re2">:hover </span><span class="br0">&#123;</span>
&nbsp; <span class="kw1">background-color</span><span class="sy0">:</span> <span class="re0">#B6B6B6</span><span class="sy0">;</span>
&nbsp; box-shadow<span class="sy0">:</span> <span class="re3">3px</span> <span class="re3">3px</span> <span class="re3">1px</span> <span class="re3">1px</span> <span class="re0">#B3B3B3</span> <span class="kw2">inset</span><span class="sy0">;</span>
&nbsp; -webkit-box-shadow<span class="sy0">:</span> <span class="re3">3px</span> <span class="re3">3px</span> <span class="re3">1px</span> <span class="re3">1px</span> <span class="re0">#B9B9B9</span> <span class="kw2">inset</span><span class="sy0">;</span>
&nbsp; -moz-box-shadow<span class="sy0">:</span> <span class="re3">3px</span> <span class="re3">3px</span> <span class="re3">1px</span> <span class="re3">1px</span> <span class="re0">#999</span> <span class="kw2">inset</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre></td></tr></tbody></table></div>
<div class="bwp-syntax-source"><pre class="no-parse">.navigation li a span {
  display: none;
}
.navigation li a.default, .navigation li a.active {
  display: block;
  float: left;
  margin: 20px 10px;
  width: 30px;
  height: 30px;
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
}

.navigation li a.default {
  background-color: #CACACA;
  box-shadow: 3px 3px 1px 1px #b9b9b9 inset;
  -webkit-box-shadow: 3px 3px 1px 1px #b9b9b9 inset;
  -moz-box-shadow: 3px 3px 1px 1px #b9b9b9 inset;
}

.navigation li a.active {
  background: #85d945; /* Old browsers */
background: -moz-linear-gradient(top, #85d945 0%, #749f54 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#85d945), color-stop(100%,#749f54)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #85d945 0%,#749f54 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #85d945 0%,#749f54 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #85d945 0%,#749f54 100%); /* IE10+ */
background: linear-gradient(top, #85d945 0%,#749f54 100%); /* W3C */
}

.navigation li a.default:hover {
  background-color: #B6B6B6;
  box-shadow: 3px 3px 1px 1px #B3B3B3 inset;
  -webkit-box-shadow: 3px 3px 1px 1px #B9B9B9 inset;
  -moz-box-shadow: 3px 3px 1px 1px #999 inset;
}</pre></div></div>

<p>As we know, I&#8217;m using the firefox and webkit syntax for border radius, gradient, box shadow or any CSS3 feature, and, as usual, we still have to declare the W3C syntax waiting for someday they maybe use the default syntax officially.</p>
<p>There&#8217;s a lot of repeating code, make symple effects have to be declare even more than tree times to reflect the same result. This is bad, don&#8217;t you think?</p>
<p>A possible way to deal with this of a &#8220;abstract&#8221; way, is use <a title="LESS, a dynamic stylesheet language" href="http://lesscss.org/" target="_blank">LESS</a> or <a title="Compass Style, a css authoring framework" href="http://compass-style.org/" target="_blank">Compass</a>.</p>
<p>With <a title="Compass Style, a css authoring framework" href="http://compass-style.org/" target="_blank">Compass</a>, for example, is possible to do this:</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar" style="right: 15px;" ><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple"style=" height: 252px;"><table class="css"><tbody><tr class="li1"><td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="de1"><pre class="de1"><span class="re1">.navigation</span> <span class="br0">&#123;</span>
li a span <span class="br0">&#123;</span>
&nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">none</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
li a.<span class="kw2">default</span><span class="sy0">,</span> <span class="re1">.navigation</span> li a<span class="re1">.active</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw1">display</span><span class="sy0">:</span> <span class="kw2">block</span><span class="sy0">;</span>
&nbsp; <span class="kw1">float</span><span class="sy0">:</span> <span class="kw1">left</span><span class="sy0">;</span>
&nbsp; <span class="kw1">margin</span><span class="sy0">:</span> <span class="re3">20px</span> <span class="re3">10px</span><span class="sy0">;</span>
&nbsp; <span class="kw1">width</span><span class="sy0">:</span> <span class="re3">30px</span><span class="sy0">;</span>
&nbsp; <span class="kw1">height</span><span class="sy0">:</span> <span class="re3">30px</span><span class="sy0">;</span>
&nbsp; <span class="co1">@include border-radius(50%);</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="re1">.navigation</span> li a.<span class="kw2">default</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw1">background-color</span><span class="sy0">:</span> <span class="re0">#CACACA</span><span class="sy0">;</span>
&nbsp; <span class="co1">@include box-shadow('3px 3px 1px 1px #b9b9b9 inset');</span>
<span class="br0">&#125;</span>
&nbsp;li a<span class="re1">.active</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw1">background</span><span class="sy0">:</span> <span class="re0">#85d945</span><span class="sy0">;</span> <span class="coMULTI">/* Old browsers */</span>
<span class="co1">@include linear-gradient(top, #85d945 0%, #749f54 100%); /* FF3.6+ */</span>
<span class="br0">&#125;</span>
&nbsp;
&nbsp;li a.<span class="kw2">default</span><span class="re2">:hover </span><span class="br0">&#123;</span>
&nbsp; <span class="kw1">background-color</span><span class="sy0">:</span> <span class="re0">#B6B6B6</span><span class="sy0">;</span>
&nbsp; <span class="co1">@include box-shadow(3px 3px 1px 1px #B3B3B3 inset);</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></td></tr></tbody></table></div>
<div class="bwp-syntax-source"><pre class="no-parse">.navigation {
li a span {
  display: none;
}
li a.default, .navigation li a.active {
  display: block;
  float: left;
  margin: 20px 10px;
  width: 30px;
  height: 30px;
  @include border-radius(50%);
}

.navigation li a.default {
  background-color: #CACACA;
  @include box-shadow('3px 3px 1px 1px #b9b9b9 inset');
}
 li a.active {
  background: #85d945; /* Old browsers */
@include linear-gradient(top, #85d945 0%, #749f54 100%); /* FF3.6+ */
}

 li a.default:hover {
  background-color: #B6B6B6;
  @include box-shadow(3px 3px 1px 1px #B3B3B3 inset);
}
}</pre></div></div>

<p>Much simple and cleaner, but is generate using Ruby with a defined syntax, but this way you can explore variables and mixins, there are ways to store color names for example and the second are functions, that you can make reusable CSS snippets, passing parameters, like functions). Well, compass and LESS are well documented and who knows the basic of programming can well follow the guidelines of the language. There different syntax styles.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexandremagno.net/en/2012/05/creating-navigation-menus-for-carousels-with-css3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centering elements in a fluid layout</title>
		<link>http://blog.alexandremagno.net/en/2012/02/centering-elements-in-a-fluid-layout/</link>
		<comments>http://blog.alexandremagno.net/en/2012/02/centering-elements-in-a-fluid-layout/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 19:58:51 +0000</pubDate>
		<dc:creator>alexanmtz</dc:creator>
				<category><![CDATA[HTML/CSS @en]]></category>
		<category><![CDATA[centering]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[flexible]]></category>
		<category><![CDATA[methods]]></category>
		<category><![CDATA[techniques]]></category>

		<guid isPermaLink="false">http://blog.alexandremagno.net/?p=330</guid>
		<description><![CDATA[I was researching about what happens if you declare two &#8220;conflicting&#8221; positions for absolute or relative elements. So I found this great article about conflicting absolute position. After some tests, I discover a good way to center elements vertically or horizontally without know his dimensions. If you have the following HTML / CSS: It&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>I was researching about what happens if you declare two &#8220;conflicting&#8221; positions for absolute or relative elements. So I found this great <a title="Conflicting absolute positions at A List Apart" href="http://www.alistapart.com/articles/conflictingabsolutepositions" target="_blank">article about conflicting absolute position</a>. After some tests, I discover a good way to center elements vertically or horizontally without know his dimensions.</p>
<p>If you have the following HTML / CSS:</p>
<iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/TCQcc/2/embedded/html,css,result"></iframe>
<p>It&#8217;s a <strong>fluid layout</strong> with a div <strong>fixed dimensions</strong>. The example above show the minimum requirements to positioning a element in viewport or relative to a parent div.</p>
<p>You just need two of the 4 valid positions to allocate a element on screen, they are top, left, bottom and right, so you just need top and right, top and left, bottom and top and bottom and left. With width and height you can specify the element dimensions as usual.</p>
<div id="attachment_333" class="wp-caption alignleft" style="width: 310px"><a href="http://blog.alexandremagno.net/wp-content/uploads/2012/02/flexible_centering_divs.jpg"><img class="size-medium wp-image-333" title="Flexible centering divs" src="http://blog.alexandremagno.net/wp-content/uploads/2012/02/flexible_centering_divs-300x150.jpg" alt="Centering elements without known dimensions" width="300" height="150" /></a><p class="wp-caption-text">Declaring top, left, bottom and right with 50%</p></div>
<p>But if you declare top and bottom, or left and right? As explained in <a title="Conflicting absolute positions article at A list apart" href="http://www.alistapart.com/articles/conflictingabsolutepositions" target="_blank">conflicting positions article</a>, since <strong>IE7</strong>, they <strong>consider the two positions</strong> and the <strong>height is filled of the remaining space between two positions</strong>.</p>
<p>This mean that if you declare 20% of top, right, left and bottom you will have a behaviour like a border, with the width and height filling the content until the edge.</p>
<p>If you go extreme, and put two conflicting positions to 50% you will have:</p>
<iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/xb8Hp/embedded/html,css,result"></iframe>
<p>So, if you declare the four rules for position with 50% the element will have one pixel, just because of the border. So, with this, if you declare less than 50% they will keep centered horizontally and vertically and the height and width will be guided by the remaining values of percentage. Width 42%, for example for top and bottom, the height will be 16% (8% twice) of the parent element or the viewport. You can see working below:</p>
<iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/xkE7A/embedded/html,css,result"></iframe>
<p>So, this way you can center fluid elements and they remaining with the same alignment proportions as you resize the viewport.</p>
<p>For me, even seens obvious, it&#8217;s a great way, cause I always used methods like <a title="Differents methods to center elements vertically and horizontally" href="http://tutorialzine.com/2010/03/centering-div-vertically-and-horizontally/" target="_blank">negative margin and jQuery for center elements</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexandremagno.net/en/2012/02/centering-elements-in-a-fluid-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The html5 upload API</title>
		<link>http://blog.alexandremagno.net/en/2012/01/the-html5-upload-api/</link>
		<comments>http://blog.alexandremagno.net/en/2012/01/the-html5-upload-api/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 03:32:33 +0000</pubDate>
		<dc:creator>alexanmtz</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://blog.alexandremagno.net/?p=262</guid>
		<description><![CDATA[One of the great things that&#8217;s the new to HTML specification for Mozilla it&#8217;s the new way to access files and handle upload. Now you have access to basic file information, that it wasn&#8217;t possible before with native implementation, cause you just had access to file after the user post the form data. Now the [...]]]></description>
			<content:encoded><![CDATA[<p>One of the great things that&#8217;s the new to <strong>HTML specification</strong> for <strong>Mozilla</strong> it&#8217;s the new way to access files and handle upload. Now you have access to basic file information, that it wasn&#8217;t possible before with native implementation, cause you just had access to file after the user post the form data. Now the <strong>Mozilla browsers</strong> since <strong>version 4.0</strong> has a temporary <strong>storage of the file at client machine</strong>, and there&#8217;s more, you can handle <strong>multiple uploads</strong>. You don&#8217;t need use third party libraries like <a title="swfupload - a flash / javascript upload library to handle multiple uploads" href="http://swfupload.org/" target="_blank">swfupload</a> anymore, but to keep full support for any kind of users, you can still use it as fallback.</p>
<p>The support is still limited to <a title="A open source browser from Mozilla" href="http://www.mozilla.org/en-US/firefox/new/" target="_blank">Firefox</a>, but it&#8217;s a great example how the new things at <strong>HTML5</strong> gave us freedom to make a better user experience.</p>
<p>So let&#8217;s imagine that you have a simple <strong>html form</strong> with a input file, a <strong>related css</strong> and the <strong>following javascript </strong>explained.</p>
<iframe style="width: 100%; height: 300px" src="http://jsfiddle.net/q8FTA/3/embedded/html,css,js,result"></iframe>
<p>With the new <a title="How to handle files using FileReader" href="http://www.html5rocks.com/en/tutorials/file/dndfiles/" target="_blank"><strong>FileReader</strong></a> Class you can trigger a click at file input, and this way you can handle the file choose dialog after a user select a file. So you can bind a change event and handle the file chosen.</p>
<p>You can have a <a title="The FileReader API" href="https://developer.mozilla.org/en/DOM/FileReader" target="_blank">complete documentation at mozilla MDC page</a>.</p>
<p><strong>Important: </strong>If you want to use a normal link to trigger the dialog page, you should hide the input file, but not with display hidden, but with opacity: 0, because chrome don&#8217;t accept to trigger a event in a hidden file field.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexandremagno.net/en/2012/01/the-html5-upload-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s get started with Bootstrap</title>
		<link>http://blog.alexandremagno.net/en/2011/10/lets-get-started-with-bootstrap/</link>
		<comments>http://blog.alexandremagno.net/en/2011/10/lets-get-started-with-bootstrap/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 00:22:13 +0000</pubDate>
		<dc:creator>alexanmtz</dc:creator>
				<category><![CDATA[HTML/CSS @en]]></category>
		<category><![CDATA[UX @en]]></category>
		<category><![CDATA[bootstrap]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.alexandremagno.net/?p=218</guid>
		<description><![CDATA[Since design guides to interaction patterns, we wish to define the pattens and consistency in a web application to reuse the highest design elements as possible. Not just that, the Twitter, with the bootstrap goes one step further and develop a framework where contains all website elements, following the twitter style, and Open Source! They [...]]]></description>
			<content:encoded><![CDATA[<p>Since design guides to interaction patterns, we wish to define the pattens and consistency in a web application to reuse the highest design elements as possible. Not just that, the Twitter, with the <a title="Bootstrap from Twitter" href="http://twitter.github.com/bootstrap/#">bootstrap</a> goes one step further and develop a framework where contains all website elements, following the twitter style, and Open Source! They called <a title="Bootstrap from Twitter" href="http://twitter.github.com/bootstrap/#">bootstrap.</a></p>
<p>What the main advantages to have the Bootstraping process at beginning of the project or use the <a title="Twitter Bootstrap" href="http://twitter.github.com/bootstrap/#">twitter boostrap</a>? It seens so obvious: make a pattern for all design elements growing in a scale that the layout definition step are decrease in effort to in a ideal world they don&#8217;t exist anymore, cause the front-end developer would guess with the architect the right user experience, because the library is strong enough to supply all features in the application. Use the twitter bootstrap the way it is to prototyping is something really usefull, cause is simple, clean, agnostic and with all the CSS3 features.</p>
<p>Other great advantage is to follow the same visual consistency across projects.</p>
<p>The <a title="Bootstrap from Twitter" href="http://twitter.github.com/bootstrap/#">bootstrap</a> is organic, and according with new elements it&#8217;s growing and everything aims to go out to the limit. The minimum necessary to be bootstrap working:</p>
<ul>
<li>Grid elements</li>
<li>Forms</li>
<li>Typography</li>
<li>Headers</li>
<li>Lists</li>
<li>Tables</li>
<li>Buttons</li>
</ul>
<h3>How to show the importance of bootstraping your project</h3>
<p>Sometimes is difficult you get negotiate this step. It just ignored or sometimes even started, but soon is discontinued and then abandoned. In this last case this is just a symptom of another wrong reason, probably there is no pattern and there&#8217;s always a difficult when need to define many pages e how a behavior should be in a some interaction, how form validations, for example.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexandremagno.net/en/2011/10/lets-get-started-with-bootstrap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook and Google+, one step further</title>
		<link>http://blog.alexandremagno.net/en/2011/09/facebook-and-google-one-step-further/</link>
		<comments>http://blog.alexandremagno.net/en/2011/09/facebook-and-google-one-step-further/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 05:24:46 +0000</pubDate>
		<dc:creator>alexanmtz</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[best]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[popularity]]></category>
		<category><![CDATA[products]]></category>

		<guid isPermaLink="false">http://blog.alexandremagno.net/?p=209</guid>
		<description><![CDATA[Well, it&#8217;s not news that Google+ was lauched to make a direct battle with Facebook. Leaving the user choose circle as main feature, Google+ try to invest in the most weakness part of Facebook: privacy. But in few months the Facebook launch a series of features that make a significant improvement in the way the [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s not news that <a title="Google Plus" href="https://plus.google.com" target="_blank">Google+</a> was lauched to make a direct battle with <a title="Facebook" href="http://www.facebook.com" target="_blank">Facebook</a>. Leaving the user choose circle as main feature, <a title="Google Plus" href="https://plus.google.com" target="_blank">Google+</a> try to invest in the most weakness part of <a title="Facebook" href="http://www.facebook.com" target="_blank">Facebook</a>: privacy. But in few months the <a title="Facebook" href="http://www.facebook.com" target="_blank">Facebook</a> launch a series of features that make a significant improvement in the way the friends network are related. Between it there&#8217;s a killer feature: <a title="News feeds improvements from Facebook" href="http://developers.facebook.com/blog/post/55/" target="_blank">News feeds improvements</a>. This way the <a title="Definition of Mark Zuckerberg in Wikipedia" href="http://pt.wikipedia.org/wiki/Mark_Zuckerberg" target="_blank">Mark Zuckerberg</a> social network not just cover what the <a title="Google Plus" href="https://plus.google.com" target="_blank">Google+</a> main feature does: control friends network in usual groups, they gone besides that, they detect your behaviour to define for default the groups of friends and the probably close friends! one step further of course.</p>
<p><a title="Google Plus" href="https://plus.google.com" target="_blank">Google Plus</a> try to increase her popularity <a title="Google+ API" href="http://plusdevs.com/" target="_blank">making one API</a>, but the facebook api is another step further.</p>
<p>This battle is getting even more interesting, showing how a giant like <a title="Google" href="http://www.google.com" target="_blank">Google </a>are try to affront the no scale <a title="Facebook" href="http://www.facebook.com" target="_blank">Facebook</a> growing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.alexandremagno.net/en/2011/09/facebook-and-google-one-step-further/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

