<?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>Citizensheep &#187; CSS</title>
	<atom:link href="http://citizensheep.com/blog/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://citizensheep.com/blog</link>
	<description>Michael Grimes lives in Birmingham (UK). This is his blog about anything that he fancies.</description>
	<lastBuildDate>Tue, 22 May 2012 05:53: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>Playing with CSS (IE7 fails, of course)</title>
		<link>http://citizensheep.com/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/</link>
		<comments>http://citizensheep.com/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 22:11:17 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[Citizenship & civic engagement]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[My professional life]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/?p=1256</guid>
		<description><![CDATA[I&#8217;ve been playing with CSS3, just for fun really. All of the styles I&#8217;ve used work in Safari; most of them work in Firefox and Opera; none of them work in Internet Explorer 7. For my test page I wanted: paragraphs with transparent coloured backgrounds layered over images; each image to be different; the boxes [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/11/redesign-again/" rel="bookmark">Website re-design: again</a><!-- (25.2)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2007/08/20/transparent-backgrounds-to-text/" rel="bookmark">Using CSS to add opaque text to transparent backgrounds</a><!-- (20.4)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/19/67/" rel="bookmark">Opera Web Standards Curriculum for the UK voluntary sector?</a><!-- (15.4)-->
							</li>
					</ol>
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with CSS3, just for fun really. All of the styles I&#8217;ve used work in Safari; most of them work in Firefox and Opera; none of them work in Internet Explorer 7.</p>
<p><a style="float:left; clear:left; margin-right:1em;" title="Playing with CSS: my test page" href="http://citizensheep.com/blog/wp-content/uploads/2009/03/css3_test1.jpg"><img title="css3_test" src="http://citizensheep.com/blog/wp-content/uploads/2009/03/css3_test1-300x285.jpg" alt="Screenshot showing this CSS3 test in Safari 3.0" width="266" /></a></p>
<p>For <a title="Playing with CSS: my test page" href="http://citizensheep.com/tests/css3/transparency.html">my test page</a> I wanted: paragraphs with transparent coloured backgrounds layered over images; each image to be different; the boxes to have rounded corners; the position of the paragraphs to alternate; the last paragraph to have no background image; the text of the heading at the top of the page to have a glow effect.</p>
<p>But I also wanted the html to be as clean and raw as possible, leaving the styling completely up to the css. I wanted to do without divs, classes and id tags, to see if I could get it to work without adding hooks into the markup. The html is simply an unordered list with a paragraph tag in each list item (I tried reproducing it here, but even using the &#8216;code&#8217; feature WordPress tries to render it: so I gave up).</p>
<p><a title="Playing with CSS: my test page" href="http://citizensheep.com/tests/css3/transparency.html">My test page</a> worked perfectly in Safari, gracefully in Firefox and Opera, and at the bare minimum in Internet Explorer 7.</p>
<h4>Transparent backgrounds</h4>
<p>For this I used the alpha transparency of RGBa; <a title="Adding transparent backgrounds to text" href="/blog/2007/08/20/transparent-backgrounds-to-text/">not opacity because, as I discovered before, that would apply to the text as well as the background</a>. RGBa is supported in the latest versions of Safari and Firefox (and in Opera 10, which is currently in beta). I had to include a hack to tell IE7 to add a background colour, otherwise the text was unreadable.</p>
<h4>Different images</h4>
<p>I wanted to keep these out of the html and include them as background images in the css. Of course I could have added a class to each list item, but that would have cluttered the html. I chose to use the &#8216;<code>+</code>&#8216; selector to define the image for each subsequent list item. This works in each of Safari, Opera and Firefox. It doesn&#8217;t work in IE7, so the same image appears in each list item.</p>
<h4>Rounded corners</h4>
<p>I used the proprietary <code>-moz-border-radius</code> and <code>-webkit-border-radius</code> styles (for Firefox and Safari respectively), because it&#8217;s a nice enhancement but doesn&#8217;t matter if they&#8217;re not there.</p>
<h4>Alternate positions</h4>
<p>I wanted the paragraphs of text to alternate between appearing on the left of the image and on the right. For this I used <code>nth-child</code> to style every other paragraph. This works in Safari and Opera.</p>
<h4>Styling the last paragraph</h4>
<p>I simply used <code>last-child</code> to style the last list item differently. This worked in Safari, Opera and Firefox; not in IE7.</p>
<h4>Text shadow</h4>
<p>I used <code>text-shadow</code> for this, setting the x and y positions to zero (ie directly behind the text) so that it appears to glow around the edges. Text shadow is supprted in Safari and Opera.</p>
<h4>Note</h4>
<p>I built this page as an em-based layout, so it&#8217;s scalable. However I was lazy with the images, so these are large and pulled directly from my Flickr account. Therefore they don&#8217;t scale; and they&#8217;re not optimised to load quickly, so they don&#8217;t.</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/11/redesign-again/" rel="bookmark">Website re-design: again</a><!-- (25.2)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2007/08/20/transparent-backgrounds-to-text/" rel="bookmark">Using CSS to add opaque text to transparent backgrounds</a><!-- (20.4)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/19/67/" rel="bookmark">Opera Web Standards Curriculum for the UK voluntary sector?</a><!-- (15.4)-->
							</li>
					</ol>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Redesign: typography</title>
		<link>http://citizensheep.com/blog/2008/08/11/redesign-typography/</link>
		<comments>http://citizensheep.com/blog/2008/08/11/redesign-typography/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 18:57:08 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[Redesign]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/2008/08/11/redesign-typography/</guid>
		<description><![CDATA[Right, I&#8217;m struggling a bit with this. My redesign is coming on: I&#8217;ve done the grid and the CSS seems to be working ok (in FireFox and Webkit at any rate). But I&#8217;m having a little trouble getting the text to align to the grid. I&#8217;ve tried working it out for myself because I was [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				
No related posts.
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>Right, I&#8217;m struggling a bit with this. My <a href="/blog/2008/08/11/redesign-again/" title="citizensheep.com redesign">redesign</a> is coming on: I&#8217;ve done the <a href="/blog/2008/08/11/redesign-grid/" title="Redesign: grid">grid</a> and the CSS seems to be working ok (in FireFox and Webkit at any rate). But I&#8217;m having a little trouble getting the text to align to the grid. I&#8217;ve tried working it out for myself because I was finding other people&#8217;s explanations confusing (the fault being my brain, not their explanations): I thought I&#8217;d cracked it but it seems I&#8217;m not quite there yet.<span id="more-64"></span></p>
<p>I&#8217;ve set <code>body {font-size;)</code> in absolute units and then used ems for all other measurements, which works well.</p>
<p>The difficulty is in getting text to align to a baseline. If I want to set an element to a different font size and then set its line-height, the line-height is <strong>calculated on the newly computed font size</strong>, and not on the size set in the <code>body</code> tag (I may be missing something important here though!).</p>
<p>For example, suppose we had these styles:</p>
<ul class="code">
<li>body {</li>
<li>font-size: 10pt;</li>
<li>}</li>
<li>li {</li>
<li>line-height: 3em;</li>
<li>}</li>
<li>p {</li>
<li>font-size: 2em;</li>
<li>line-height: 3em;</li>
<li>}</li>
</ul>
<p>The browser would render the <code>li</code> as 30 points high (3 x 10pt). But it would render the <code>p</code> as 60 points high because it is using the newly calculated <code>font-size</code> of 20pt (ie 2 x 10pt), and therefore <code>line-height</code> = 60pt (ie 3 x 20pt).</p>
<p>This makes life interesting if we want to set text to a baseline. What I&#8217;ve done so far is to presume a point size per em (10pt, in the  example above) and calculate the measurements from there.</p>
<p>For example, for <code>p</code> to be 30pt high:</p>
<ul class="code">
<li>p {</li>
<li>font-size: 2em;</li>
<li>line-height: 1.5em;</li>
<li>}</li>
</ul>
<p>ie <code>30pt / (10pt x 2) = 1.5</code>.</p>
<p>In other words, if:</p>
<ul>
<li>x = em measurement for desired <code>line-height</code></li>
<li>a = desired <code>line-height</code> (30pt in this example)</li>
<li>b = default <code>font-size</code> (10pt in this example)</li>
<li>c = current <code>font-size</code> in ems (2 in this example)</li>
</ul>
<p>then:</p>
<p><code>x = a/(b*c)</code>.</p>
<p>But, like I said, maybe I&#8217;m missing something.</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				<p>No related posts.</p>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2008/08/11/redesign-typography/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website re-design: again</title>
		<link>http://citizensheep.com/blog/2008/08/11/redesign-again/</link>
		<comments>http://citizensheep.com/blog/2008/08/11/redesign-again/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 01:32:51 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[Redesign]]></category>
		<category><![CDATA[redesign_200808]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/2008/08/11/redesign-again/</guid>
		<description><![CDATA[I&#8217;m having another go at redesigning this blog, this time based firmly on a modular em-based grid. I seem to have cracked baseline alignment and everything seems to be re-sizing pretty well. I can&#8217;t imagine it&#8217;ll work in IE (without a separate stylesheet) but it works fine in both the latest Mac versions of FireFox [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				
No related posts.
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m having another go at redesigning this blog, this time based firmly on a modular em-based grid.<span id="more-53"></span></p>
<p>I seem to have cracked baseline alignment and everything seems to be re-sizing pretty well. I can&#8217;t imagine it&#8217;ll work in IE (without a separate stylesheet) but it works fine in both the latest Mac versions of FireFox and Webkit (Safari nightlies).</p>
<p>It&#8217;s a simple design, but it might get more sophisticated if I can be bothered. It&#8217;s all done in CSS so very easy to add prettiness. It&#8217;ll probably change somewhat before it goes live anyway (for instance the image is just there for experimentation purposes and may well disappear).</p>
<p>All I have to do now is shoe-horn it into WordPress! <img src='http://citizensheep.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>If you&#8217;re really keen you can <a href="http://citizensheep.com/new_design/" title="Draft front page redesign">see the draft front page here</a> (use Firefox or Safari to guarantee seeing it properly). And If you&#8217;re lucky I might even put up my initial sketches at some point: bet you can&#8217;t wait.</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				<p>No related posts.</p>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2008/08/11/redesign-again/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS Eleven: I&#8217;m happier now</title>
		<link>http://citizensheep.com/blog/2007/11/21/css-eleven-im-happier-now/</link>
		<comments>http://citizensheep.com/blog/2007/11/21/css-eleven-im-happier-now/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 14:12:50 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/2007/11/21/css-eleven-im-happier-now/</guid>
		<description><![CDATA[It&#8217;s been a while, sorry. Last time I posted (aeons ago) I promised to do some testing for css3.info; oops. I am doing it, but as often happens it&#8217;s had to slide down my list of priorities. Having been a little wary of CSS Eleven back then, I have since been to a seminar day [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/" rel="bookmark">CSS Eleven: good idea, but there are a lot more than eleven of us using CSS</a><!-- (40)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2007/08/21/support-for-css3-modules/" rel="bookmark">Support for CSS3 modules?</a><!-- (21)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2010/07/18/web-designers-checklist/" rel="bookmark">Web Designer&#8217;s Checklist</a><!-- (12.9)-->
							</li>
					</ol>
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while, sorry. Last time I posted (aeons ago) <a href="/blog//2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/" title="CSS Eleven: good idea, but there are a lot more than eleven of us using CSS.">I promised to do some testing</a> for <a href="http://www.css3.info" title="css3.info: news and guides on the development of Cascading Style Sheets level 3.">css3.info</a>; oops. I <strong>am</strong> doing it, but as often happens it&#8217;s had to slide down my list of priorities.</p>
<p>Having been a little <a href="/blog/2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/" title="CSS Eleven: good idea, but there are a lot more than eleven of us using CSS.">wary of CSS Eleven</a> back then, I have since been to a seminar day led by <a href="http://www.stuffandnonsense.co.uk/company/about" title="Andy Clarke, Stuff and Nonsense website.">Andy Clarke</a>. Although he confirmed my concern that <a href="http://www.csseleven.com/" title="CSS Eleven: an international group of we developers and designers aiming to explain CSS as it's developed.">CSS Eleven</a> will be a closed group, he convinced me of the need for such a group to exist: with so many apparent holes in some of the CSS3 modules, it&#8217;s no bad thing for a group of respected practicioners to be lobbying the <a href="http://www.w3.org/Style/CSS/current-work" title="Cascading Style Sheets home page.">W3C&#8217;s CSS Working Group</a>.</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/" rel="bookmark">CSS Eleven: good idea, but there are a lot more than eleven of us using CSS</a><!-- (40)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2007/08/21/support-for-css3-modules/" rel="bookmark">Support for CSS3 modules?</a><!-- (21)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2010/07/18/web-designers-checklist/" rel="bookmark">Web Designer&#8217;s Checklist</a><!-- (12.9)-->
							</li>
					</ol>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2007/11/21/css-eleven-im-happier-now/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Eleven: good idea, but there are a lot more than eleven of us using CSS</title>
		<link>http://citizensheep.com/blog/2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/</link>
		<comments>http://citizensheep.com/blog/2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 08:05:47 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/</guid>
		<description><![CDATA[– an international group of eleven web developers and designers – intends to explain and illustrate the various CSS modules as they are developed. I&#8217;m not sure I like the sound of this. Their existing web page (which seems to keep going down) doesn&#8217;t give much away, but I would like to know if they [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2007/11/21/css-eleven-im-happier-now/" rel="bookmark">CSS Eleven: I&#8217;m happier now</a><!-- (33)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/11/redesign-again/" rel="bookmark">Website re-design: again</a><!-- (8.8)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/" rel="bookmark">Playing with CSS (IE7 fails, of course)</a><!-- (8.6)-->
							</li>
					</ol>
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.csseleven.com/" title="CSS Eleven: an international group of we developers and designers aiming to explain CSS as it's developed."><acronym="cascading>CSS Eleven</acronym="cascading></a> – an international group of eleven web developers and designers – intends to explain and illustrate the various <a href="http://www.w3.org/Style/CSS/Overview.html" title="Cascading Style Sheets home page.">CSS</a> modules as they are developed.<span id="more-38"></span></p>
<p>I&#8217;m not sure I like the sound of this. <a href="http://www.csseleven.com/" title="CSS Eleven: an international group of we developers and designers aiming to explain CSS as it's developed.">Their existing web page</a> (which seems to keep going down) doesn&#8217;t give much away, but I would like to know if they see themselves as a <acronym="cascading>CSS supergroup or if they intend to open their work to collaboration. Point one.</acronym="cascading></p>
<p>Point two. There&#8217;s some good work already being done out there: will CSS Eleven be duplicating that or building on it? I&#8217;m thinking in particular of <a href="http://www.css3.info" title="Informtaion on the development of Cascading Stylesheets level three.">css3.info</a>, which is a really good resource (it could be even better if it was able to build up the collection of compatibility tables on its <a href="http://www.css3.info/modules/" title="A table of all the CSS3 modules and their current status (css3.info).">module status</a> page).</p>
<p>I&#8217;m curious to see how the work of <a href="http://www.csseleven.com/" title="CSS Eleven: an international group of we developers and designers aiming to explain CSS as it's developed.">CSS Eleven</a> develops.</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2007/11/21/css-eleven-im-happier-now/" rel="bookmark">CSS Eleven: I&#8217;m happier now</a><!-- (33)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/11/redesign-again/" rel="bookmark">Website re-design: again</a><!-- (8.8)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/" rel="bookmark">Playing with CSS (IE7 fails, of course)</a><!-- (8.6)-->
							</li>
					</ol>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2007/10/09/css-eleven-good-idea-but-there-are-a-lot-more-than-eleven-of-us-using-css/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Arghh! I hate web design!</title>
		<link>http://citizensheep.com/blog/2007/09/12/arghh-i-hate-web-design/</link>
		<comments>http://citizensheep.com/blog/2007/09/12/arghh-i-hate-web-design/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 17:17:26 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web design & development]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/?p=33</guid>
		<description><![CDATA[Bloody Explorer! Bloody quirks mode! Bloody bloody! Grr! There, I feel a bit better. I guess it&#8217;s not really IE&#8217;s fault that it&#8217;s the only browser in which my three-column css-styled layout doesn&#8217;t work. Actually, yes it is. It ought to work in quirks mode and doesn&#8217;t—that&#8217;s likely my fault—but I shouldn&#8217;t have to rely [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				
No related posts.
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>Bloody Explorer! Bloody quirks mode! Bloody bloody! Grr!</p>
<p>There, I feel a bit better. I guess it&#8217;s not really IE&#8217;s fault that it&#8217;s the only browser in which my three-column css-styled layout <strong>doesn&#8217;t work</strong>.</p>
<p>Actually, yes it is. It ought to work in quirks mode and doesn&#8217;t—that&#8217;s likely my fault—but I shouldn&#8217;t have to rely on quirks mode in the first place.</p>
<p>If you&#8217;re reading this post and not understanding a word of it, I envy you.</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				<p>No related posts.</p>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2007/09/12/arghh-i-hate-web-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS ‘sliding doors’: positioning the tabs</title>
		<link>http://citizensheep.com/blog/2007/09/10/css-sliding-doors-positioning-the-tabs/</link>
		<comments>http://citizensheep.com/blog/2007/09/10/css-sliding-doors-positioning-the-tabs/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 19:29:34 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/?p=31</guid>
		<description><![CDATA[A lot has been written on styling html lists to make them look pretty, a good example being Douglas Bowman&#8217;s &#8216;Sliding Doors&#8216; articles on alistapart.com. However, I&#8217;ve still not managed to master it. Either I have problems with floated elements or IE doesn&#8217;t style the tabs properly (IE6, at any rate). I finally got it [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2007/08/20/transparent-backgrounds-to-text/" rel="bookmark">Using CSS to add opaque text to transparent backgrounds</a><!-- (27.4)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2009/01/04/bookmarks-for-3-january-2009-from-2108-to-2352/" rel="bookmark">Bookmarks for 3 January 2009 from 21:08 to 23:52</a><!-- (14)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2009/09/30/web-design-dashboard/" rel="bookmark">Web Design Dashboard</a><!-- (13.4)-->
							</li>
					</ol>
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>A lot has been written on styling html lists to make them look pretty, a good example being Douglas Bowman&#8217;s &#8216;<a href="http://www.alistapart.com/articles/slidingdoors/" title="'Sliding Doors of CSS'.">Sliding Doors</a>&#8216; articles on alistapart.com.</p>
<p>However, I&#8217;ve still not managed to master it. Either I have problems with floated elements or IE doesn&#8217;t style the tabs properly (IE6, at any rate).</p>
<p>I finally got it to work across browsers the other day, and promptly deleted the files (by accident). I shall try to recreate it and post the results here. In the meantime, here&#8217;s what I (think) I did.<span id="more-31"></span></p>
<p><strong>Float issues</strong></p>
<p>Block elements that should have come below the tabs were sitting to the right of them instead.</p>
<p>I think this was solved by setting an element to <code>display:block</code> – and I think that element was <code>a</code> – but I&#8217;ll post more when I&#8217;ve tried again.</p>
<p><strong>IE style issues</strong></p>
<p>IE6 was losing the top border off the tabs, and apparently adding a bottom margin.</p>
<p>It seems that relative positioning was the answer here. While the list&#8217;s containing <code>div</code> was absolutely positioned, IE stubbornly refused to play ball; as soon as I positioned it relatively, IE stopped sulking.</p>
<ol>
<li>Created <code>div#header</code> with its height in pixels (in which I would put such things as blog title and the navigation tabs) and set this to <code>position:relative</code>;</li>
<li> Set the list&#8217;s containing <code>div</code> to <code>position:relative</code>, and set top to force it into its preferred position;</li>
<li>Everything else in <code>div#header</code> was positioned absolutely, so as not to interfere with the flow of the document.</li>
</ol>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2007/08/20/transparent-backgrounds-to-text/" rel="bookmark">Using CSS to add opaque text to transparent backgrounds</a><!-- (27.4)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2009/01/04/bookmarks-for-3-january-2009-from-2108-to-2352/" rel="bookmark">Bookmarks for 3 January 2009 from 21:08 to 23:52</a><!-- (14)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2009/09/30/web-design-dashboard/" rel="bookmark">Web Design Dashboard</a><!-- (13.4)-->
							</li>
					</ol>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2007/09/10/css-sliding-doors-positioning-the-tabs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Support for CSS3 modules?</title>
		<link>http://citizensheep.com/blog/2007/08/21/support-for-css3-modules/</link>
		<comments>http://citizensheep.com/blog/2007/08/21/support-for-css3-modules/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 16:57:42 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web design & development]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/?p=28</guid>
		<description><![CDATA[In case anyone stumbles across this post, I&#8217;m looking for a resource that shows which CSS3 modules are supported in which browsers. ccc3.info has started this, but so far they only have a compatibility table for selectors. (They also have a neat online tool for testing which selectors your browser supports.) Possibly related posts No [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				
No related posts.
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>In case anyone stumbles across this post, I&#8217;m looking for a resource that shows which <a href="http://www.w3.org/TR/css3-roadmap/" title="Introduction to CSS3 (W3C).">CSS3 modules</a> are supported in which browsers. <a href="http://www.css3.info" title="CSS3.info website."></a></p>
<p><a href="http://www.css3.info/modules/" title="CSS3  modules status (CSS3.info).">ccc3.info</a> has started this, but so far they only have a compatibility table for <a href="http://www.css3.info/modules/selector-compat" title="CSS3 selectors compatibility (css3.info).">selectors</a>. (They also have a neat <a href="http://www.css3.info/selectors-test/" title="CSS3 selectors test.">online tool for testing which selectors your browser supports</a>.)</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				<p>No related posts.</p>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2007/08/21/support-for-css3-modules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CSS to add opaque text to transparent backgrounds</title>
		<link>http://citizensheep.com/blog/2007/08/20/transparent-backgrounds-to-text/</link>
		<comments>http://citizensheep.com/blog/2007/08/20/transparent-backgrounds-to-text/#comments</comments>
		<pubDate>Mon, 20 Aug 2007 18:21:59 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[Voluntary Sector]]></category>
		<category><![CDATA[webdesign]]></category>

		<guid isPermaLink="false">http://citizensheep.com/blog/?p=23</guid>
		<description><![CDATA[CSS doesn&#8217;t currently allow for an element to have a transparent background with opaque text: the text will also be transparent. On top of that, any child elements will inherit the transparency. But there are ways… I&#8217;ve just redesigned this blog (come on, it could be worse), and I wanted the title to sit in [...]<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/" rel="bookmark">Playing with CSS (IE7 fails, of course)</a><!-- (32.2)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2007/09/10/css-sliding-doors-positioning-the-tabs/" rel="bookmark">CSS ‘sliding doors’: positioning the tabs</a><!-- (18)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/11/redesign-typography/" rel="bookmark">Redesign: typography</a><!-- (8.3)-->
							</li>
					</ol>
			</li>
	</ul>]]></description>
			<content:encoded><![CDATA[<p>CSS doesn&#8217;t currently allow for an element to have a transparent background with opaque text: the text will also be transparent. On top of that, any child elements will inherit the transparency. But there are ways…</p>
<p>I&#8217;ve just redesigned this blog (come on, it could be worse), and I wanted the title to sit in a box on top of the image, and for the image to show through the background of the box; thus:</p>
<p><a title="Image showing transparent background to opaque text." href="http://citizensheep.com/blog/wp-content/uploads/2007/08/example_transpdivs.jpg"><img src="http://citizensheep.com/blog/wp-content/uploads/2007/08/example_transpdivs.jpg" alt="Image showing transparent background to opaque text." /></a></p>
<p>I did this using css positioning:</p>
<ol>
<li> I put the image in a div, and absolutely positioned the div at the top of the page;</li>
<li>I then created two identical versions of the title box, and absolutely positioned one over the top of the other:</li>
<li>the top one (<em>title</em>) has the text, with no opacity set;</li>
<li>the bottom one (<em>titleBox</em>) has a background colour with the opacity set to a degree of transparency; the text is also in this div, to ensure the box size matches that of the upper div. The text is hidden behind that of the upper div.</li>
</ol>
<p>However, what if I also wanted to add another div below these? At the moment it would have to be positioned absolutely, meaning that any resizing of the text could upset the flow of the document. My solution was:</p>
<ol>
<li>Put both divs into one new div (<em>topRight</em>);</li>
<li>Div <em>titleBox</em> comes first (though I guess it doesn&#8217;t matter if you add a z-index), with the default relative positioning;</li>
<li>Div <em>title</em> come next, positioned absolutely at the top (ie of div <em>topRight</em>).</li>
</ol>
<p>Now any new content will flow as expected, relative to the div <em>titleBox</em>.</p>
<p>Here&#8217;s the css (trimmed down for the sake of clarity):</p>
<ul class="code">
<li>#topRight {</li>
<li>position:absolute;</li>
<li>top:30px;</li>
<li>right:0;</li>
<li>}</li>
</ul>
<ul class="code">
<li>#title, #titleBox {</li>
<li>margin:0;</li>
<li>padding:10px;</li>
<li>}</li>
</ul>
<ul class="code">
<li>#titleBox {</li>
<li>opacity:0.2;</li>
<li>color:#fff;</li>
<li>}</li>
</ul>
<ul class="code">
<li>#title {</li>
<li>background:none;</li>
<li>z-index:1;</li>
<li>position:absolute;</li>
<li>top:0;</li>
<li>}</li>
</ul>
<p>Opacity appears to be supported by most browsers now (with the usual notable exception of Internet Explorer), though I haven&#8217;t tested extensively. I have also since added <a title="CSS3 info: border-radius." href="http://www.css3.info/preview/rounded-border.html">rounded corners</a>, but these are only visible in Firefox and Safari (using proprietary tags, while the rest of the browsers catch up).</p>
<h4>Update (March 2009)</h4>
<p>There is now growing support for RGBa, which enables the addition of alpha transparency to a colour. Whereas opacity applies to all contents of an element, RGBa can apply just to the background and not the text.</p>
<p>So far browsers support the following, which would give a paragraph a red background:</p>
<ul class="code">
<li>p {</li>
<li>background-color: rgb(255, 0, 0);</li>
<li>}</li>
</ul>
<p>With opacity the paragraph&#8217;s background would be transparent but so would the text it contains:</p>
<ul class="code">
<li>p {</li>
<li>background-color: rgb(255, 0, 0);</li>
<li>opacity: 0.5;</li>
<li>}</li>
</ul>
<p>(<strong>Note:</strong> Internet Explorer would require <code>filter: alpha(opacity=50)</code>.)</p>
<p>With rgba we can give the paragraph a 50% transparent background, leaving the text unaltered and allowing anything behind to show through:</p>
<ul class="code">
<li>p {</li>
<li>background-color: rgba(255, 0, 0, 0.5);</li>
<li>}</li>
</ul>
<p>You can also see where <a title="'Playing with CSS...': experiments with css, including RGBa." href="/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/">I&#8217;ve begun playing with rgba</a>.</p>
<ul id="related_posts">
			<li>
					<h4>Possibly related posts</h4>
				 <ol>
								<li>
									<a href="http://citizensheep.com/blog/2009/03/23/playing-with-css3-ie7-fails-of-course/" rel="bookmark">Playing with CSS (IE7 fails, of course)</a><!-- (32.2)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2007/09/10/css-sliding-doors-positioning-the-tabs/" rel="bookmark">CSS ‘sliding doors’: positioning the tabs</a><!-- (18)-->
							</li>
								<li>
									<a href="http://citizensheep.com/blog/2008/08/11/redesign-typography/" rel="bookmark">Redesign: typography</a><!-- (8.3)-->
							</li>
					</ol>
			</li>
	</ul>]]></content:encoded>
			<wfw:commentRss>http://citizensheep.com/blog/2007/08/20/transparent-backgrounds-to-text/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

