<?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>Aleksandar Vacić &#187; CSS</title>
	<atom:link href="http://aplus.rs/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://aplus.rs</link>
	<description>aplus.rs</description>
	<lastBuildDate>Mon, 21 May 2012 18:50:07 +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>On CSS, tables and layout</title>
		<link>http://aplus.rs/css/on-css-tables-and-layout/</link>
		<comments>http://aplus.rs/css/on-css-tables-and-layout/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 22:02:29 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[tables]]></category>

		<guid isPermaLink="false">http://aplus.rs/?p=452</guid>
		<description><![CDATA[Every 3-4 months or so, there's new wanna-be web developer that proclaims how CSS is for losers, masochists,  people with too much time etc.

Every single time it turns out that particular person is just not up to the job. Here's some honest advice.]]></description>
			<content:encoded><![CDATA[<p>In short span of 2–3 days, I encountered <a href="http://www.flownet.com/ron/css-rant.html">two</a> different <a href="http://iamelgringo.blogspot.com/2009/02/tables-vs-css-css-trolls-begone.html">examples</a> of people writing that all this <em>CSS–for–layout</em> thing is nonsense. Too hard. Inadequate. Buggy and inconsistent. Just plain hard.</p>
<p>Well, <strong>it is</strong>. Hard, I mean.</p>
<p>Everyone knows how to build some shelter: put some stools and cover with branches and it would mostly fit the bill. If however it should withstand the wind and rain, it requires quite a bit more skills. Everyone knows how to get heating: put some wood and start a fire. Only few knows what it takes to build proper, natural heating that’s just there.</p>
<p>The same is with web development. Anyone can build a web page that looks fine to them. But it might not be fine to me or some other people. It might be downright inaccessible to some. It might be pain in the ass to some other.</p>
<p>Every single time I encounter rants like those two linked above, it’s plainly obvious it’s made by people who just don’t get it. I mean, just look at those two rants/posts (whatever you call them) and you’ll see how <em>not-getting-it</em> is the core of their frustration.</p>
<p>Just one example:</p>
<blockquote><p>On the screen the natural order of flow for the five major layout elements is: top, left, center, right, bottom.  But the actual order in which they appear in the code has “right” and “center” reversed.  Is this a mistake?  To find out, let’s see what happens if we change them around so that the order in the code matches the presentation order:<br />
…<br />
Youch!  That looks terrible!  Apparently the order matters.  The <em>reason</em> that the order matters is that this layout, like all multi-column CSS layouts, is achieved with floats, and the way that floats get rendered depends on the order in which they appear.  So we have <em>not</em> managed to separate content from presentation.</p></blockquote>
<p>Yes Ron, it does not look good because CSS rules were written to achieve the desired layout using the given HTML structure code — which could also be much improved, but that’s another topic.<br />
To give you real-life example: do you have a bike? Do you expect to be able to drive if you sit on it faced to the rear of the bike? <q>Hm, crap, I can’t turn the pedals properly. The bike is shit.</q></p>
<p>The other rant is even worse, the anger of not being able to code the desired layout in CSS is spilling from all corners. I can understand that frustration and have experienced it several times, when I tried to learn something and failed to do so.</p>
<blockquote><p>I drank the Kool-Aid, and I woke up two weeks later with a broken design. I had a headache from banging my head against the CSS wall. But, it simply couldn’t be a problem with CSS itself. The problem had to be that I didn’t understand CSS well enough. The answer had to be that I was bad, lazy or I didn’t care about web standards or something. The internets had told me so.</p></blockquote>
<p>Yes <em>iamelgringo</em>, you’re just not up to it. You should have admitted it to yourself and hired someone else who is, to finish the job. Or just use tables as you did and get on with your life. Posting this:</p>
<blockquote><p>So, I don’t ever want to read how web designers who don’t use pure CSS in their layouts are lazy, stupid, don’t care about their craft, backwards or don’t bathe properly. Never again. People who post such things online are heretofore to be known as CSS Trolls and are to be banished from the internets for all time. Begone yea vile fiends!</p></blockquote>
<p>just makes you jealous wanker.</p>
<p>And just to touch lightly on the argument about Google – the fact that Google is not using CSS-based design is responsible for the fact that they have two different search pages – one for desktops, another for mobile devices (when I think about it, they probably have more than two). Multiple code bases for the page that has one input field and two buttons on it. Sheeeesh…Google’s front page <em>is</em> prime example of crapy front-end work.</p>
<h3>Will code HTML for food. And give you crap code for it.</h3>
<p>Or however that joke went. There are many reasons why tables are not to be used for layout. Two important ones are:</p>
<ol>
<li>tables are fixed structure which cement the layout for good</li>
<li>cemented structures are impossible or way too hard to adapt to displays with vastly different screen estate</li>
</ol>
<p>For instance, take a look at my <a href="http://vina.vacic.rs/en/">winery web site</a>. If you look at it on desktop browser, you’ll see rich graphics, 3-column web site. But if you look at it on iPhone in portrait mode, you’ll see one-column website with some graphics removed. All it took to achieve this look is one <code>meta</code> element in the page head and half a screen of additional CSS rules. It would be just as simple to adapt it to other mobile browsers. Let me see you do that this quick and fast with tables.</p>
<p>Not to mention how impossible is to achieve noticeably different skins if you use layout tables. For the last several years I have maintained old and created new instances of company’s main web product, using the very same code base, with just a different set of CSS rules and images. 20 or so counting, each new instance was several days at worst for the complete reskin job.<br />
Every time I need to apply some designs to pages created using ASP.NET, I cringe and resign my case or dig deep and redo almost entire contents of the <code>.aspx</code> files. It takes good deal of knowledge to do things properly.</p>
<p>Not everyone are capable of doing it, which is just fine. There’s plenty of other professions, not everyone should be web front-end developers. If you don’t know how to do it and/or are incapable of learning, just give up and find some other thing to do in life.</p>
<p>Don’t go around prophesying nonsense.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/on-css-tables-and-layout/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Rounded form buttons</title>
		<link>http://aplus.rs/css/rounded-form-buttons/</link>
		<comments>http://aplus.rs/css/rounded-form-buttons/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 21:20:13 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://aplus.co.yu/?p=335</guid>
		<description><![CDATA[Making the nicer form submit buttons. Like rounded.]]></description>
			<content:encoded><![CDATA[<p>To be precise, the submit buttons: <code>input type="submit"</code>. Very often designers want to somehow emphasize these buttons and are not very pleased with an answer “well, how about bold and colored caption?” :)</p>
<p>Recently, at the office, I had client request to create a design like this:</p>
<p><img class="alignnone size-full wp-image-343" title="Rounded button" src="http://aplus.rs/images/2008/06/picture-1.png" alt="" width="106" height="40" /></p>
<p>The HTML I had already was like this:</p>
<div class="igBar"><span id="lhtml-1"><a href="#" onclick="javascript:showPlainTxt('html-1'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">HTML:</span>
<div id="html-1">
<pre class="html">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #009900;"><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">&lt;div</span></a> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">"buttons"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><a href="http://december.com/html/4/element/strong.html"><span style="color: #000000; font-weight: bold;">&lt;strong&gt;</span></a></span></div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"Continue →"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/strong&gt;</span></span></div>
</li>
<li style="color:#26536A;">
<div style=""><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;">class</span>=<span style="color: #ff0000;">"lesserbtn"</span><span style="color: #000000; font-weight: bold;">&gt;</span></a></span></div>
</li>
<li style="color:#333;">
<div style="">&nbsp;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #009900;"><a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">&lt;input</span></a> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"submit"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"Cancel"</span> /<span style="color: #000000; font-weight: bold;">&gt;</span></a></span><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;/div&gt;</span></span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>There was no chance to change this into anything drastically different as bunch of server-side code depended on form submit buttons being input elements. Thus, I went with this code and looked for CSS solutions.</p>
<p>One really helpful fact was that all captions were one line of code. Thus, I was able to use one long image with rounded corners. I had two nested elements as well, which is enough to get the design up.<br />
<span id="more-335"></span><br />
Basic idea I had was to put background image on both the <code>input</code> and its parent element, both aligned to opposite corners.</p>
<h3>Step 1 — remove default styles</h3>
<p>This is fairly easy, but necessary.</p>
<div class="igBar"><span id="lcss-2"><a href="#" onclick="javascript:showPlainTxt('css-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-2">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.buttons </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">line-<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="color:#26536A;">
<div style="">&nbsp;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.buttons </span>input <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">line-<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #cc66cc;color:#800000;">1</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">font-size</span>: 1em;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">font-weight</span>: <span style="color: #993333;">bold</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">margin</span>: <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">padding</span>: <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">border</span>: <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<h3>Step 2 — enclosing element</h3>
<p>Now, let’s start with the styles for the button first.</p>
<div class="igBar"><span id="lcss-3"><a href="#" onclick="javascript:showPlainTxt('css-3'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-3">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.buttons </span>strong, span<span style="color: #6666ff;">.btn </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>btn-round.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">left</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">padding</span>: 1em <span style="color: #cc66cc;color:#800000;">0</span> 1em 5px;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">margin-right</span>: 10px;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">cursor</span>: <span style="color: #993333;">pointer</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>This is left side of the button. Note the use of <em>vertical paddings</em>. Since this is inline element, they do nothing to the text but they <em>do expand inline box</em>. That way, background graphic is fully revealed.</p>
<h3>Step 3 — actual button</h3>
<div class="igBar"><span id="lcss-4"><a href="#" onclick="javascript:showPlainTxt('css-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-4">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.buttons </span>strong input, span<span style="color: #6666ff;">.btn </span>input <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">color</span>: #000;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">background</span>: <span style="color: #993333;">url</span><span style="color: #66cc66;">&#40;</span>btn-round.png<span style="color: #66cc66;">&#41;</span> <span style="color: #993333;">no-repeat</span> <span style="color: #000000; font-weight: bold;">right</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">margin</span>: <span style="color: #cc66cc;color:#800000;">0</span> -5px <span style="color: #cc66cc;color:#800000;">0</span> <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">padding</span>: 1em 10px 1em 5px;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">border</span>: <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">cursor</span>: <span style="color: #993333;">pointer</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>Same thing for internal element, but this one is forced 5px to the right to reveal the rounder corners of the previous element.</p>
<p>And that’s it. Fairly simple and <em>mostly</em> works ok. Here’s an <a href="/lab/rounded-form-buttons/">example page.</a></p>
<h3>Problems</h3>
<p>It’s strange that it does not work ok with all fonts. Example page shows that when Calibri is used, images don’t always line up. In Safari, they don’t fully line up even for Helvetica Neue. They do line up for Verdana, Georgia, Arial. In Opera 9.5 Calibri example is the worst.<br />
Second problem is that in some cases, when larger font sizes are used, images again don’t line up.<br />
Amazingly, the only browser I didn’t have an issue with is IE, both 6 and 7.</p>
<p>I could not get to the bottom of this. If anyone have any ideas, please share. Inline box is a very complicated issue and I’m sure there’s something I’m missing.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/rounded-form-buttons/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>em-based typographic grid</title>
		<link>http://aplus.rs/css/em-based-typographic-grid/</link>
		<comments>http://aplus.rs/css/em-based-typographic-grid/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 21:54:47 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://aplus.co.yu/?p=328</guid>
		<description><![CDATA[I have recently concluded the re-design of my serbian blog. It presented itself as perfect opportunity to try out grid-based design. Unlike most of the ready-made grid systems like BluePrint ...]]></description>
			<content:encoded><![CDATA[<p>I have recently concluded the re-design of <a href="http://aleck.aplus.co.yu/">my serbian blog</a>. It presented itself as perfect opportunity to try out grid-based design. Unlike most of the ready-made grid systems like <a href="http://code.google.com/p/blueprintcss/">BluePrint</a> and <a href="http://960.gs/">960.gs</a> which are based on pixels (at least the examples I have seen) — <em>I wanted to base it all on ems</em>.</p>
<p>Another goal was to create as typographically good design as I could. It should follow the <a href="http://24ways.org/2006/compose-to-a-vertical-rhythm">vertical rhythm</a>, use the <a href="http://www.alistapart.com/articles/emen">appropriate characters</a> for given context and feature nice readable font faces.</p>
<div class="screenshot"><img src="/images/web/emgrid-typo.png" alt="Typographic examples" /></div>
<p>I have created <a href="/lab/emgrid/">demo page</a> that showcases all that nice typography. Another demo showcases <a href="/lab/emgrid/grid.html">some grid options</a>.<br />
<span id="more-328"></span></p>
<h3>Typography</h3>
<p>In the demo page I tried to include every little detail that shows how all this looks like. It will serve me as the reference point for markup and entity codes. However, I don’t claim any breakthrough stuff here — all this stands on the work of other people, neatly combined in one reusable package.</p>
<p>I took most styles and leads from <a href="http://jeffcroft.com/speaking/">Jeff Croft’s presentation</a> at Webmaster Jam Session and the excellent typography created by <a href="http://static.mintchaos.com/projects/typogrify/">tipogrify</a> engine, which is available as <a href="http://wordpress.org/extend/plugins/wp-typogrify/">WP plugin</a>.</p>
<p>I shamelessly copied <a href="http://daringfireball.net/2005/07/footnotes">John Gruber’s footnotes</a> — they’re simply wonderful, down to that lovely contour arrow for going back to the footnote link.</p>
<p>The rest of the lovely characters, like single and double quotes, en dash and em dash, elipsis — these I found through Peter Sheerin’s wonderful article <a href="http://www.alistapart.com/articles/emen">The Trouble With <span class="caps">EM</span> ’n <span class="caps">EN</span> (and Other Shady Characters)</a>, from A List Apart.<br />
This is where I read that old typographic styling of the blockquotes was that each paragraph was quoted at the beginning but only the last is quoted at the end.</p>
<p>Speaking of blockquotes, I have included <a href="http://www.456bereastreet.com/archive/200411/quotations_and_citations_quoting_text/">Roger Johansson’s work</a> — value of <code>cite</code> attribute is displayed below the quote. This was the most challenging part of the entire CSS and due to the use of advanced selectors and generated content IE6 and IE7 users will not see it properly.</p>
<h3>Grids</h3>
<p><a href="/lab/emgrid/grid.html">These</a> are not the only possible grids, you can do whatever you want, as long as you follow two simple rules:</p>
<ol>
<li>Basic grid unit is: default font-size * line-height.</li>
<li>Every block on the page must use margin, padding, width and height equal to a multiple of basic unit</li>
</ol>
<p>First rule sounds simple. In the <code>body</code> element, I defined that my leading (line-height) is 1.5, meaning that my basic grid block is 1.5em high and — for consistency sake — 1.5em wide.</p>
<p>There’s one caveat: if for any block on the page you change the font size, then you need to calculate its dimensions using new grid unit. Here’s one example, where I want ctop block to be 20 grid units wide (which would be 20*1.5em=30em):</p>
<div class="igBar"><span id="lcss-8"><a href="#" onclick="javascript:showPlainTxt('css-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-8">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.ctop </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">	<span style="color: #000000; font-weight: bold;">font-size</span>: <span style="color: #cc66cc;color:#800000;">1</span>.2em;</div>
</li>
<li style="color:#333;">
<div style="">	<span style="color: #000000; font-weight: bold;">width</span>: 25em; <span style="color: #808080; font-style: italic;">/* 1 / 1.2 * 30em = 25em  */</span></div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>Since I enlarged the font, I adjusted the width for that, so that I can easily align it with some other block in the grid which uses default font size.</p>
<p>With that in mind, you can do anything you want.</p>
<p>I also want to re-iterate what I already wrote on the grid demo page: make your life easier and use normal, descriptive names for the blocks. CSS frameworks try to standardize the block names, so that you can add the suffixes and calculate the final size. And then you end up with grid6, prefix2, span-6, append-2 and similar non-sensical names.<br />
After you built the layout, do you really need those classes? If yes, please write back — I would really like to know for what.</p>
<p>Me, I find them bloated. I draw the design on the piece of paper, write the sizes and spaces and then proceed to create a layout style with meaningful names like top, footer, main etc. <span class="caps" title="your mileage may vary">YMMV</span>, as usual.</p>
<h4>Forms</h4>
<p>Forms on your page will certainly destroy the vertical rhythm. You have no idea what are the exact sizes. Someone’s OS theme can vary this widely: it can have different base size, borders of this or that width, paddings…</p>
<p>The only way to fight this is to use <code>min-height</code>, also set in ems, also using grid unit multiples. I do this to control the comment form on my serbian blog.</p>
<h4>Borders</h4>
<p>The other thing that will dislocate your grid is border. For just about anything. Pixel guys have it easy here — they just subtract the border size from width and/or height and done. Here, things are a bit more complicated.</p>
<p>There are two solutions. One is to use negative margins:</p>
<div class="igBar"><span id="lcss-9"><a href="#" onclick="javascript:showPlainTxt('css-9'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-9">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.column </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">	<span style="color: #000000; font-weight: bold;">border-top</span>: 1px <span style="color: #993333;">solid</span> #999;</div>
</li>
<li style="color:#333;">
<div style="">	<span style="color: #000000; font-weight: bold;">margin-top</span>: -1px;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>This works if your column does not already have margin-top defined. If it does, this will not be applicable.</p>
<p>Even if it doesn’t, this will still not work if the previous element is floated, and this one is not. That’s the case on my typography demo page, where footer has top border and 2 columns before it are floated. In this case, your only option is this:</p>
<div class="igBar"><span id="lcss-10"><a href="#" onclick="javascript:showPlainTxt('css-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-10">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.footer </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">	<span style="color: #000000; font-weight: bold;">position</span>: <span style="color: #993333;">relative</span>;</div>
</li>
<li style="color:#333;">
<div style="">	<span style="color: #000000; font-weight: bold;">top</span>: -1px;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>I prefer to use the margin-top solution, whenever I can. Less problems in IE.</p>
<p>In any case, I do hope you like all this. I will certainly update this as required. Let me know if you use it or have anything to add.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/em-based-typographic-grid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE8 test: z-index problem is no more</title>
		<link>http://aplus.rs/css/ie8-test-z-index-problem-is-no-more/</link>
		<comments>http://aplus.rs/css/ie8-test-z-index-problem-is-no-more/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 11:39:16 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://aplus.co.yu/css/ie8-test-z-index-problem-is-no-more/</guid>
		<description><![CDATA[I have updated my z-index tutorial with tests in IE8 beta 1. There was nothing new to write as IE8 correctly passed all tests and rendered test cases according to ...]]></description>
			<content:encoded><![CDATA[<p>I have updated my <a href="/lab/z-pos/">z-index tutorial</a> with tests in IE8 beta 1. There was nothing new to write as <em>IE8 correctly passed all tests</em> and rendered test cases according to CSS2.1 spec. The horrible z-index scripting trickery I used to control complicated layouts (like on boylesports.com) will not be required in few years.</p>
<p>I took the opportunity to add some screenshots of reference rendering vs IE6/7 rendering, to make it easier on those just casually reading to see what the errors are (previously you needed to open the pages in IE6/7 to actually see what is wrong).</p>
<p>Additionally, IE8 also supports <code>:after</code>, which I use for float clearing.<br />
As it is, there will be no need for ie8.css hidden under conditional comments. Yipi! :)</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/ie8-test-z-index-problem-is-no-more/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE7 bug: will not render z-index change on li:hover</title>
		<link>http://aplus.rs/css/ie7-bug-will-not-render-z-index-change-on-lihover/</link>
		<comments>http://aplus.rs/css/ie7-bug-will-not-render-z-index-change-on-lihover/#comments</comments>
		<pubDate>Tue, 02 Jan 2007 18:24:25 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.aplus.co.yu/css/ie7-bug-will-not-render-z-index-change-on-lihover/</guid>
		<description><![CDATA[While working on latest version of ADxMenu styles, I encountered another ugly IE7 bug. PLAIN TEXT CSS: .menu li &#123; z-index: 5; &#125; .menu li:hover &#123; z-index: 10000; &#125; This ...]]></description>
			<content:encoded><![CDATA[<p>While working on latest version of <a href="/adxmenu/">ADxMenu</a> styles, I encountered another ugly IE7 bug.</p>
<div class="igBar"><span id="lcss-12"><a href="#" onclick="javascript:showPlainTxt('css-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-12">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #6666ff;">.menu </span>li <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">	<span style="color: #000000; font-weight: bold;">z-index</span>: <span style="color: #cc66cc;color:#800000;">5</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #6666ff;">.menu </span>li<span style="color: #3333ff;">:hover </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#333;">
<div style="">	<span style="color: #000000; font-weight: bold;">z-index</span>: <span style="color: #cc66cc;color:#800000;">10000</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>This does not work in IE7 — it will not re-render the page. Here’s the <a href="/css/ie7-lihoverzindex/">example showing this problem</a>.</p>
<p>update: David Hucklesby points to solution: IE needs a “nudge”, <a href="/css/ie7-lihoverzindex/fixed.html"><code>direction:ltr</code> works</a>. As well as a <a href="http://www.tanfa.co.uk/css/articles/pure-css-popups-bug.asp">lot of other rules</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/ie7-bug-will-not-render-z-index-change-on-lihover/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>By an inch…</title>
		<link>http://aplus.rs/css/by-an-inch/</link>
		<comments>http://aplus.rs/css/by-an-inch/#comments</comments>
		<pubDate>Fri, 15 Dec 2006 20:49:03 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.aplus.co.yu/css/by-an-inch/</guid>
		<description><![CDATA[Microsoft redesigns their web site. Visually very nice, follows the “a wide vista” theme as previous one (although I prefer this incarnation). The gem is under the hood. CSS-based all ...]]></description>
			<content:encoded><![CDATA[<p>Microsoft <a href="http://www.microsoft.com/">redesigns</a> their web site. Visually very nice, follows the “a wide vista” theme as previous one (although I prefer this incarnation).</p>
<p>The gem is under the hood. CSS-based all the way, most obvious by turning CSS off in your browser. Plus, only 5 errors coming from the validator.w3.org, for the HTML 4.0 Transitional. Much can be said on the quality of the code (way too many divs for starters) but really a nice step forward — they missed the validity perfection by only an inch.</p>
<p>The most important aspect — the site looks and works identical in Firefox, as in IE6. Now, that is huge and very welcome step forward for Microsoft.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/by-an-inch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Relaxed dead centre layout</title>
		<link>http://aplus.rs/css/relaxed-dead-centre-layout/</link>
		<comments>http://aplus.rs/css/relaxed-dead-centre-layout/#comments</comments>
		<pubDate>Thu, 16 Nov 2006 12:15:42 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.aplus.co.yu/css/relaxed-dead-centre-layout/</guid>
		<description><![CDATA[This post is more of a reminder for me than anything new, as I need this splash thing from time to time and never can remember where I keep it. ...]]></description>
			<content:encoded><![CDATA[<p>This post is more of a reminder for me than anything new, as I need <a href="/lab/rdc/">this splash thing</a> from time to time and never can remember where I keep it.</p>
<p>95% of code is from <a href="http://www.jakpsatweb.cz/css/css-vertical-center-solution.html">Dušan Janovský</a>. I merely simplified it, thus instead of 3 or 4 nested divs, you need just one div, for the actual content. <code>html</code> and <code>body</code> play the role of table and table-cell respectivelly. Pure semantics. :)<br />
For IE6 and IE7, I opted for the <a href="http://css-discuss.incutio.com/?page=CenteringBlockElement"><code>expression</code> property</a>, masked under conditional comments. No other solution I encountered is flexible enough.</p>
<p><a href="/lab/rdc/">This solution</a> has 100% of the available height to spread, because there is no fixed height set for the content div.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/relaxed-dead-centre-layout/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>IE7 bug 2: not defaulting left on abs. positioned elements to 0</title>
		<link>http://aplus.rs/css/ie7-bug-2-not-defaulting-left-on-abs-positioned-elements-to-0/</link>
		<comments>http://aplus.rs/css/ie7-bug-2-not-defaulting-left-on-abs-positioned-elements-to-0/#comments</comments>
		<pubDate>Mon, 30 Oct 2006 19:12:33 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.aplus.co.yu/css/ie7-bug-2-not-defaulting-left-on-abs-positioned-elements-to-0/</guid>
		<description><![CDATA[I’m not even sure this is a bug. IE5/Mac, IE6 and IE7 does it one way, Firefox, Opera, Safari another. Past experience on such things tells me this is a ...]]></description>
			<content:encoded><![CDATA[<p><em>I’m not even sure this is a bug.</em> IE5/Mac, IE6 and IE7 does it one way, Firefox, Opera, Safari another. Past experience on such things tells me this is a bug in IE, but it could also be that CSS spec is not specific enough on this issue and that browser makers chose different paths.</p>
<p>Anw, <a href="/css/ie7-posabsleft/">to the issue</a>. Imagine floated element followed by an element which is absolutelly positioned (AP) and have this style applied:</p>
<div class="igBar"><span id="lcss-14"><a href="#" onclick="javascript:showPlainTxt('css-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-14">
<pre class="css">
<ol>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">display</span>:<span style="color: #993333;">block</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">position</span>:<span style="color: #993333;">absolute</span>;</div>
</li>
<li style="color:#333;">
<div style=""><span style="color: #000000; font-weight: bold;">top</span>: <span style="color: #cc66cc;color:#800000;">0</span>;</div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #000000; font-weight: bold;">width</span>: 30em; </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>You see, no <code>left</code> rule. IE will position the left edge of the AP at the point where right edge of the floated element is:</p>
<div class="screenshot">
<img src="/css/ie7-posabsleft/ie.png" alt="IE rendering of the test case" />
</div>
<p>Opera/Gecko/KHTML will place it at the left:0 of the content area of the parent (which is what I would expect it to do):</p>
<div class="screenshot">
<img src="/css/ie7-posabsleft/gko.png" alt="Firefox/Safari/Opera rendering of the test case" />
</div>
<p>Applying <code>clear:both</code> to the AP element has no effect, things stays the same. I have seen this behavior in IE6 several times, but I keep forgetting it and it hunts me again along the way, when I least need it. This way, I will probably remember it. I hope some of you might find this useful too.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/ie7-bug-2-not-defaulting-left-on-abs-positioned-elements-to-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE7 float clearing</title>
		<link>http://aplus.rs/css/ie7-float-clearing/</link>
		<comments>http://aplus.rs/css/ie7-float-clearing/#comments</comments>
		<pubDate>Sat, 28 Oct 2006 22:04:05 +0000</pubDate>
		<dc:creator>Aleksandar</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.aplus.co.yu/css/ie7-float-clearing/</guid>
		<description><![CDATA[Remember this? PLAIN TEXT CSS: * html SELECTOR &#123; height: 1% &#125; This is one of the ways you can force IE6 to clear the floats in a container. And ...]]></description>
			<content:encoded><![CDATA[<p>Remember this?</p>
<div class="igBar"><span id="lcss-18"><a href="#" onclick="javascript:showPlainTxt('css-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-18">
<pre class="css">
<ol>
<li style="color:#333;">
<div style="">* html SELECTOR <span style="color: #66cc66;">&#123;</span> <span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #cc66cc;color:#800000;">1</span>% <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>This is one of the ways you can force IE6 to clear the floats in a container. And it partially works in IE7 too. The reason <code>height:1%</code> works is that IE7 internal engine is same as IE6, just with a lot less bugs in it. Why is float clearing a problem then? Because this part of the selector: <code>* html</code> does not work anymore — that bug is fixed.</p>
<p>However, IE7 <a href="/css/ie7-height1pct-floatclear/">still incorrectly</a> interprets <code>height:1%</code> rule and will <strong>automatically expand</strong> the height of the box in question if its floated content can’t fit. Thus, that trick is still a viable solution to float clearing, especially since IE7 does not support <code>:after</code> selector yet, thus the solution working in all other modern browsers is not usable:</p>
<div class="igBar"><span id="lcss-19"><a href="#" onclick="javascript:showPlainTxt('css-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-19">
<pre class="css">
<ol>
<li style="color:#333;">
<div style="">SELECTOR<span style="color: #3333ff;">:after </span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="color:#26536A;">
<div style="">	<span style="color: #000000; font-weight: bold;">content</span>: <span style="color: #ff0000;">"."</span>; </div>
</li>
<li style="color:#333;">
<div style="">	<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #cc66cc;color:#800000;">0</span>; </div>
</li>
<li style="color:#26536A;">
<div style="">	<span style="color: #000000; font-weight: bold;">display</span>: <span style="color: #993333;">block</span>; </div>
</li>
<li style="color:#333;">
<div style="">	<span style="color: #000000; font-weight: bold;">visibility</span>: <span style="color: #993333;">hidden</span>;</div>
</li>
<li style="color:#26536A;">
<div style="">	<span style="color: #000000; font-weight: bold;">overflow</span>: <span style="color: #993333;">hidden</span>;</div>
</li>
<li style="color:#333;">
<div style="">	<span style="color: #000000; font-weight: bold;">clear</span>: <span style="color: #993333;">both</span>; </div>
</li>
<li style="color:#26536A;">
<div style=""><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<h3>The way forward</h3>
<p>The <code>* html</code> will not match anything in IE7 and will have no effect at all. This also is an ugly hack: we use one IE bug applied through another IE bug. <em>Ugly.</em> Such hacks should be used only as last resort, when no other solutions are available. And IE has perfect solution available, called conditional comments.</p>
<p>Thus, using conditional comments the <code>height:1%</code> is still a fine solution for float clearing. However, <em>there is a better one</em>. IE7 now supports <code>min-height</code> rule (among others) and that rule also triggers the infamous <code>hasLayout</code> property in IE7 internal engine and thus <a href="http://www.456bereastreet.com/archive/200603/new_clearing_method_needed_for_ie7/#comment64">it is usable for float clear</a>.</p>
<div class="igBar"><span id="lcss-20"><a href="#" onclick="javascript:showPlainTxt('css-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CSS:</span>
<div id="css-20">
<pre class="css">
<ol>
<li style="color:#333;">
<div style="">SELECTOR <span style="color: #66cc66;">&#123;</span> min-<span style="color: #000000; font-weight: bold;">height</span>: <span style="color: #cc66cc;color:#800000;">0</span>; <span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</pre>
</div>
</div>
<p></p>
<p>This is simple to use (just put it at the start of your CSS file) and enumerate the elements which content should be cleared — the same list you use for IE6. And all is fine, because this can sit in your main .css file and no modern browser would choke on it.</p>
<p>IE7 has good enough support for the CSS2.1 that you should very rarely need to write IE7-only hacks, thus have little use for separate file containing IE7 tweaks. Actually, the float clear is <em>the only</em> thing I needed to change in all the sites I created in the last few years to make them working in IE7.<br />
What a welcome change.</p>
]]></content:encoded>
			<wfw:commentRss>http://aplus.rs/css/ie7-float-clearing/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)

Served from: aplus.rs @ 2012-05-21 22:02:47 -->
