<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.1" -->
<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/"
	>

<channel>
	<title>Mo Jebus &#187; CSS</title>
	<link>http://moronicbajebus.com</link>
	<description>Banana Ice Cream!</description>
	<pubDate>Wed, 06 Aug 2008 14:30:29 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>
	<language>en</language>
			<item>
		<title>Update on the Mojebus redesign</title>
		<link>http://moronicbajebus.com/2008/07/07/update-on-the-mojebus-redesign/</link>
		<comments>http://moronicbajebus.com/2008/07/07/update-on-the-mojebus-redesign/#comments</comments>
		<pubDate>Tue, 08 Jul 2008 00:04:44 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[Site]]></category>

		<category><![CDATA[Sketchbook]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<category><![CDATA[Rant]]></category>

		<category><![CDATA[MoJebus]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/2008/07/07/update-on-the-mojebus-redesign/</guid>
		<description><![CDATA[Read the previous post for better insight. I will not make you wait so check out the latest update. 
There are three relative minor updates.  I have fleshed out the text styling by adding list styles. I have adding extra white space between content and comments which causes the comments to move off my [...]]]></description>
			<content:encoded><![CDATA[<p>Read the <a href="/2008/06/28/the-start-of-mojebus-redesign/">previous post</a> for better insight. I will not make you wait so <a href="/wordpress/wp-content/files/mojebus-2008-2/">check out the latest update</a>. </p>
<p>There are three relative minor updates.  I have fleshed out the text styling by adding list styles. I have adding extra white space between content and comments which causes the comments to move off my laptop screen. I added a comment form.</p>
<p>Now, there is one major update. Scroll all the way down to the bottom. I have started to work out the rethought and improved advanced browse/search (if you think of a better name tell me). The current design has a browse and search which you can toggle open. Shortly after creating it, I saw many issues with it&mdash;oh well. This is a second take on it. It is a mashup of a search and browse by category. The x-axis is for search relevancy and the y-axis is how many categories the result is in.</p>
<p>I am really happy for the CSS <a href="http://developer.mozilla.org/en/docs/CSS:display">display inline-block</a>. It does so many little things I need. For instant, I used it for the post links in the search/browse at the bottom of the page. I can have the links be compact so two can be on one line but it also prevents the links from creating a messing line wrapping which breaks the bubble feeling.</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2008/07/07/update-on-the-mojebus-redesign/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Now I am excited</title>
		<link>http://moronicbajebus.com/2008/06/03/now-i-am-excited/</link>
		<comments>http://moronicbajebus.com/2008/06/03/now-i-am-excited/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 03:16:02 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<category><![CDATA[Web Design]]></category>

		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/2008/06/03/now-i-am-excited/</guid>
		<description><![CDATA[I am a dork for getting so excited after reading a short blog post from David Baron. A bunch of nice selectors have been landed in the branch of Mozilla. They are  :nth-child(), :nth-last-child(), :nth-of-type(),  :nth-last-of-type() :first-of-type, :last-of-type, and :only-of-type.
]]></description>
			<content:encoded><![CDATA[<p>I am a dork for getting so excited after reading a <a href="http://dbaron.org/log/20080603-new-selectors">short blog post</a> from David Baron. A bunch of nice selectors have been landed in the branch of Mozilla. They are  <a href="http://reference.sitepoint.com/css/pseudoclass-nthchild">:nth-child()</a>, <a href="http://reference.sitepoint.com/css/pseudoclass-nthlastchild">:nth-last-child()</a>, <a href="http://reference.sitepoint.com/css/pseudoclass-nthoftype">:nth-of-type()</a>,  <a href="http://reference.sitepoint.com/css/pseudoclass-nthlastoftype">:nth-last-of-type()</a> <a href="http://reference.sitepoint.com/css/pseudoclass-firstoftype">:first-of-type</a>, <a href="http://reference.sitepoint.com/css/pseudoclass-lastoftype">:last-of-type</a>, and <a href="http://reference.sitepoint.com/css/pseudoclass-onlyoftype">:only-of-type</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2008/06/03/now-i-am-excited/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Playfully Positioning</title>
		<link>http://moronicbajebus.com/2006/08/08/playfully-positioning/</link>
		<comments>http://moronicbajebus.com/2006/08/08/playfully-positioning/#comments</comments>
		<pubDate>Tue, 08 Aug 2006 05:17:05 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/?p=95</guid>
		<description><![CDATA[Play first and then read. Or,  read first and then play. Or, read while you play. Or, just play.
Since you are reading now, allow me to illustrate why you must play and not just read:
&#147How do I make my text red and uppercase with style sheets?&#8221;
&#147Simple, color: red and text-transform: uppercase.&#8221;
&#147Wow, that sure is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/wordpress/wp-content/files/playfully-positioning/">Play</a> first and then <a href="#playfully-positioning-reading">read</a>. Or,  <a href="playfully-positioning-reading">read</a> first and then <a href="/wordpress/wp-content/files/playfully-positioning/">play</a>. Or, <a href="#playfully-positioning-reading">read</a> while you <a href="/wordpress/wp-content/files/playfully-positioning/">play</a>. Or, just <a href="/wordpress/wp-content/files/playfully-positioning/">play</a>.</p>
<p id="playfully-positioning-reading">Since you are reading now, allow me to illustrate why you must <a href="/wordpress/wp-content/files/playfully-positioning/">play</a> and not just read:</p>
<blockquote><p>&#147How do I make my text red and uppercase with style sheets?&#8221;<br />
&#147Simple, <code>color: red</code> and <code>text-transform: uppercase</code>.&#8221;<br />
&#147Wow, that sure is simple to grasp,&#8221; said with a smile.<br />
&#147Sure is simple to explain,&#8221; happily accented with a thumbs-up.</p>
</blockquote>
<p>Ahh, such a dandy conversation. Which leads to a conversation about positioning, will this be as dandy as fruit pie?</p>
<blockquote><p>&#8220;How do I position my content to be up 26 pixels underneath my navigation?&#8221;<br />
&#8220;Try this: First, set your navigation to <code>position: relative</code> and <code>z-index: 2</code>. Next, set your content to <code>position: relative</code> and <code>top: -26px</code>&#8221;<br />
&#8220;Umm, that is not quite what I want&#8230; &#8230;Ok now it does what I want, but why?&#8230; &#8230;My head hurts,&#8221; said after forking the last bite of fruit pie.<br />
&#8220;Yeah. Understandably,&#8221; while looking regrettable at the now vanished fruit pie.</p>
</blockquote>
<p>As illustrated (in an over simplified manner), I find myself unable to explain all the nuances of CSS positioning to friends. Understandable, it is hard to absorb <code>float</code>, <code>clear</code>, <code>position</code> ,<code>margin</code>, <code>padding</code>, <code>top</code>, <code>bottom</code>, <code>right</code>, <code>left</code>, <code>z-index</code>, <code>height</code>, <code>width</code>, etc. I happened through the years to teach myself CSS by doing and then (a) achieving the desire results, (b) failing absolutely and then searching for information, or (c) noticing a behavior unbeknown to me and then reading up on it.  </p>
<p>To incubate something of a similar learning environment, I created Playfully Positioning. It is an individual-exploration of how six important CSS positioning rules behave and interact with each other: <a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position">position</a>, <a href="http://www.w3.org/TR/CSS21/visuren.html#z-index">z-index</a>, <a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-top">top</a>, <a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-right">right</a>, <a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-bottom">bottom</a>, and <a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-left">left</a>. </p>
<p>If you want a little guidance, below I give a brief run-down of the basics of the rules.</p>
<h2>position: static</h2>
<p>Most people do not use <code>position: static</code> explicitly because it is the default when no position rule is provided. The rules top, right, bottom, and left have no effect.</p>
<h2>position: relative</h2>
<p>If you want to adjust the position of a box based on its original position in the layout flow, <code>position: relative</code> is your piece of pie.  The rules top, right, bottom, and left move the box from it&#8217;s original place in the layout flow and <strong>its original displacement in the flow still exist</strong>. For example, <code>top: 40px</code> will move the box 40 pixels down from its original place and overlap anything in the 40 pixels below the original position of the box and still leave a 40px gap above the box. </p>
<h2>position: absolute</h2>
<p>Want to disregard the layout flow, <code>position: absolute</code> could be your ticket. It will take the box out of the layout flow which means no big hole (displacement) in the flow.  Watch out for the double personality of the rules top, right, bottom, and left.  The rules say how far the edge (lets say top) of a box is from the same edge (again top edge) of the box&#8217;s containing box. Now this leads to the double personality. If the box has an ancestor (a box with which it is inside of) that is positioned relative, absolute, or fixed, the ancestor is the containing box. But if no ancestor is positioned relative, absolute, or fixed, then the containing box is the top-left corner of the page with the same dimensions of the view-port&mdash;<strong>not the page</strong>. Just try it out because it is much simpler than it sounds.</p>
<h2>position: fixed</h2>
<p>Ooo&#8217;s and awww&#8217;s come from <code>position: fixed</code>. It will take the box out of the layout flow (just like absolute) and then do a neat trick&mdash;not move when you scroll.  As with the absolute, the rules top, right, bottom, and left are from the edge of the box to the edge of the box&#8217;s containing box. But, the difference is the containing box is the view-port. (I am not positive about containing box always being the view-port in regard to the <a href="http://www.w3.org/TR/CSS21/visuren.html#propdef-position">specs</a>, &#8220;[t]he box&#8217;s position is calculated according to the &#8216;absolute&#8217; model[&#8230; ]&#8221;.) For example, <code>top: 30px</code> places the 30 pixels from the top of the <a href="http://www.w3.org/TR/CSS21/visuren.html#viewport">view-port</a> (the area of the page you can actually see in the window).</p>
<h2>z-index</h2>
<p>Yes, z-index gives you layers but not Photoshop layers. A layer belongs to a <a href="http://www.w3.org/TR/CSS21/visuren.html#z-index">stacking-context</a>.  A layer is above other layers (in a stacking-context) if it has a higher z-index or the later one if the two have the same z-index. A stacking-context is either the body or any box that is positioned absolute, relative, or fixed.  Which means, a layer in a stacking-context can be another stacking-context. To go along with it, <strong>seperate stacking-contexts cannot be in between each other&#8217;s layers</strong>. Huh? For example, lets say you have a stacking context X with layers A and B and you have a stacking context Y with layers M and N.  Either all the layers in X have to be below the layers in Y or vice versa. Remember, X and Y are just layers inside another stacking-context. Lets give them all z-index value: (X, 5), (Y, 1), (A, 0), (B, 10), (M, 1), (N, 100). The result order of layers from bottom to top: M, N, A, B.  I suggest you play around with this and read through the <a href="http://www.w3.org/TR/CSS21/visuren.html#z-index">specs</a> slowly.</p>
<p>Now if you haven&#8217;t played with <a href="/wordpress/wp-content/files/playfully-positioning/">Playfully Positioning</a>, do so.</p>
<h2>Additional Resources</h2>
<ul>
<li><a href="http://www.w3.org/TR/CSS21/visuren.html">W3C: Visual formatting model</a></li>
<li><a href="http://www.safaribears.de/content.php?page=csstutorial&#038;chap=8">Safari Bears: CSS Tutorial - Positioning</a></li>
<li><a href="http://www.miswebdesign.com/resources/articles/css-positioning-properties.html">MIS Web Design: CSS Positioning Properties</a></li>
<li><a href="http://www.informit.com/articles/article.asp?p=170513&#038;seqNum=2&#038;rl=1">Integrated Web Design: Position This! CSS Positioning Demystified</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2006/08/08/playfully-positioning/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Add A Class Randomly From a Set</title>
		<link>http://moronicbajebus.com/2006/07/30/add-a-class-randomly-from-a-set/</link>
		<comments>http://moronicbajebus.com/2006/07/30/add-a-class-randomly-from-a-set/#comments</comments>
		<pubDate>Sun, 30 Jul 2006 21:11:25 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/?p=94</guid>
		<description><![CDATA[I was recently asked by a friend for information about how to have a random background image. Well not completely random, the background image should be from a set of images.  My idea: add a class, randomly from a set, to the body (or another element) with Javascript. I could just change the style [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently asked by a friend for information about how to have a random background image. Well not completely random, the background image should be from a set of images.  My idea: add a class, randomly from a set, to the body (or another element) with Javascript. I could just change the style attribute for the background image; but, what if the text is white and one of the images happens to be very light in color? So now I have the issue of ensure that there is adequate contrast in color between the background and text.  Plus there could always be other wishes such as being able to change the border color.  So, for me, changing the class gives far greater flexibility for a script. Now I show you my very <a href="/wordpress/wp-content/files/add-a-class-randomly-from-a-set/randomClassName.html">simple example of the code</a>.</p>
<h2>How to use:</h2>
<ol>
<li>Download <a href="http://jquery.com/">JQuery</a></li>
<li>Download <a href="/wordpress/wp-content/files/add-a-class-randomly-from-a-set/AddAClassNameAtRandomToAnElement.js">AddAClassNameAtRandomToAnElement.js</a></li>
<li>Include jquery.js and AddAClassNameAtRandomToAnElement.js in your html: <br />
           <code>&lt;script src=&#34;jquery.js&#34;>&lt;/script><br />
&lt;script src=&#34;AddAClassNameAtRandomToAnElement.js&#34;></code></li>
<li>Create the set of classes to have randomly selected and the query of the element to add the class to: <br />
<code>&lt;script> <br />
var setOfRandomClassNames = new Array(&#34;aa&#34;, &#34;bb&#34;, &#34;cc&#34;); // three classes with the names: aa, bb, and cc<br />
 //var queryForElementsToAddRandomClassTo = &#34;body&#34;; // adds the class name to the body <br />
 var queryForElementsToAddRandomClassTo = &#34;#cow&#34;; // adds the class name to an element with the id of cow<br />
&#8230;</code></li>
<li>Add the call to add the class:<br />
<code>&#8230;<br />$(document).ready(function(){ <br />
&nbsp; &nbsp;$(queryForElementsToAddRandomClassTo).addRandomClass(setOfRandomClassNames);}<br />
});<br />
&#8230;&lt;/script></code></li>
</ol>
<h2>Update</h2>
<p>I changed it from an independent function to a method (<a href="http://jquery.com/docs/Plugin/">JQuery Plugin</a>) of the $ as <a href="/2006/07/30/add-a-class-randomly-from-a-set/#comment-482">John Resig suggested</a>.  Keep up the good work on JQuery John!</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2006/07/30/add-a-class-randomly-from-a-set/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS Styled Forms</title>
		<link>http://moronicbajebus.com/2006/06/14/css-styled-forms/</link>
		<comments>http://moronicbajebus.com/2006/06/14/css-styled-forms/#comments</comments>
		<pubDate>Wed, 14 Jun 2006 22:42:07 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/2006/06/14/css-styled-forms/</guid>
		<description><![CDATA[Elegance of CSS code, make your checkboxes and radio buttons match your theme without Javascript.
]]></description>
			<content:encoded><![CDATA[<p>Elegance of CSS code, make your <a href="http://pdatabase.dyndns.biz/tutorial02.php">checkboxes and radio buttons match your theme</a> without Javascript.</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2006/06/14/css-styled-forms/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Windows XP CSS</title>
		<link>http://moronicbajebus.com/2006/04/15/windows-xp-css/</link>
		<comments>http://moronicbajebus.com/2006/04/15/windows-xp-css/#comments</comments>
		<pubDate>Sun, 16 Apr 2006 03:28:55 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/2006/04/15/windows-xp-css/</guid>
		<description><![CDATA[Magic Sandwich has a humorous use for CSS menus with a bit of styling to create a CSS Start menu.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.magic-sandwich.co.uk/">Magic Sandwich</a> has a <a href="http://www.magic-sandwich.co.uk/windowshome.html">humorous use for CSS menus</a> with a bit of styling to create a CSS Start menu.</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2006/04/15/windows-xp-css/feed/</wfw:commentRss>
		</item>
		<item>
		<title>IE7B Float Box Clip Bug</title>
		<link>http://moronicbajebus.com/2006/02/04/ie7b-float-box-clip-bug/</link>
		<comments>http://moronicbajebus.com/2006/02/04/ie7b-float-box-clip-bug/#comments</comments>
		<pubDate>Sat, 04 Feb 2006 16:00:56 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[Browsers]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/2006/02/04/ie7b-float-box-clip-bug/</guid>
		<description><![CDATA[With the release of IE7 beta, I tested my new site in it. I found that it did an almost perfect job. The most noticeable problem was that the header for the page was getting clipped about half way down. I reduced it to a simple problem with negative margins and floating.  I had [...]]]></description>
			<content:encoded><![CDATA[<p>With the release of IE7 beta, I tested my new site in it. I found that it did an almost perfect job. The most noticeable problem was that the <a href="http://www.moronicbajebus.com/wordpress/wp-content/files/ie7-float-text-bug/">header for the page was getting clipped about half way down</a>. I reduced it to a simple problem with negative margins and floating.  I had my <code>h1</code> inside my content and clipping was caused by the content floating with the <code>h1</code> having negative margins to push it outside the box of the float.  The clipping does not occur when using a different (and more appropriate method) such as <code>relative</code> positioning and using <code>top</code> and <code>left</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2006/02/04/ie7b-float-box-clip-bug/feed/</wfw:commentRss>
		</item>
		<item>
		<title>CSS to PDF</title>
		<link>http://moronicbajebus.com/2005/12/10/css-to-pdf/</link>
		<comments>http://moronicbajebus.com/2005/12/10/css-to-pdf/#comments</comments>
		<pubDate>Sat, 10 Dec 2005 17:30:58 +0000</pubDate>
		<dc:creator>Seamus</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Frontpage]]></category>

		<guid isPermaLink="false">http://moronicbajebus.com/wordpress/2005/12/10/css-to-pdf/</guid>
		<description><![CDATA[The ability to take XML and CSS to create a print material is coming around. What does that mean for the likes of Quark and InDesign.
]]></description>
			<content:encoded><![CDATA[<p>The ability to take XML and CSS to create a <a href="http://www.princexml.com/">print</a> <a href="http://www.alistapart.com/articles/boom">material</a> <a href="http://www.w3.org/TR/2004/CR-css3-page-20040225/">is coming</a> <a href="http://www.xml.com/pub/a/2005/01/19/print.html">around</a>. What does that mean for the likes of <a href="http://www.quark.com/">Quark</a> and <a href="http://www.adobe.com/products/indesign/main.html">InDesign</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://moronicbajebus.com/2005/12/10/css-to-pdf/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
