<?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>Ionut Staicu - Webdeveloper Blog &#187; CSS</title>
	<atom:link href="http://dev.iamntz.com/category/cssxhtml/css/feed" rel="self" type="application/rss+xml" />
	<link>http://dev.iamntz.com</link>
	<description>Stuff about CSS, XHTML, Javascript and jQuery</description>
	<lastBuildDate>Thu, 26 May 2011 05:43:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Internet Explorer List margin bug</title>
		<link>http://dev.iamntz.com/44/internet-explorer-list-margin-bug</link>
		<comments>http://dev.iamntz.com/44/internet-explorer-list-margin-bug#comments</comments>
		<pubDate>Tue, 02 Sep 2008 23:11:49 +0000</pubDate>
		<dc:creator>Staicu IonuÈ›-Bogdan</dc:creator>
				<category><![CDATA[Advices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS/XHTML]]></category>

		<guid isPermaLink="false">http://dev.iamntz.com/?p=44</guid>
		<description><![CDATA[In some (weird) cases, Internet Explorer (both 6 and 7, i didn&#8217;t use 8 yet) add an extra margin to your list elements (LI). This is very annoying and frustrating if you don&#8217;t know how to get rid of it. &#8230; <a href="http://dev.iamntz.com/44/internet-explorer-list-margin-bug">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In some (weird) cases, Internet Explorer (both 6 and 7, i didn&#8217;t use 8 yet) add an extra margin to your list elements (<code>LI</code>). This is very annoying and frustrating if you don&#8217;t know how to get rid of it.</p>
<p>You have two solution:</p>
<p>First one, if you already coded your site and you saw the bug very lately, you can add a negative margin to list elements (either top or bottom). Every time i used this method i had no problems, so&#8230; I think it works <img src='http://dev.iamntz.com/wp-includes/images/smilies/biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Second one implies to use some non-semantic code. Actually&#8230; Is not always non-semantic. Sounds weird? Well&#8230; Did you ever heard of Definition Lists? <code>DL/DT/DD</code>. If yes, then start using it! IE doesn&#8217;t have any problems at all with this. If no, <a href="http://www.w3.org/TR/html401/struct/lists.html#h-10.3">read some infos</a> about this and then start using.</p>
<p>Why i tell you that is both semantic and non semantic code? For instance, on a menu, is more adequate to use <code>UL/LI</code> tags. Is a list? Ofcourse! But, you can use, as well <code>DL/DD</code> tags.</p>
<p>I know, is messy, but it works flawless <img src='http://dev.iamntz.com/wp-includes/images/smilies/biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://dev.iamntz.com/44/internet-explorer-list-margin-bug/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Simple carousel (slider)</title>
		<link>http://dev.iamntz.com/24/simple-carousel-slider</link>
		<comments>http://dev.iamntz.com/24/simple-carousel-slider#comments</comments>
		<pubDate>Fri, 30 May 2008 16:42:05 +0000</pubDate>
		<dc:creator>Staicu IonuÈ›-Bogdan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS/XHTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://dev.iamntz.com/?p=24</guid>
		<description><![CDATA[Ok, as i said before, i will make an article about what option you have when you want to use a carousel. As a jQuery user as I am, the first option i have is Sorgalla&#8217;s Carousel. It&#8217;s pretty easy &#8230; <a href="http://dev.iamntz.com/24/simple-carousel-slider">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ok, as i said before, i will make an article about what option you have when you want to use a carousel. As a jQuery user as I am, the first option i have is <a href="http://sorgalla.com/projects/jcarousel/">Sorgalla&#8217;s Carousel</a>. It&#8217;s pretty easy to use but has some disadvantages:</p>
<ul>
<li>big size &#8211; around 50k, maybe more, without another 20k for jQuery</li>
<li>some IE6 problems &#8211; yes, IE6 still has a huge market share. We still need to pull out our hair to make this piece of crap display good all pages</li>
<li>you cannot highlight current tab &#8211; if you want to use it as a tab pagination, you simply cannot highlight selected tab. Or current page.</li>
</ul>
<p>So, on an older project of mine, i wanted to use a very light script for doing this. Because i was in a really rush, i didn&#8217;t  focus on unobtrusive scripts so i put some inline javascript (yes, shame on me).</p>
<pre lang="html" line="1">
<div id="slideCtrl">
 <a class="s1 s" onclick="showSlide(1);return false;" href="#">Tab 1</a>
 <a class="s2" onclick="showSlide(2);return false;" href="#">Tab 2</a>
 <a class="s3" onclick="showSlide(3);return false;" href="#">Tab 3</a></div>
</pre>
<p>Ok, this is for control. The most important thing is that you can put this ANYWHERE in your page. For example, you can put controls on header and slider on footer of your page. Only your imagination is the limit.</p>
<p>The next thing you have to do is to put some markup:</p>
<pre lang="html" line="1">
<div id="slider">
<div class="slider">
<div class="slideWrapper">
<div class="box">Tab 1 content</div>
<div class="box">Tab 2 content</div>
<div class="box">Tab 3 content</div>
</div>

<!--/.slideWrapper--></div>

<!--/.slider--></div>

<!--/slider--></pre>
<p>This script also has some limitation:</p>
<ul>
<li>You can have only one on page;</li>
<li>Is pretty obtrusive;</li>
<li>Doesn&#8217;t do auto slide. Of course, you can set a timer for this, but i wanted an easy example.</li>
</ul>
<h3>The next thing we have to do is to set some CSS.</h3>
<p>Width and height for carousel:</p>
<pre lang="css">#slider {
	width:674px;
	height:185px;
}
</pre>
<p><span id="more-24"></span><!--adsense--><br />
The magic of this script (and also of all carousel scripts) consists in playing with position relative and position absolute:</p>
<pre lang="css">#slider .slider {
	width:660px;
	overflow:hidden;
	margin:0 auto;
	position: relative;
	height:160px;
}
#slider .slideWrapper {
	width:2640px;
	position: absolute;
	height:160px;
}
</pre>
<p>The <code>slideWrapper</code> container must have a big width: a tab width * number of tabs. If you have five tabs with 500px wide each, the slideWrapper must have around 2500px wide (even more, nobody will be upset).</p>
<p>The next thing we have to stylize is each tab-box (.box). For this, we need to float each box:</p>
<pre lang="css">#slider .box {
	width:660px;
	float:left;
	padding:20px 0;
}</pre>
<p>The result will be a wide container which has all boxes on one row. Well.. The html/css part is ends here. The next is&#8230; Javascript (or jQuery) part.</p>
<p>The most basic use is this:</p>
<pre lang="javascript">var currentslide = 1
function showSlide(nrSld) {
	currentslide = parseInt(nrSld)
	$('#slider .slideWrapper').animate({left:-660*(parseInt(nrSld)-1)})
	redrawBullets(nrSld);
};
</pre>
<p>What we do? Long story short: we move the <code>slideWrapper</code> container in its parent from left to right and from right to left, according to our needs. Simple, eh?</p>
<p>The <code>redrawBullets</code> function is for highlighting the current selection:</p>
<pre lang="javascript">function redrawBullets(slide) {
	var currentBullet = 's'+slide;
	$('#slideCtrl a').each(function(){
	$(this).removeClass('s');
	if($(this).hasClass(currentBullet)){
		$(this).addClass('s')
		}
	});
};
</pre>
<p>What do we need next? Well.. We only need to test. Here it is a <a href="http://www.iamntz.com/portfolio/writing%20school%20wp-theme/page1.html">demo </a>(is already used in a site). If you want, you can use <a href="http://gsgd.co.uk/sandbox/jquery/easing/">EaseIn </a>plugin to add some nice effects on slide.</p>
<p>We have a nice tabbed based navigation with a very cool effect which is ready to use on your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.iamntz.com/24/simple-carousel-slider/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>PSD HTML Slicing Tutorial</title>
		<link>http://dev.iamntz.com/18/psd-html-slicing-tutorial</link>
		<comments>http://dev.iamntz.com/18/psd-html-slicing-tutorial#comments</comments>
		<pubDate>Sun, 25 May 2008 00:58:34 +0000</pubDate>
		<dc:creator>Staicu IonuÈ›-Bogdan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS/XHTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://dev.iamntz.com/?p=18</guid>
		<description><![CDATA[Ok, as I&#8217;ve said HERE, my great psd slicing tutorial is done. Please note that it is my very first video tutorial so I&#8217;m sorry for this things: If I cut out too much parts (yes, some parts like ALT-TAB &#8230; <a href="http://dev.iamntz.com/18/psd-html-slicing-tutorial">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ok, as I&#8217;ve said HERE, my great psd slicing tutorial is done. Please note that it is my very first video tutorial so I&#8217;m sorry for this things:</p>
<ol>
<li>If I cut out too much parts (yes, some parts like ALT-TAB window, start menu showing, and so on are missing). I considered that those parts are not essential so, to reduce size, I&#8217;ve cut them out.</li>
<li>If it&#8217;s taking too long. The tutorial consists in two parts, both are around 30 minutes. I wanted to play them at 150-200% speed, but I quit. I offer a download alternative (besides the online playing), so you can download files and play them in your favorite media player with higher speed.</li>
<li>If I have language errors. English is not my native language, so I made mistakes. Some mistakes I&#8217;ve seen, some not. But it takes way to long to edit the videos again and again. I consider that errors are acceptable because the final result (which is that you understand how it&#8217;s made) is more important.</li>
</ol>
<h2>Download:</h2>
<p><a href="http://rapidshare.com/files/117389583/www.iamntz.com-PSD2HTML.slicing.tutorial.part1.wmv">Part one</a> <a href="http://rapidshare.com/files/117389592/www.iamntz.com-PSD2HTML.slicing.tutorial.part2.wmv">Part two</a>. Great for offline views.</p>
<p>Files used in movies: <a href="http://iamntz.com/experiments/slice/slicing-tutorial-www.iamntz.com.zip">HERE</a>.</p>
<p>EDIT: Because i received complains about codec and browser crash because of videos, i put only FLV version. If you prefer, under each player, you find a link for VMW version (which have waaaay better quality).</p>
<h2>Part one</h2>
<p><object width="636" height="480"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1061707&amp;server=www.vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1061707&amp;server=www.vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="636" height="480"></embed></object></p>
<p><a href="http://dev.latest-mtv.net/play.php?id=2&#038;width=640&#038;height=480">VMW version, </a>higher quality.<br />
<!--adsense--></p>
<h2>Part two</h2>
<p><object width="636" height="480"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=1061737&amp;server=www.vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://www.vimeo.com/moogaloop.swf?clip_id=1061737&amp;server=www.vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="636" height="480"></embed></object></p>
<p><a href="http://dev.latest-mtv.net/play.php?id=3&#038;width=640&#038;height=480">VMW version, </a>higher quality.</p>
<p>I use <a href="http://www.e-texteditor.com/">E-texteditor</a>, which is THE BEST editor i ever seen, so don&#8217;t worry if things appear from nowhere. Is just my snippets.</p>
<h2>READ THIS PLEASE</h2>
<p>I really need feedback on this movies, because i want to know if i should continue or not on creating (video) tutorials. So, you like it? If you don&#8217;t like it, what was wrong? What is missing? And the most important: did you understand what&#8217;s happening there? After you did this tutorial, you are able to make this on your own?</p>
<p>Thanks and enjoy!</p>
<p>I almost forgot.<br />
The host for videos is provided by <a href="http://latest-mtv.net/">Miodrag</a>, because on my host i have limited amount of both space and bandwidth.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.iamntz.com/18/psd-html-slicing-tutorial/feed</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>How to slice a layout? Some kind of tutorial</title>
		<link>http://dev.iamntz.com/16/how-to-slice-a-layout-some-kind-of-tutorial</link>
		<comments>http://dev.iamntz.com/16/how-to-slice-a-layout-some-kind-of-tutorial#comments</comments>
		<pubDate>Sat, 24 May 2008 11:23:31 +0000</pubDate>
		<dc:creator>Staicu IonuÈ›-Bogdan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS/XHTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[Slicing]]></category>

		<guid isPermaLink="false">http://dev.iamntz.com/?p=16</guid>
		<description><![CDATA[in progress&#8230; Status: rendering first part of video. Layout: this one. I put my designer skills on work and this is what i got. I&#8217;m sure it is not the best design in the world, but i&#8217;m sure is more &#8230; <a href="http://dev.iamntz.com/16/how-to-slice-a-layout-some-kind-of-tutorial">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>in progress&#8230;</p>
<p>Status: rendering first part of video.</p>
<p>Layout: <a href="http://i126.photobucket.com/albums/p95/i0nutzb/dev/layout.png">this one</a>. I put my designer skills on work and this is what i got. I&#8217;m sure it is not the best design in the world, but i&#8217;m sure is more that we need for undestand how stuff work, right? <img src='http://dev.iamntz.com/wp-includes/images/smilies/biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>The result: <a href="http://iamntz.com/experiments/slice/">here</a>. At the end you will have the zip file with all files. PSD is included <img src='http://dev.iamntz.com/wp-includes/images/smilies/wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I hope in one hour to have first part (30 min) up &amp; running on my site. It&#8217;s about how to slice images and how to create header with top menu. In the second part, you will learn how to made the sidebar and content.</p>
<p><strong>Updates.</strong></p>
<p>I uploaded first part on google videos. Quality SUCKS! I exported with 640&#215;480 resolution and is the most HORRIBLE thing.</p>
<p>Anyway, i reconverted first part and i uploaded on Vimeo. I&#8217;m waiting to see how it&#8217;s working. The new video have around 30Mb, 30minutes and is encoded as WMV.</p>
<p>Now i&#8217;m rendering (50%) the second part of video. Wish me luck <img src='http://dev.iamntz.com/wp-includes/images/smilies/biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>You still need to stay tuned <img src='http://dev.iamntz.com/wp-includes/images/smilies/biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://dev.iamntz.com/16/how-to-slice-a-layout-some-kind-of-tutorial/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>2 Column layout -Basic and advanced</title>
		<link>http://dev.iamntz.com/15/2-column-layout-basic-and-advanced</link>
		<comments>http://dev.iamntz.com/15/2-column-layout-basic-and-advanced#comments</comments>
		<pubDate>Wed, 21 May 2008 12:02:59 +0000</pubDate>
		<dc:creator>Staicu IonuÈ›-Bogdan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS/XHTML]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Layouts]]></category>

		<guid isPermaLink="false">http://dev.iamntz.com/?p=15</guid>
		<description><![CDATA[In last three days, i had at least five request for making a tutorial about CSS layouts. I also have request about slicing, but this can be wait for a while (i&#8217;m thinking seriously to make a video tutorial about &#8230; <a href="http://dev.iamntz.com/15/2-column-layout-basic-and-advanced">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In last three days, i had at least five request for making a tutorial about CSS layouts. I also have request about slicing, but this can be wait for a while (i&#8217;m thinking seriously to make a video tutorial about this; what do you think?). For now i will show you two way to get the „perfect” layout. First one is basic, easy to use and to implement and second is SEO friendly, where main content is the first thing you see when you view the source.</p>
<p>I will make examples for very basic layouts (and also most used): Header, Sidebar, Content area and Footer. </p>
<p>Here is all steps. Step 1: markup</p>
<pre lang="html" line="1">
<div id="wrap">
<div id="header">
		Header
	</div>

<!--/header-->
<div class="clearfix">
<div id="left">
			left side
		</div>

<!--/left-->
<div id="right">
			right side
		</div>

<!--/right-->
	</div>
<div id="footer">
		footer
	</div>

<!--/footer-->
</div>

<!--/wrap-->
</pre>
<p>Step 2: Floatings. We float left and right sidebar and content:</p>
<pre lang="css" line="1">
#wrap {
	width:970px;
	margin:0 auto;
	border: 1px solid #eee;
}
	#header {
		height:150px;
		border-bottom:1px solid #eee;
	}
	#left,
	#right {
		height:500px;
	}
	#left {
		width:200px;
		float:left;
		background:#f2f2f2;
	}
	#right {
		width:760px;
		float:right;
		background:#f4f4f4;
	}
