<?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>Paul Bennett - User Interface Developer &#187; inline-block</title>
	<atom:link href="http://pmbennett.net/tag/inline-block/feed/" rel="self" type="application/rss+xml" />
	<link>http://pmbennett.net</link>
	<description></description>
	<lastBuildDate>Thu, 27 Oct 2011 15:10:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS display: inline-block &#8211; underused and underrated?</title>
		<link>http://pmbennett.net/2010/05/24/css-display-inline-block-underused-and-underrated/</link>
		<comments>http://pmbennett.net/2010/05/24/css-display-inline-block-underused-and-underrated/#comments</comments>
		<pubDate>Mon, 24 May 2010 13:55:30 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[inline-block]]></category>

		<guid isPermaLink="false">http://pmbennett.net/?p=366</guid>
		<description><![CDATA[<p>Before I continue, I must point out this this is neither new or revolutionary; but it amazed me that after 6 years of front-end devlopement, I had never used the CSS2 <code>display: inline-block</code> selector. It's usefulness has been pointed out <a href="http://robertnyman.com/2010/02/24/css-display-inline-block-why-it-rocks-and-why-it-sucks/">many times in the past</a>, but I still thought that it would be worthwhile documenting my usage of it.</p>]]></description>
			<content:encoded><![CDATA[<p>What I basically wanted to do was to add an icon after a heading, that would always line-up next to the last word, regardless of the amount to text. For various reasons I was using a <code>span</code> element, to which I applied Mike Rundle&#8217;s Phark image replacement technique. However, in order for the <code>span</code> to obey any dimensions, it caould not be displayed <code>inline</code>. I started to think about how I would achieve this, and all my solutions were fairly longwinded for what would appear to be a pretty trivial task: that&#8217;s when I remembered the <code>inline-block</code> selector! Using this allowed me to give the <code>span</code> the desired dimensions, whilst allowing it to line-up against the text.</p>
<p>Unfortunately, this doesn&#8217;t work in IE6+7 or Firefox 2. But fear not, these can be addressed (at the expense of a stylesheet that no longer validates). Here is the code:</p>
<pre><code>h3 span {
	width: 16px;
	height: 16px;
	overflow: hidden;
	text-indent: -9999em;
	background: url(/img/secure_lock_icon.png) no-repeat 0 0;
	display: -moz-inline-stack;	/* Get FF2 to play nicely */
        display: inline-block;	/* Modern browsers get this */
	vertical-align: top;

	/* these go in your IE specific stylesheet to make it play fairly as well */
	zoom: 1;
        display: inline;
}</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://pmbennett.net/2010/05/24/css-display-inline-block-underused-and-underrated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

