<?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>Swift Themes &#187; CSS tips and hacks</title>
	<atom:link href="http://swiftthemes.com/category/css-tips-and-hacks/feed/" rel="self" type="application/rss+xml" />
	<link>http://swiftthemes.com</link>
	<description>The fastest loading, premium quality free wordpress themes</description>
	<lastBuildDate>Sun, 05 Feb 2012 19:23:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>How to get the old navigation style in SwiftPremium</title>
		<link>http://swiftthemes.com/2011/04/css-tips-and-hacks/how-to-get-the-old-navigation-style-in-swiftpremium/</link>
		<comments>http://swiftthemes.com/2011/04/css-tips-and-hacks/how-to-get-the-old-navigation-style-in-swiftpremium/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 16:00:50 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[CSS tips and hacks]]></category>
		<category><![CDATA[SwiftPremium]]></category>
		<category><![CDATA[User CSS]]></category>

		<guid isPermaLink="false">http://swiftthemes.com/?p=1471</guid>
		<description><![CDATA[We changed the default styling of SwiftPremium to be different from the free version. If you are a fan of the old navigation style, you can get it by adding the following  CSS code to user CSS. [css] #nav1-container,#nav2-container{background:#dbdbdb;border:0} .navigation{margin-left:5px} .navigation li a{background:none!important} .navigation li a:hover{background:#EEE} /* For rounded corners*/ #footer-ad-container{padding:8px 0} #nav1-container {    -moz-border-radius-bottomleft: [...]]]></description>
			<content:encoded><![CDATA[<p>We changed the default styling of SwiftPremium to be different from the free version. If you are a fan of the old navigation style, you can get it by adding the following  CSS code to user CSS.</p>
<p>[css]<br />
#nav1-container,#nav2-container{background:#dbdbdb;border:0}<br />
.navigation{margin-left:5px}<br />
.navigation li a{background:none!important}<br />
.navigation li a:hover{background:#EEE}</p>
<p>/* For rounded corners*/<br />
#footer-ad-container{padding:8px 0}<br />
 #nav1-container {    -moz-border-radius-bottomleft: 5px;<br />
 -moz-border-radius-bottomright: 5px;<br />
 -webkit-border-bottom-right-radius: 5px;<br />
 -webkit-border-bottom-left-radius: 8px;padding: 4px 0}<br />
 #nav2-container {    -moz-border-radius-topleft: 5px;<br />
 -moz-border-radius-topright: 5px;<br />
 -webkit-border-top-right-radius: 5px;<br />
 -webkit-border-top-left-radius: 5px;padding:4px 0}<br />
[/css]</p>
]]></content:encoded>
			<wfw:commentRss>http://swiftthemes.com/2011/04/css-tips-and-hacks/how-to-get-the-old-navigation-style-in-swiftpremium/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using SWIFT to build awesome home pages and static sites for corporate clients</title>
		<link>http://swiftthemes.com/2010/10/wordpress-themes/swift/using-wordpress-and-swift-to-build-awesome-home-pages-and-static-sites-for-corporate-clients/</link>
		<comments>http://swiftthemes.com/2010/10/wordpress-themes/swift/using-wordpress-and-swift-to-build-awesome-home-pages-and-static-sites-for-corporate-clients/#comments</comments>
		<pubDate>Fri, 29 Oct 2010 15:32:56 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[CSS tips and hacks]]></category>
		<category><![CDATA[Swift]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[page templates]]></category>
		<category><![CDATA[Squeeze pages]]></category>
		<category><![CDATA[static index page]]></category>
		<category><![CDATA[static sites with wordpress]]></category>
		<category><![CDATA[WordPress Guide]]></category>

		<guid isPermaLink="false">http://swiftthemes.com/?p=1062</guid>
		<description><![CDATA[Building static sites and complex page layouts is very easy with SWIFT. In this tutorial I will guide you through the process. You don&#8217;t need any prior knowledge about HTML or CSS to understand this article. View DEMO SWIFT uses 960.gs 16 grid CSS framework (Don&#8217;t worry if you never heard of it). Every grid [...]]]></description>
			<content:encoded><![CDATA[<p>Building static sites and complex page layouts is very easy with SWIFT. In this tutorial I will guide you through the process. <strong>You don&#8217;t need any prior knowledge about HTML or CSS to understand this article.</strong></p>
<div id="attachment_1093" class="wp-caption aligncenter" style="width: 570px"><a rel="attachment wp-att-1093" href="http://swiftthemes.com/2010/10/wordpress-themes/free-themes/swift/using-wordpress-and-swift-to-build-awesome-home-pages-and-static-sites-for-corporate-clients/attachment/creating-awesome-squeeze-pages-with-swift-2/"><img class="size-large wp-image-1093" title="Creating-awesome-squeeze-pages-with-SWIFT" src="http://swiftthemes.com/blog/wp-content/uploads/2010/10/Creating-awesome-squeeze-pages-with-SWIFT1-560x798.jpg" alt="Awesome static home page with SWIFT" width="560" height="798" /></a><p class="wp-caption-text">This is what we are going to create. (Click to enlarge)</p></div>
<p class="button"><a href="http://demos.swiftthemes.com/?page_id=264">View DEMO</a></p>
<p>SWIFT uses 960.gs 16 grid CSS framework (Don&#8217;t worry if you never heard of it). Every grid cell has a <em>margin: 0 10px</em>.  This creates a gutter  of 20px.  When creating a row, the total width of all elements add up to  960.  Each grid cell has a class that specifies what width it will be.  Here  is the break down of column widths for a 16 column grid.</p>
<ol>
<li>40px</li>
<li>100px</li>
<li>160px</li>
<li>220px</li>
<li>280px</li>
<li>340px</li>
<li>400px</li>
<li>460px</li>
<li>520px</li>
<li>580px</li>
<li>640px</li>
<li>700px</li>
<li>760px</li>
<li>820px</li>
<li>880px</li>
<li>940px</li>
</ol>
<p>Each width corresponds to a class name formed like this: <strong><em>grid_X</em> where X is a number from the above list</strong>.  If you want a block with  width 940 use class <em>grid_16</em>.</p>
<div id="attachment_1081" class="wp-caption aligncenter" style="width: 1030px"><a href="http://swiftthemes.com/blog/wp-content/uploads/2010/10/Mockup-for-Squeeze-page.png"><img class="size-full wp-image-1081" title="Mockup-for-Squeeze-page" src="http://swiftthemes.com/blog/wp-content/uploads/2010/10/Mockup-for-Squeeze-page.png" alt="Mockup of our layout" width="1020" height="852" /></a><p class="wp-caption-text">Mock up of our layout</p></div>
<p>After checking out the visual, you should understand how to create  the mock up grid.</p>
<ul class="arrow">
<li>Create a new page, and select “Full Width Blank” template in page attributes on the right.</li>
<li>Switch the editor to HTML mode.</li>
<li>Using the widths, match up the class number’s from the  list and create a skeleton code as shown below in the editor.</li>
<li>Once you add the skeleton code, you can go back to visual editor mode  and add content to each div like you normally do. Just make sure your  images dont over flow.</li>
</ul>
<p class="tip"><span class="bg"> </span>WYSIWYG editor can be pain in the **** some times, it uses it’s  brain and removes/modifies our skeleton, be aware of that. If your  comfortable with html mode, create your pages in HTML mode.</p>
<p class="warning"><span class="bg"> </span>Remember to add the clearing div  at the end of each row.</p>
<p>[css]&lt;!&#8211;First row&#8211;&gt;<br />
&lt;div class=&quot;grid_11 alpha&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;grid_5 omega&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;</p>
<p>&lt;!&#8211;&lt;span class=&quot;hiddenSpellError&quot; pre=&quot;&quot;&gt;Seocnd&lt;/span&gt; row&#8211;&gt;</p>
<p>&lt;div class=&quot;grid_9 alpha&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;grid_7 omega&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;</p>
<p>&lt;!&#8211;Third row&#8211;&gt;<br />
&lt;div class=&quot;grid_6 alpha&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;grid_5&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;grid_5 omega&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;</p>
<p>[/css]</p>
<p>Now fill in the empty div&#8217;s with the html code, <strong>make sure you close all the divs.</strong></p>
<p class="warning"><span class="bg"> </span>Skeleton code should be added in HTML mode, not in visual mode.</p>
<p class="tip"><span class="bg"> </span>I added style sheet to WordPress editor in version 5.67 , your posts when published look exactly same as they looked in the editor. To take advantage of this feature switch to full screen mode while editing, if you are not comfortable with full screen mode, at least make sure your editor is <strong>more than 960px</strong> wide<strong> </strong></p>
<div id="attachment_1101" class="wp-caption aligncenter" style="width: 570px"><a rel="attachment wp-att-1101" href="http://swiftthemes.com/2010/10/wordpress-themes/free-themes/swift/using-wordpress-and-swift-to-build-awesome-home-pages-and-static-sites-for-corporate-clients/attachment/wordpress-post-editor-in-swift/"><img class="size-large wp-image-1101" title="wordpress post editor in SWIFT" src="http://swiftthemes.com/blog/wp-content/uploads/2010/10/wordpress-post-editor-in-SWIFT-560x74.jpg" alt="" width="560" height="74" /></a><p class="wp-caption-text">This is how you editor looks in visual mode after you add the skeleton code.</p></div>
<p>I added borders to the div&#8217;s to serve as visual guide, they wont be there when on published post.</p>
<p class="tip"><span class="bg"> </span>Things to remember</p>
<ul class="arrow">
<li>First and last div of a row should have the class alpha and omega respectively.</li>
<li>Don&#8217;t forget to add &lt;div class=&#8221;clear&#8221;&gt;&lt;/div&gt; afer each row.</li>
<li>Sum of all grid indexes in a row should be 16 like we have 11+5, 9+7, 6+5+5 in the above code.</li>
</ul>
<p>You can have sub grids to, for example</p>
<p>[css]<br />
&lt;div class=&quot;grid_10&quot;&gt;<br />
You can add some content here if you want to<br />
&lt;div class=&quot;grid_3 alpha&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;grid_2&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;grid_2 omega&quot;&gt;<br />
&lt;/div&gt;<br />
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;<br />
[/css]</p>
<p>Sub grids index should add up to the parent grid&#8217;s index, 10 in this case. first div should have the class alpha and the last should have class omega.Don&#8217;t forget to add &lt;div class=&#8221;clear&#8221;&gt;&lt;/div&gt;</p>
<p><strong>Further reading..</strong><br />
<a href="http://net.tutsplus.com/tutorials/html-css-techniques/prototyping-with-the-grid-960-css-framework/">http://net.tutsplus.com/tutorials/html-css-techniques/prototyping-with-the-grid-960-css-framework/</a></p>
<p>This is from where I learnt how to use 960.gs grid, this is the tutorial is one of the major factor that led to the development of SWIFT.</p>
]]></content:encoded>
			<wfw:commentRss>http://swiftthemes.com/2010/10/wordpress-themes/swift/using-wordpress-and-swift-to-build-awesome-home-pages-and-static-sites-for-corporate-clients/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Problem with height of div containing floats and inline lists.</title>
		<link>http://swiftthemes.com/2009/12/css-tips-and-hacks/problem-with-height-of-div-containing-floats-and-inline-lists/</link>
		<comments>http://swiftthemes.com/2009/12/css-tips-and-hacks/problem-with-height-of-div-containing-floats-and-inline-lists/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 08:13:09 +0000</pubDate>
		<dc:creator>Satish</dc:creator>
				<category><![CDATA[CSS tips and hacks]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[div containing float]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[Height]]></category>

		<guid isPermaLink="false">http://swiftthemes.com/?p=406</guid>
		<description><![CDATA[Float is one of the most powerful property in CSS, they are the key for many useful layouts and CSS frameworks.  When we float a div, image or any other element, it&#8217;s taken out the regular document flow. The most common problem due to this property of float is, when we have a div containing [...]]]></description>
			<content:encoded><![CDATA[<p>Float is one of the most powerful property in CSS, they are the key for many useful layouts and CSS frameworks.  When we float a div, image or any other element, it&#8217;s taken out the <em>regular document flow</em>. The most common problem due to this property of float is, when we have a div containing a floated element whose height is larger than the height acquired by the containing div due to the elements in regular document flow, then our floated div falls out side container ( Check the screenshot below). In most cases this is not the result a developer / designer would be expecting.</p>
<div id="attachment_407" class="wp-caption aligncenter" style="width: 656px"><a href="http://swiftthemes.com/blog/wp-content/uploads/2009/12/float-property-1.png"><img class="size-full wp-image-407" title="float-property-1" src="http://swiftthemes.com/blog/wp-content/uploads/2009/12/float-property-1.png" alt="Floated image flowing out of the container DIV" width="646" height="476" /></a><p class="wp-caption-text">Floated image flowing out of the container DIV</p></div>
<p>A simple way to solve this problem of height is to add this piece of code to your style sheet, and apply the clearfix class to the div containing floated elements.</p>
<p>[css]</p>
<p>.clearfix:after {<br />
 visibility: hidden;<br />
 display: block;<br />
 font-size: 0;<br />
 content: &quot; &quot;;<br />
 clear: both;<br />
 height: 0;<br />
}</p>
<p>.clearfix {display: inline-block;}</p>
<p>/* Hides from IE-mac \*/<br />
* html .clearfix {height: 1%;}<br />
.clearfix {display: block;}<br />
/* End hide from IE-mac */</p>
<p>[/css]</p>
<p><strong>The result of applying the clearfix class to the container div is shown below.</strong></p>
<div id="attachment_409" class="wp-caption aligncenter" style="width: 640px"><a href="http://swiftthemes.com/blog/wp-content/uploads/2009/12/float-property-2.png"><img class="size-full wp-image-409" title="float-property-2" src="http://swiftthemes.com/blog/wp-content/uploads/2009/12/float-property-2.png" alt="Now donald is with in the container DIV. Cool !!" width="630" height="365" /></a><p class="wp-caption-text">Now Donald is with in the container DIV, Cool !!</p></div>
<p><em>More info about similar fixes can be found at <a href="http://www.pageaffairs.com/web/css/containing-floats/">pageAffairs</a></em><br />
Explaining this clearfix fix for div&#8217;s containing floated is not the main purpose of writing this post, now that you know about this fix lets see how to solve the problem on which I was stuck for 2 days <img src='http://swiftthemes.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  .</p>
<h2>Problem</h2>
<p><em>A div containing list elements with display:inline; property will not take the height equal to the height of the list element.</em></p>
<p>I have the following CSS and HTML code</p>
<p><strong>CSS</strong></p>
<p>[css]</p>
<p>#nav1-container,<br />
 #nav2-container{background:#ff0;}<br />
 #nav1-container {border-bottom:solid 5px #f00;}<br />
 #nav2-container {border-top:solid 5px #f00}<br />
 ul.navigation {margin-left:-10px;}<br />
 ul.navigation li {display:inline;padding:.5em 1em;}<br />
 ul.navigation li:hover {background:#000}</p>
<p>[/css]</p>
<p><strong>HTML</strong></p>
<p>[html]<br />
&lt;div id=&quot;nav1-container&quot;&gt;<br />
	&lt;div id=&quot;nav1&quot; class=&quot;grid_16&quot;&gt;</p>
<p>    &lt;ul class=&quot;navigation top&quot;&gt;<br />
    			&lt;li class=&quot;page_item current_page_item first&quot;&gt;&lt;a href=&quot;http://swiftthemes.com/swiftTest&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
        &lt;li class=&quot;page_item page-item-2&quot;&gt;&lt;a href=&quot;http://swiftthemes.com/swiftTest/?page_id=2&quot; title=&quot;About&quot;&gt;About&lt;/a&gt;&lt;/li&gt;<br />
    &lt;/ul&gt;</p>
<p>	&lt;/div&gt;&lt;!&#8211;/nav1&#8211;&gt;</p>
<p>&lt;/div&gt;&lt;!&#8211;/nav1-container&#8211;&gt;</p>
<p>&lt;div id=&quot;header-container&quot;&gt;<br />
	&lt;div id=&quot;header&quot; class=&quot;grid_16&quot;&gt;</p>
<p>        &lt;div id=&quot;logo&quot;&gt;<br />
        		&lt;h2 class=&quot;blogname&quot;&gt;&lt;a href=&quot;http://swiftthemes.com/swiftTest/&quot;&gt;SwiftTheme Test Blog&lt;/a&gt;&lt;/h2&gt;<br />
				&lt;h2 class=&quot;blog-title&quot;&gt;Just another WordPress weblog&lt;/h2&gt;<br />
        &lt;/div&gt;&lt;!&#8211;/logo&#8211;&gt;</p>
<p>        &lt;div id=&quot;header-ad&quot;&gt;</p>
<p>        &lt;/div&gt;&lt;!&#8211;/header-ad&quot;&#8211;&gt;</p>
<p>    &lt;/div&gt;&lt;!&#8211;/header&#8211;&gt;<br />
&lt;/div&gt;&lt;!&#8211;/header-container&#8211;&gt;</p>
<p>&lt;div id=&quot;nav2-container&quot;&gt;<br />
	&lt;div id=&quot;nav2&quot; class=&quot;grid_16&quot;&gt;<br />
    &lt;ul class=&quot;navigation bottom&quot;&gt;<br />
    			&lt;li class=&quot;page_item current_page_item first&quot;&gt;&lt;a href=&quot;http://swiftthemes.com/swiftTest&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
        &lt;li class=&quot;page_item page-item-2&quot;&gt;&lt;a href=&quot;http://swiftthemes.com/swiftTest/?page_id=2&quot; title=&quot;About&quot;&gt;About&lt;/a&gt;&lt;/li&gt;</p>
<p>    &lt;/ul&gt;<br />
	&lt;/div&gt;&lt;!&#8211;/nav2&#8211;&gt;<br />
&lt;/div&gt;&lt;!&#8211;/nav2-container&#8211;&gt;</p>
<p>[/html]</p>
<p>No matter what the padding of list elements be, the height of container div wouldnt change. Hard coding the height of containers is not an option for me as SWIFT will be used by lot of users, and some may have one row of links and others may 2 or 3 rows.</p>
<div id="attachment_411" class="wp-caption aligncenter" style="width: 539px"><a href="http://swiftthemes.com/blog/wp-content/uploads/2009/12/problem-with-height-of-inline-elemets.png"><img class="size-full wp-image-411" title="problem-with-height-of-inline-elemets" src="http://swiftthemes.com/blog/wp-content/uploads/2009/12/problem-with-height-of-inline-elemets.png" alt="{ Problem with the height of inline list elements } You can see the home link flowing out of the container." width="529" height="234" /></a><p class="wp-caption-text">{ Problem with the height of inline list elements } You can see the home link flowing out of the container.</p></div>
<p>After trying different approaches to solve this problem, I finally realized that the display inline attribute is the culprit, so I removed the display:inline attribute and floated the list elements (li&#8217;s) towards left and used the clearfix class for the container and I finally got it the way I wanted it to look.</p>
<p>Here is what I exactly did..</p>
<p>Changed this</p>
<p>[css]ul.navigation li {display:inline;padding:.5em 1em;}[/css]</p>
<p>to</p>
<p>[css]ul.navigation li {float:left;padding:.5em 1em;}[/css]</p>
<p>and added clear fix class to both the containers</p>
<p>Changed</p>
<p>[html]&lt;div id=&quot;nav1-container&quot;&gt;[/html]</p>
<p>to</p>
<p>[html]&lt;div id=&quot;nav1-container&quot; class=&quot;clearfix&quot;&gt;[/html]</p>
<p>and the result is shown below</p>
<div id="attachment_412" class="wp-caption aligncenter" style="width: 531px"><a href="http://swiftthemes.com/blog/wp-content/uploads/2009/12/fix-for-problem-with-height-of-inline-elemets.png"><img class="size-full wp-image-412" title="fix-for-problem-with-height-of-inline-elemets" src="http://swiftthemes.com/blog/wp-content/uploads/2009/12/fix-for-problem-with-height-of-inline-elemets.png" alt="See the home link after the fix." width="521" height="249" /></a><p class="wp-caption-text">See the home link after the fix.</p></div>
<p><strong>PS </strong></p>
<ul>
<li>This problem delayed the release of SWIFT by 2 days.</li>
<li>Above code is from the v5.0 of SWIFT, isn&#8217;t that code poetry??</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://swiftthemes.com/2009/12/css-tips-and-hacks/problem-with-height-of-div-containing-floats-and-inline-lists/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: swiftthemes.com @ 2012-02-07 20:07:28 -->