</pre>
<p>Step 3: Done <img src='http://dev.iamntz.com/wp-includes/images/smilies/smile.gif' alt=':)' class='wp-smiley' />  Here is <a href="http://iamntz.com/experiments/2Column_layout/basic.html">the demo</a>. Yeah, i know, too easy, right? Sorry for that (i like to work easy <img src='http://dev.iamntz.com/wp-includes/images/smilies/tongue.gif' alt=':P' class='wp-smiley' />  )</p>
<p>The next example is just a little bit more complicated, because, as i said, the content will be the first thing in source, so the search crawler can find content more easy.</p>
<p>Step 1: Markup (with content first!)</p>
<pre lang="html" line="1">
<div id="wrap">
<div class="clearfix" id="content">
<div id="right">
			right side
		</div>

<!--/right-->
<div id="left">
			left side
		</div>

<!--/left-->
	</div>
<div id="header">
		Header
	</div>

<!--/header-->
<div id="footer">
		footer
	</div>

<!--/footer-->
</div>

<!--/wrap-->
</pre>
<p>Next step, the only need to float is the right side:</p>
<pre lang="css" line="1">
#wrap {
	width:970px;
	margin:0 auto;
	border: 1px solid #eee;
}
	#header {
		height:150px;
		border-bottom:1px solid #eee;
	}
	#left,
	#right {
		height:500px;
	}
	#left {
		width:200px;

		background:#f2f2f2;
	}
	#right {
		width:760px;
		float:right;
		background:#f4f4f4;
	}
