<?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>Webdevelopment at huuah.com &#187; css</title>
	<atom:link href="http://huuah.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://huuah.com</link>
	<description>webdevelopment, cms, php, javascript etc</description>
	<lastBuildDate>Sun, 20 Nov 2011 20:30:03 +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>Howto float your CSS</title>
		<link>http://huuah.com/howto-float-your-css/</link>
		<comments>http://huuah.com/howto-float-your-css/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 19:41:13 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=611</guid>
		<description><![CDATA[<p>Float left. Float right. What to do and why? Well read on &#8230;</p>
<a name="How+to+float+it"></a>How to float it
<p>Well &#8211; it can sometimes be quite difficult to understand how the float universe works. I will try to give some basic pointers and examples on the float left and float right technique &#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Float left. Float right. What to do and why? Well read on &#8230;</p>
<a name="How+to+float+it"></a><h1>How to float it</h1>
<p>Well &#8211; it can sometimes be quite difficult to understand how the float universe works. I will try to give some basic pointers and examples on the float left and float right technique and how it reacts in the layout.</p>
<p><SCRIPT charset="utf-8" type="text/javascript" src="http://ws.amazon.co.uk/widgets/q?ServiceVersion=20070822&#038;MarketPlace=GB&#038;ID=V20070822/GB/huuah-21/8006/871a18af-2ef7-40ff-b192-f5732c864791"> </SCRIPT> <NOSCRIPT><A HREF="http://ws.amazon.co.uk/widgets/q?ServiceVersion=20070822&#038;MarketPlace=GB&#038;ID=V20070822%2FGB%2Fhuuah-21%2F8006%2F871a18af-2ef7-40ff-b192-f5732c864791&#038;Operation=NoScript">Amazon.co.uk Widgets</A></NOSCRIPT></p>
<a name="The+basic+of+id+and+classes"></a><h1>The basic of id and classes</h1>
<p>There are two ways to access HTML elements from CSS. You can either use id&#8217;s or class&#8217;es. Almost every HTML tag, if not all, allows the assignment of an id or class name. When element has an id or class, it can be accessed from CSS by using . or #.</p>
<p>ID are accessed with # (hash). Lets say we have a &lt;div&gt;-tag with the id set to mydiv:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;mydiv&quot;&gt;some content here&lt;/div&gt;
</pre>
<p>The mydiv can then be access like this from CSS</p>
<pre class="brush: css; title: ; notranslate">
#mydiv {
  width: 100px;
  height: 100px;
}
</pre>
<p>If we are using a class instead of an id, the code would lookup like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;mydiv&quot;&gt;some content here&lt;/div&gt;
</pre>
<p>And</p>
<pre class="brush: css; title: ; notranslate">
.mydiv {
  width: 100px;
  height: 100px;
}
</pre>
<p>id&#8217;s and class&#8217;es will not be covered in more details here.</p>
<a name="Starting+point"></a><h1>Starting point</h1>
<p>This article will use the following HTML as a starting point. It holds a simple div-&#8221;container&#8221; with contains another 3 divs.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;container&quot;&gt;
  &lt;div class=&quot;class1&quot;&gt;This is the first class&lt;/div&gt;
  &lt;div class=&quot;class2&quot;&gt;This is the second class&lt;/div&gt;
  &lt;div class=&quot;class3&quot;&gt;This is the third class&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Without any CSS it would look like this:</p>
<div class="container">
<div class="class1">This is the first class</div>
<div class="class2">This is the second class</div>
<div class="class3">This is the third class</div>
</div>
<p>Not really that pretty and nice as we would like it to be, right?</p>
<a name="Basic+styling"></a><h1>Basic styling</h1>
<p>Lets do some basic styling of the above code, to better see what&#8217;s going on.</p>
<pre class="brush: css; title: ; notranslate">
.class1 {
  width: 200px;
  background-color: light-grey;
}
.class2 {
  width: 300px;
  background-color: white;
}
.class3 {
  width: 500px;
  background-color: grey;
}
</pre>
<p>This outputs:</p>
<div class="container1">
<div class="class1">This is the first class</div>
<div class="class2">This is the second class</div>
<div class="class3">This is the third class</div>
</div>
<p>Okay &#8211; now we can better see the difference between the 3 divs.</p>
<a name="Lets+float+it"></a><h1>Lets float it</h1>
<p>When floating left, the selected element will be placed along the left side of the next element.<br />
When floating right, the selected element will be placed along the right side of the next element.</p>
<p>Left floating the first class:</p>
<pre class="brush: css; title: ; notranslate">
.class1 {
  width: 200px;
  background-color: light-grey;
  float: left;
}
</pre>
<div class="container2">
<div class="class1">This is the first class</div>
<div class="class2">This is the second class</div>
<div class="class3">This is the third class</div>
</div>
<p>Okay, that went kinda like expected. Although &#8211; the class2 has a width set to 300px, so why does it wrap like that, when it should have enough space &#8211; the class1 is 200px and the class3 is 500px, so class1 and class2 should will up the exact same space as class3 below. </p>
<p>This is one of those questions I used to ask a friend of mine over at <a href="http://www.spiced2.com">spiced2.com</a> and he always answered &#8220;when in doubt, float left&#8221;. Ok then. Lets float class2 left as well:</p>
<div class="container3">
<div class="class1">This is the first class</div>
<div class="class2">This is the second class</div>
<div class="class3">This is the third class</div>
</div>
<pre class="brush: css; title: ; notranslate">
.class1 {
          width: 200px;
          background-color: #DEDEDE;
          float: left;
}
.class2 {
          width: 300px;
          background-color: #006699;
          float: left;
}
.class3 {
          width: 500px;
          background-color: #009900;
}
</pre>
<p>Now it&#8217;s a lot better, but what will happen if we try to float right?</p>
<div class="container4">
<div class="class1">This is the first class</div>
<div class="class2">This is the second class</div>
<div class="class3">This is the third class</div>
</div>
<p>The first class is now floating right, and is therefor aligned to the right side of class2:</p>
<pre class="brush: css; title: ; notranslate">
.class1 {
          width: 200px;
          background-color: #DEDEDE;
          float: right;
}
.class2 {
          width: 300px;
          background-color: #006699;
}
class3 {
          width: 500px;
          background-color: #009900;
}
</pre>
<a name="The+next+step"></a><h1>The next step</h1>
<p>Lets try a bit more advanced setup, where we will wrap some text around another element. To do this we have to place one element inside another like this:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;container&quot;&gt;
  &lt;div class=&quot;class1&quot;&gt; &lt;span class=&quot;class2&quot;&gt;This is the second class&lt;/span&gt;This is the first class This is the first class This is the first class This is the first class This is the first class This is the first class &lt;/div&gt;
  &lt;div class=&quot;class3&quot;&gt;This is the third class&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>To get the text in class wrapped around the class2 element, we have to set a float right on the class2. This makes it right aligned, and the text in class1 will then wrapped around it. </p>
<p>The CSS looks as follows:</p>
<pre class="brush: css; title: ; notranslate">
.class1 {
          width: 500px;
          background-color: #DEDEDE;
          float: left;
}
.class2 {
          width: 200px;
          background-color: #006699;
          float: right;
}
.class3 {
          width: 500px;
          background-color: #009900;
}
</pre>
<div class="container5">
<div class="class1"> <span class="class2">This is the second class</span>This is the first class This is the first class This is the first class This is the first class This is the first class This is the first class </div>
<div class="class3">This is the third class</div>
</div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-2002298237929711";
/* 468x15, oprettet 19-04-10 */
google_ad_slot = "2384876595";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<a name="Last+words"></a><h1>Last words</h1>
<p>That it. A very small and basic intro tutorial on the mysterious left and right floating. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/howto-float-your-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic jQuery div rotator</title>
		<link>http://huuah.com/basic-jquery-div-rotator/</link>
		<comments>http://huuah.com/basic-jquery-div-rotator/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 21:54:24 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=536</guid>
		<description><![CDATA[<p>So &#8211; how do one make a simple rotations function in jquery? There are many ways to do this, so I will just demonstrate one of them here:</p>
<a name="Example+code+for+the+jQuery+DIV+rotator%3A"></a>Example code for the jQuery DIV rotator:
<p>And this will output 4 divs as shown here:</p>
<div class="focusitem&#160;active">Item 1</div>
<div class="focusitem&#160;notactive">Item 2</div>
<div class="focusitem&#160;notactive">Item 3&#8230;</div>]]></description>
			<content:encoded><![CDATA[<p>So &#8211; how do one make a simple rotations function in jquery? There are many ways to do this, so I will just demonstrate one of them here:</p>
<a name="Example+code+for+the+jQuery+DIV+rotator%3A"></a><h1>Example code for the jQuery DIV rotator:</h1>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;&quot;&gt;
&lt;div class=&quot;focusitem active&quot;&gt;Item 1&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 2&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 3&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 4&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>And this will output 4 divs as shown here:</p>
<div class="focusitem&nbsp;active">Item 1</div>
<div class="focusitem&nbsp;notactive">Item 2</div>
<div class="focusitem&nbsp;notactive">Item 3</div>
<div class="focusitem&nbsp;notactive">Item 4</div>
<p>Nothing exciting about this, really. So &#8211; lets add the forward and backward button for the shifting of visible divs.</p>
<a name="Make+the+items+rotate"></a><h1>Make the items rotate</h1>
<pre class="brush: xml; title: ; notranslate">
&lt;div class=&quot;goleft&quot;&gt;Go Left&lt;/div&gt;

&lt;div class=&quot;&quot;&gt;
&lt;div class=&quot;focusitem active&quot;&gt;Item 1&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 2&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 3&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 4&lt;/div&gt;
&lt;/div&gt;

&lt;div class=&quot;goright&quot;&gt;Go Right&lt;/div&gt;
</pre>
<p>There is now added 2 buttons/divs/textsfield &#8211; a left one and a right one. All we have to do, is make the buttons change which div is visible. The easy way to do this, is by changing the class name of the div and with CSS control the visibility and format.</p>
<p>To register a click event on the left and right buttons, we have to use the click()-function in jQuery.</p>
<p>That can look like this:</p>
<p>Javascript:</p>
<pre class="brush: jscript; title: ; notranslate">
     // trigger the mouse click even
     $(&quot;.goleft&quot;).click( function(e) {
        // get the current active element
        var $active = $(&quot;.active&quot;);
        // get the previous element or, if no previous then get the last item in the focusitem-class.
        var $next = $active.prev().length ? $active.prev() : $(&quot;.focusitem:last&quot;);

        // set the visibility of the active and notactive classes.
        $active.removeClass('active');
        $active.addClass('notactive');
        $next.addClass('active');
        $next.removeClass('notactive');
    });
</pre>
<p>CSS:</p>
<pre class="brush: css; title: ; notranslate">
&lt;div class=&quot;focusitem active&quot;&gt;Item 1&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 2&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 3&lt;/div&gt;
&lt;div class=&quot;focusitem notactive&quot;&gt;Item 4&lt;/div&gt;
</pre>
<a name="Result%3A"></a><h1>Result:</h1>
<div class="goleft">Go Left</div>
<div class="">
<div class="focusitem active">Item 1</div>
<div class="focusitem notactive">Item 2</div>
<div class="focusitem notactive">Item 3</div>
<div class="focusitem notactive">Item 4</div>
</div>
<div class="goright">Go Right</div>
<div class="clear"></div>
<a name="How+it+works"></a><h1>How it works</h1>
<p>The jQuery rotation code gets activated as soon as a user clicks the buttons. It find the active element, and the next or previous element corresponding to which buttons is activated and the toggles the active and notactive classes on the focusitems.</p>
<p>Complete jQuery code:</p>
<pre class="brush: jscript; title: ; notranslate">
(document).ready(function() {

    $(&quot;.goleft&quot;).click( function(e) {
        var $active = $(&quot;.active&quot;);
        var $next = $active.prev().length ? $active.prev() : $(&quot;.focusitem:last&quot;);

        $active.removeClass('active');
        $active.addClass('notactive');
        $next.addClass('active');
        $next.removeClass('notactive');
    });

    $(&quot;.goright&quot;).click( function(e) {
        var $active = $(&quot;.active&quot;);
        var $next = $active.next().length ? $active.next() : $(&quot;.focusitem:first&quot;);

        $active.removeClass('active');
        $active.addClass('notactive');
        $next.addClass('active');
        $next.removeClass('notactive');
    });

});
</pre>
<p>Complete CSS for the above example:</p>
<pre class="brush: css; title: ; notranslate">
.active {
    display: block;
    width: 100px;
    float: left;
}
.notactive {
    display: none;
}

.goleft, .goright {
    cursor: pointer;
    width: 100px;
    float: left;
    border: 1px solid;
}
</pre>
<a name="Now+what%3F"></a><h1>Now what?</h1>
<p>For more fancy display that my example shows, try putting some images ind the focusitem and make some nice arrows for the go left and right buttons. The usability of the rotator will improve a lot, by making some easy layout adjustments. </p>
<p>Obvious expansions for this kind of rotator would be a more fancy shift/glide between active divs or perhaps loading each element with Ajax, but this is intensionally not covered in this post. </p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/basic-jquery-div-rotator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Including Javascript or CSS in your TYPO3 template</title>
		<link>http://huuah.com/including-javascript-or-css-in-your-typo3-template/</link>
		<comments>http://huuah.com/including-javascript-or-css-in-your-typo3-template/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 20:46:40 +0000</pubDate>
		<dc:creator>js - huuah</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[TYPO3]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://huuah.com/?p=409</guid>
		<description><![CDATA[<p>Have you ever had the need for inserting extra stylesheet or javascript files in your TYPO3 template? I am used to having a TemplaVoila setup, which has the nice feature of mapping part of the header as part of the template, but this is not really that flexible when using &#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Have you ever had the need for inserting extra stylesheet or javascript files in your TYPO3 template? I am used to having a TemplaVoila setup, which has the nice feature of mapping part of the header as part of the template, but this is not really that flexible when using extension template and etc.</p>
<p>An easy way of controlling this, is to setup the javascript and css files from the template configuration. There are some different ways of doing this and I will demonstrate two of them here.</p>
<p>The template configuration examples should be self-explainable, so I will not comment them futher:</p>
<p><strong>Javascript option 1 &#8211; headerData:</strong></p>
<pre class="brush: plain; title: ; notranslate">
page.headerData.230 = TEXT
page.headerData.230.value = &lt;script type=&quot;text/javascript&quot; src=&quot;/fileadmin/myjavascript.js&quot;&gt;&lt;/script&gt;
</pre>
<p><strong>Javascript option 2 &#8211; includeJS:</strong></p>
<pre class="brush: plain; title: ; notranslate">
page.includeJS {
  file1 = fileadmin/myjavascript.js
  file1.type = application/x-javascript
  file2 = fileadmin/myjavascript2.js
}
</pre>
<p><strong>CSS option 1 &#8211; headerData</strong></p>
<pre class="brush: plain; title: ; notranslate">
page.headerData.231 = TEXT
page.headerData.231.value = &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;/fileadmin/stylesheet.css&quot; /&gt;
</pre>
<p><strong>CSS option 2 &#8211; includeCSS</strong></p>
<pre class="brush: plain; title: ; notranslate">
page.includeCSS {
  file1 = fileadmin/stylesheet.css
}
</pre>
<p><strong>CSS option 3 &#8211; page.stylesheet</strong></p>
<pre class="brush: plain; title: ; notranslate">
page.stylesheet = fileadmin/stylesheet.css
</pre>
<p>Hope this tip can be helpful. Please notice that the CSS option 3 only enables you to <strong>set 1 stylesheet</strong>, where the other examples support multiple files.</p>
]]></content:encoded>
			<wfw:commentRss>http://huuah.com/including-javascript-or-css-in-your-typo3-template/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