</pre>
<p>Ok, but how do we put the header back on top? Very simple: Header needs to be absolutely positioned and the content needs to be moved a little bid lower (exactly the header height):</p>
<pre lang="css" line="1">
#header {
	height:150px;
	border-bottom:1px solid #eee;
	position: absolute;
	top:0;
}
#content {
	margin-top:150px;
}
</pre>
<p>Next step is&#8230; You guess it right! <a href="http://iamntz.com/experiments/2Column_layout/advanced.html">DEMO</a>. Again, sorry if you wanted more code to read and understand, fancy yada yada yada code and so on. I like to have a clean and easy to understand code <img src='http://dev.iamntz.com/wp-includes/images/smilies/wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Any question?</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.iamntz.com/15/2-column-layout-basic-and-advanced/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Best way to CSS hacks</title>
		<link>http://dev.iamntz.com/14/best-css-tricks</link>
		<comments>http://dev.iamntz.com/14/best-css-tricks#comments</comments>
		<pubDate>Fri, 16 May 2008 23:21:10 +0000</pubDate>
		<dc:creator>Staicu IonuÈ›-Bogdan</dc:creator>
				<category><![CDATA[Advices]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS/XHTML]]></category>

		<guid isPermaLink="false">http://dev.iamntz.com/?p=14</guid>
		<description><![CDATA[Every time you code a layout, you must dealing with inconsistencies of various browsers. Due to his lack of standard support, IE (and especially IE6) has a LOT of css hacks available &#8220;on the market&#8221;. And that because the IE &#8230; <a href="http://dev.iamntz.com/14/best-css-tricks">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Every time you code a layout, you must dealing with inconsistencies of various browsers. Due to his lack of standard support, IE (and especially IE6) has a LOT of css hacks available &#8220;on the market&#8221;. And that because the IE developer team has some kind of humor for two reason:</p>
<ol>
<li>They know that their browser suck so they put conditional comments. Is not a really hack, because you have <a href="http://msdn.microsoft.com/en-us/library/ms537512.aspx">a documentation</a>, but is the best (and also the safest) way to fix CSS bugs (or even add some extra content for certain version of IE).</li>
<li>The second reason is funny and creepy: the fresh SP3 for windows is delivered with&#8230; IE6. Yes, if you don&#8217;t have IE7 installed, you will have IE6. That sucks, isn&#8217;t it?</li>
</ol>
<p>Ok, enough with this, let&#8217;s show some real hacks, right?</p>
<h3>Internet Explorer hacks</h3>
<p>First of all: the best way is to use conditional hacks for IE. That&#8217;s because new version of other browsers can misunderstanding some hacks. As far as i know, this wasn&#8217;t happen yet, but you never know what gift we can get, right? <strong>Use hacks when you have only a couple to fixes</strong>!</p>
<p>The most used hack for IE6 is the star selector :</p>
<pre lang="css">#wrap {border:2px solid blue}
* html #wrap {border:5px solid red}</pre>
<p>For IE6, wrap container will have a 5 px border. For any other browser, you will get a 2px blue border. Is important to get IE6 hack AFTER the normal rules, otherwise you won&#8217;t get any result.</p>
<pre lang="css">html>body #wrap {background:white}
#wrap {background:red}</pre>
<p>This one is some kind of first rule, but reverted. That&#8217;s because IE6 simply don&#8217;t know how to deal with this kind of selectors (which is valid tough!). Lucky us, right?</p>
<p>Another hack is the underlined and !important. However, those hacks are NOT recommended for mass production (is ok for testing, but&#8230; that&#8217;s all):</p>
<pre lang="css">#wrap {
color:red !important;
color:blue
}</pre>
<p>and</p>
<pre lang="css">#wrap {
color:red;
_color:blue
}</pre>
<p>With both hacks you will achieve same result. But i repeat, DO NOT USE it unless you know what are doing. You will avoid a LOT of headaches <img src='http://dev.iamntz.com/wp-includes/images/smilies/wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Until now, i talk about IE6 hacks. Here you have a IE7 hack:</p>
<pre lang="css">#header { font-size:1em }
*:first-child+html #header { font-size:2em }</pre>
<p>Like i said before, is mandatory that hack to be AFTER proper rule!</p>
<h3>IE6 min/max-width hacks</h3>
<pre lang="css">#wrap {
	width: expression(document.body.clientWidth < 742? "740px" : document.body.clientWidth > 1202? "1200px" : "auto");
	}</pre>
<p>For this one, we need to use some CSS expressions. Also, is not recommended (can affect user experience, because browser execute that expression). This hack was founded <a href="http://www.cameronmoll.com/archives/000892.html">here</a>.</p>
<h3>Image flicker problem</h3>
<p>One of the most annoying thing on IE is this: when you have a css image on a link, when you hover that link, the image is reloaded, resulting a short time flicker. Mister-pixel.com comes with a handy solution for this (that works only in IE6 SP1 or greater):</p>
<pre lang="javascript">
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
	try {
  document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
/* ]]&gt; */
</script>
</pre>
<p>You only need to put these lines in your header (inside of conditional tags) and your problem is done.</p>
<h3>There is more?</h3>
<p>Well&#8230; I&#8217;m sure i didn&#8217;t cover all CSS hacks. However, these are some of the most important hacks, ready to use anytime you need it (and for your own good, you should bookmark this page because you will need it A LOT!). Do you know any other hacks?</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.iamntz.com/14/best-css-tricks/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Playing with lists</title>
		<link>http://dev.iamntz.com/10/playing-with-lists</link>
		<comments>http://dev.iamntz.com/10/playing-with-lists#comments</comments>
		<pubDate>Wed, 14 May 2008 14:01:49 +0000</pubDate>
		<dc:creator>Staicu IonuÈ›-Bogdan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS/XHTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://dev.iamntz.com/?p=10</guid>
		<description><![CDATA[In this article we will be playing with list elements to create amazing menus. Most html menus are created using list because LI tag is the most appropiate tag for this, giving the developer posibility to play in many ways, &#8230; <a href="http://dev.iamntz.com/10/playing-with-lists">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In this article we will be playing with list elements to create amazing menus. </p>
<p>Most html menus are created using list because LI tag is the most appropiate tag for this, giving the developer posibility to play in many ways, achivieng nice effects. I won&#8217;t touch the vertical lists because it&#8217;s their default display. Instead, i will cover some of horizontal lists.</p>
<h3>Basic list</h3>
<p>The basic setup for a horizontal list is to set float to list elements:</p>
<pre lang="html">
<ul id="list1">
<li><a href="#">Menu item 1</a></li>
<li><a href="#">Menu item 2</a></li>
<li><a href="#">Menu item 3</a></li>
<li><a href="#">Menu item 4</a></li>
</ul>
</pre>
<pre lang="css">#list1 li {
	float:left;
	list-style:none;
	margin-right:10px;
}
</pre>
<p>At this point we have a one level horizontal menu, created with list and you can see this on many (and i mean MANY) sites. Ofcourse, you can add some extra styles such as border, background (color or image) for links inside <code>LI</code> elements for getting even a nicer look. <a href="http://iamntz.com/experiments/playing-with-list/floating.html">Demo here</a>.</p>
<h3>One level drop down menu (suckerfish)</h3>
<p><span id="more-10"></span></p>
<p>The next menu i show, is a little bit more complicated, but also is more useful when you have category and sub-category. For example, imagine this blog with main category Javascript and sub-category jQuery. If i had many sub-categories, i would probably used a dropdown menu for using less space. This kind of menu is named <a href="http://www.alistapart.com/articles/dropdowns">Suckerfish (A list apart)</a>.</p>
<p>For this, we will use nested list and we will show only parents:</p>
<pre lang="html">
<ul id="list2">
<li><a href="#">Menu item 1</a>
<ul>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
</ul>
</li>
<li><a href="#">Menu item 2</a>
<ul>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
</ul>
</li>
<li><a href="#">Menu item 3</a>
<ul>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
<li><a href="#">Sub menu 1</a></li>
</ul>
</li>
<li><a href="#">Menu item 4</a></li>
</ul>
</pre>
<p>Ofcourse, we still need to float first level in the same way as we did in first example:</p>
<pre lang="css">#list2 li {
	float:left;
	list-style:none;
	margin-right:10px;
}
</pre>
<p>I said before we will hide all nested list elements, so here we go:</p>
<pre lang="css">#list2 li ul{
	display:none
}
</pre>
<p>Right now, we have a basic horizontal list. Next step is to show second level of list on hover. Because IE6 don&#8217;t know what is hover on all elements (only on <code>A</code> tag), for this browser we will use some javascript (but later).</p>
<pre lang="css">#list2 li:hover ul{
	display:block
}
</pre>
<p>Because we need to have a nice display for submenus, we have to relatively positioning main <code>LI</code> tags, so on the <code>#list2 li</code> rules add</p>
<pre lang="css">	position:relative
</pre>
<p>Also, the inner <code>UL</code> tags we need to change to:</p>
<pre lang="css">#list2 li ul{
	display:none;
	position: absolute;
	left:0;
	top:1em;
	width:150px;
}
</pre>
<p>In this point we have a very basic suckerfish menu that works on all browser except, ofcourse, IE6 <img src='http://dev.iamntz.com/wp-includes/images/smilies/biggrin.gif' alt=':D' class='wp-smiley' />  As i said before, we will make a little javascript snippet for adding or remove <code>over</code> class for LI elements. If you are using jQuery (like i do), the whole thing is easier than you think:</p>
<pre lang="javascript">	var IE6 = false /*@cc_on || @_jscript_version &lt; 5.7 @*/;
	if(IE6){$(#list2 li).hover(function(){$(this).addClass('over')}, function(){$(this).removeClass('over')})}
</pre>
<p>If you don&#8217;t want to use a javascript library (either you have a small page or you like to develop your own code), you can use next code (and add just before body tag closes):</p>
<pre lang="javascript">var IE6 = false /*@cc_on || @_jscript_version &lt; 5.7 @*/;
if(IE6){
	startList = function() {
		navRoot = document.getElementById('list2');
		for (i=0; i</pre>
<p>Well&#8230; Yes, that&#8217;s all. We only need to add an extra rule on CSS and <code>#list2 li:hover ul</code> become:</p>
<pre lang="css">	#list2 li:hover ul,
	#list2 li.over ul
</pre>
<p>At this point we have a fully functional suckerfish menu (but still with an ugly look), working on all modern browsers (even IE6). You can see the demo <a href="http://iamntz.com/experiments/playing-with-list/suckerfish.html">here</a>.</p>
<h3>Breadcrumb</h3>
<p>This one is one of my favorite toys <img src='http://dev.iamntz.com/wp-includes/images/smilies/biggrin.gif' alt=':D' class='wp-smiley' />  With this type of menu we get a &#8220;vista explorer look&#8221; breadcrumb, ready to use on your site. We will use same markup as suckerfish and also a library (i like jQuery, so i will use it)</p>
<pre lang="javascript">$(document).ready(function(){
	$('ul#list2 ul').toggle().hide();
	$('ul#list2 ul').parent('li').append('<a class="dropDown" href="#">-</a>');
	$('a.dropDown').click(function(){
		var t=this;
		$('ul#list2 ul').not($(t).parent('li').find('ul')).hide();
		$(t).parent('li').find('ul').toggle();
		$(document).unbind('click').click(function(e){
			if($(e.target).parents('ul#list2').length>1){
				$('ul#list2 ul').hide();
			}
		})

		return false;
	})
});
</pre>
<p>You can see<a href="http://iamntz.com/experiments/playing-with-list/breadcrumb.html">here</a> the demo.</p>
<p>Ofcourse, you may want to change the content for drop down links (you may want to put an arrow, your choice) for even a nicer and authentic effect.</p>
<h3>Conclusion</h3>
<p>List is so simple yet so powerful tools available for creating nice menus (the final results is up to your imagination). The final result is cross browser (yes, even IE6!), the code make sense (is semanticaly, right?) and if you don&#8217;t have javascript enabled, you can still use drop down menus (for this time not in IE6 <img src='http://dev.iamntz.com/wp-includes/images/smilies/angry.gif' alt=':(' class='wp-smiley' />  ). With a little imagination, you are able to create even nicer menus. For example, i made some time ago a scrollable menu, like iPhone menus (yes, with nested lists!). I didn&#8217;t spend too much time with it (so it won&#8217;t work too well) and i conssidered useless to post here.</p>
<p>What kind of menus do you use?</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.iamntz.com/10/playing-with-lists/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

