<?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>The Infinite Loop - Beginner&#039;s SEO, Beginner C# &#38; JQuery Tutorials &#187; css tricks</title>
	<atom:link href="http://theinfiniteloopblog.com/tag/css-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://theinfiniteloopblog.com</link>
	<description>Problem. Problem Solved. Loop. - The life of a programmer</description>
	<lastBuildDate>Wed, 17 Aug 2011 15:29:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Paging in PHP &#8211; PHP Paging Tutorial</title>
		<link>http://theinfiniteloopblog.com/programming/php/paging-in-php-php-paging-tutorial/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=paging-in-php-php-paging-tutorial</link>
		<comments>http://theinfiniteloopblog.com/programming/php/paging-in-php-php-paging-tutorial/#comments</comments>
		<pubDate>Sun, 30 May 2010 01:56:07 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[beginner css]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css layout]]></category>
		<category><![CDATA[css techniques]]></category>
		<category><![CDATA[css tricks]]></category>
		<category><![CDATA[custom php paging]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tableless design]]></category>
		<category><![CDATA[tableless layout]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://theinfiniteloopblog.com/?p=381</guid>
		<description><![CDATA[<strong>Paging in php and automatic pagination</strong> is something every coder has to deal with when coding in php. I mean, you COULD show all results on 1 page and skip the php paging, but paging is necessary to reduce bandwidth and organize content. Paging is very easy to do and I will walk you through it step by step. 
]]></description>
			<content:encoded><![CDATA[
<!-- ALL ADSENSE ADS DISABLED -->
<h2 style="font-size:8pt;">PHP Paging &amp; Automatic Pagination Tutorial - Paging made easy</h2>
<p>I have written a <strong>php paging tutorial</strong> before. Admittedly, it wasn't the greatest. I don't think I was as clear as I wanted to be. SO I'm trying again. <img src='http://theinfiniteloopblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  At the end of this tutorial, there is a file named <b>php-automatic-pagination.php.txt</b><br />
Please download it! It will help you understand the following.</p>
<p>Here is what we will be making..nice, simple pagers! (Dont worry about the Image #x text, thats really not part of the tutorial)<br />
<a href="http://theinfiniteloopblog.com/wp-content/uploads/2010/05/php-automatic-pagination.jpg" target="_blank"><img src="http://theinfiniteloopblog.com/wp-content/uploads/2010/05/php-automatic-pagination-300x141.jpg" alt="PHP Automatic Pagination/Simple PHP Paging Tutorial" title="php-automatic-pagination" width="300" height="141" class="alignnone size-medium wp-image-400" /></a></p>
<p><strong>Paging in php and automatic pagination</strong> is something every coder has to deal with when coding in php. I mean, you COULD show all results on 1 page and skip the php paging, but paging is necessary to reduce bandwidth and organize content. Paging is very easy to do and I will walk you through it step by step. </p>
<p>PHP automatic paging comes with a few questions:<br />
Paging 1 : Page Size - How many results would you like to display per page?<br />
Paging 2 : How can we bring back proper results in mysql?<br />
Paging 3 : How can we print a pager that will help show the next items.</p>
<p>Decide on your page size - 10, 15, 25, 50, 100. It really depends on what you would like to do.  For this tutorial I will use 15.</p>
<p class="comment">//we want 15 results per page</p>
<p>$pgsize=15; </p>
<p class="comment">//if there is a p variable in the query string e.g: page.php?p=5 we will get this value, else we will use 1 (page 1)</p>
<p>$pg=(is_numeric($_GET["p"]) ? $_GET["p"] : 1); </p>
<p class="comment">//lets determine where we would like to get results from<br />
//if $pg is 1, this calculation results in 0 (we want to start from the first record in the database)<br />
//if $pg is 2, this calculation will result in 1*15..which means we will start at the 15th index of the database (row 16)</p>
<p>$start=($pg-1)*$pgsize; </p>
<p class="comment">//let us query the database for our results<br />
//you will notice LIMIT and $start and $pgsize.<br />
//On page 1, this query will be SELECT * FROM image_table LIMIT 0,15  - this means return 15 rows starting at row-index 0 (row 1)<br />
//On page 2, this query will be SELECT * FROM image_table LIMIT 15, 15 - this means we will return 15 rows starting at row-index 15 (row 16)<br />
//On page 3, this query will be SELECT * FROM image_table LIMIT 30,15 - this means we will return 15 rows starting at row-index 30 (row 31)<br />
GET IT?!?!?!</p>
<p>$imgs=mysql_query("SELECT * FROM image_table LIMIT $start, $pgsize");</p>
<p class="comment">//we will also need the total number of records in our table<br />
//notice there is no limit? we want to know how many records are in the entire table!<br />
//we can use COUNT(*), COUNT(1), or COUNT(fieldname), they will all return the same result</p>
<p>$img_total=mysql_query("SELECT COUNT(1) FROM image_table");</p>
<p class="comment">//mysql_query returns a resource id, we can use this to get the row it has returned</p>
<p>$img_total=mysql_fetch_row($img_total);</p>
<p class="comment">//the count will be the first field in this row</p>
<p>$img_total=$img_total[0];</p>
<p class="comment">//lets determine how many pages we will need<br />
 //WRONG!, this will cut off results..why?<br />
//say we have 31 images, and our page size is 15. 31/15= ~2.x...We need to round this result up!</p>
<p>$max_pages=$img_total / $pgsize; </p>
<p class="comment">//use this line instead</p>
<p>$max_pages=ceil($img_total/$pgsize);</p>
<p>Once we have all this information, we can use a handy little function I have written named printPager. This function will print out a neat little pager. It uses a helper function named add_querystring_var which was from Added Bytes here:<br />
<a href="http://www.addedbytes.com/code/querystring-functions/">http://www.addedbytes.com/code/querystring-functions/</a></p>
<p>Copy/paste this function into your page or into one of your includes:<br />
This will print out your awesome little pager! <img src='http://theinfiniteloopblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h2 style="font-size:1em;">PHP Automatic Pagination Function</h2>
<div style="font-size:0.9em;">
function printPager($max_pages,$pg){<br />
	print '&lt;div class="clear"&gt;&lt;/div&gt;';<br />
	print '&lt;ul class="pager"&gt;';<br />
	$i=1;<br />
	if($pg!=1){<br />
		$url=$_SERVER["SCRIPT_NAME"];<br />
		$url.=add_querystring_var("?".$_SERVER["QUERY_STRING"], "p", $pg-1);<br />
		print '&lt;li class="prev"&gt;&lt;a href="'.$url.'"&gt;&lt;&lt;&lt;/a&gt;&lt;/li&gt;';<br />
	}</p>
<p>	while($i&lt;=$max_pages){<br />
		$url=$_SERVER["SCRIPT_NAME"];<br />
		$url.=add_querystring_var("?".$_SERVER["QUERY_STRING"], "p", $i);</p>
<p>		if($pg==$i){<br />
			print '&lt;li class="current"&gt;';<br />
			print '&lt;span&gt;'.$i.'&lt;/span&gt;';<br />
			print "&lt;/li&gt;";<br />
		}else{<br />
			print "&lt;li&gt;";<br />
			print '&lt;a href="'.$url.'"&gt;'.$i.'&lt;/a&gt;';<br />
			print "&lt;/li&gt;";<br />
		}</p>
<p>		$i++;<br />
	}</p>
<p>	if($pg!=$max_pages){<br />
		$url=$_SERVER["SCRIPT_NAME"];<br />
		$url.=add_querystring_var("?".$_SERVER["QUERY_STRING"], "p", $pg+1);<br />
		print '&lt;li class="next"&gt;&lt;a href="'.$url.'"&gt;&gt;&gt;&lt;/a&gt;';<br />
	}<br />
	print '&lt;/ul&gt;';<br />
	print '&lt;div class="clear"&gt;&lt;/div&gt;';<br />
}</p>
<p>function add_querystring_var($url, $key, $value) { $url = preg_replace('/(.*)(\?|&#038;)' . $key . '=[^&#038;]+?(&#038;)(.*)/i', '$1$2$4', $url . '&#038;'); $url = substr($url, 0, -1); if (strpos($url, '?') === false) { return ($url . '?' . $key . '=' . $value); } else { return ($url . '&#038;' . $key . '=' . $value); } }
</p></div>
<p>Print Pager is called like so:<br />
<?php printPager($max_pages, $pg); ?></p>
<h2 style="font-size:1em;">PHP Pager Styles</h2>
<div style="font-size:0.9em;">
We can style this pager using the following:<br />
/*pagers*/</p>
<p>div.clear{clear:both;}<br />
/spacing between numbers and sizes<br />
ul.pager li {<br />
	float:left;<br />
	margin-right:5px;<br />
	font-size:8pt;<br />
	padding: 2px 5px 2px 5px;<br />
}</p>
<p>//link color<br />
ul.pager li a{<br />
	color:red;<br />
}</p>
<p>//link hover style<br />
ul.pager li a:hover{<br />
	text-decoration:underline;<br />
	color:red;<br />
}</p>
<p>//current page styling<br />
ul.pager li.current span{<br />
	color:red;<br />
}</p>
<p>//previous and next stylings<br />
ul.pager li.prev, ul.pager li.next{</p>
<p>}
</p></div>
<p>Download this tutorials script! It will help you understand. Right click: <a href='http://theinfiniteloopblog.com/wp-content/uploads/2010/05/php-automatic-pagination-tutorial.php.txt'>php-automatic-pagination-tutorial.php</a> and click Save as. Then get rid of the .txt extension and name it php if you would like to run it. You will need to setup a database table to use for the tutorial. It can have an id field and another field.</p>
<p>If you enjoyed this post please leave a comment! I like reading and responding to all my readers!<br />
Thanks</p>
<p><a href="http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=aburningflame-"><img src="http://tracking.hostgator.com/img/Green/468x60.gif" border=0></a><br />
<strong>Use HostGator 2010 Coupon Code: <em>994offhgpackage</em> for $9.94 off your first month!<br />
(First month will cost $0.01)</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://theinfiniteloopblog.com/programming/php/paging-in-php-php-paging-tutorial/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Wallpaper/Image Gallery Tutorial using HTML/CSS</title>
		<link>http://theinfiniteloopblog.com/gen/wallpaperimage-gallery-tutorial-using-htmlcss/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=wallpaperimage-gallery-tutorial-using-htmlcss</link>
		<comments>http://theinfiniteloopblog.com/gen/wallpaperimage-gallery-tutorial-using-htmlcss/#comments</comments>
		<pubDate>Sun, 07 Jun 2009 06:41:51 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[beginner css]]></category>
		<category><![CDATA[css design]]></category>
		<category><![CDATA[css layout]]></category>
		<category><![CDATA[css techniques]]></category>
		<category><![CDATA[css tricks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tableless design]]></category>
		<category><![CDATA[tableless layout]]></category>
		<category><![CDATA[wallpaper gallery css]]></category>
		<category><![CDATA[wallpaper tutorial]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://scottmoniz.com/programmingBlog/?p=143</guid>
		<description><![CDATA[One of the most important things ive learned while learning about html and css is the power of the unordered list. I was making a wallpaper gallery for my Death Note website and asked on <a href="http://www.webdesignforums.net">Web Design Forums</a>.net the best way to go about this. The answer I got changed the way I design and the way I layout my sites.]]></description>
			<content:encoded><![CDATA[
<!-- ALL ADSENSE ADS DISABLED -->
<p>One of the most important things ive learned while learning about html and css is the power of the unordered list. I was making a wallpaper gallery for my Death Note website and asked on <a href="http://www.webdesignforums.net">Web Design Forums</a>.net the best way to go about this. The answer I got changed the way I design and the way I layout my sites.</p>
<p>I'd like to thank Shadowfiend for showing me this technique. Learning it has changed the way i design. Check out his blog here: <a href="http://shadowfiend.posterous.com/">Shadowfiend</a> | <a href="http://shadowfiend.posterous.com/">http://shadowfiend.posterous.com/</a></p>
<p>Unordered lists are a familiar topic of study in beginner html courses, however the markup often looks like</p>
<p>&lt;h1&gt;Fruits&lt;/h1&gt;<br />
&lt;ul&gt;<br />
&lt;li&gt;Apples&lt;/li&gt;<br />
&lt;li&gt;Bananas&lt;/li&gt;<br />
&lt;li&gt;Oranges&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>However, this is not the only way to use them, nor is it the most powerful.<br />
The unordered list is often used many times with Menus (both vertical and horizontal) as well as with image galleries.<br />
I'm not going to show you the menu, because the wallpaper effect is harder, and if you learn it, you'll easily be able to make a menu.<br />
For this, we are going to use any image. Find one on <a href="http://images.google.ca/images?hl=en&amp;q=wallpaper&amp;btnG=Search+Images&amp;gbv=2&amp;aq=f&amp;oq=">Google Images Search</a>.<br />
Alright now that we have our wallpaper, we will use a layout we created in my last post. If you want, you can go there and download layoutfooter.html, if you are comfortable with css you can just continue reading.</p>
<p>Now, between &lt;div id="content"&gt; we will add an unordered list as so...</p>
<p>&lt;ul class="gallery"&gt;<br />
&lt;li&gt;Image1&lt;/li&gt;<br />
&lt;li&gt;Image2&lt;/li&gt;<br />
&lt;li&gt;Image3&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>For now, dont use actual images, well use those after.<br />
The first thing you may notice previewing these in your browser is that there are bullets. This is the default behavior of the unordered list.<br />
We will take these off.</p>
<p>Between  your &lt;style&gt; tags, add these rules:<br />
ul.gallery{<br />
width: 100%; /*this can be changed, its at 80% for better visualization at the moment*/<br />
list-style-type: none;<br />
overflow: hidden; /*helps fix certain issues*/<br />
border: 1px solid blue; /*this helps us visualize while were laying out, this will be removed in the final product*/<br />
}</p>
<p>Alright, now that we have styled our outer container, lets style our list items.</p>
<p>ul.gallery li{<br />
border: 1px solid red; /*visualization*/<br />
float: left; /* what this does is place each li out of normal flow, and as far left as it can. Since each li is floated left they will sit next to each other*/<br />
width: 30%; /*set a width*/<br />
height: 190px; /*set the row-height(actually the li height, but it simulates row height)*/<br />
}</p>
<p>Heres what you should have at the moment (your list items will be higher)</p>
<div id="attachment_145" class="wp-caption aligncenter" style="width: 310px"><a href="http://theinfiniteloopblog.com/wp-content/uploads/2009/06/wp_tut1.jpg"><img class="size-medium wp-image-145" title="wp_tut1" src="http://scottmoniz.com/programmingBlog/wp-content/uploads/2009/06/wp_tut1-300x171.jpg" alt="Wallpaper CSS Layout Tutorial 1" width="300" height="171" /></a><p class="wp-caption-text">Wallpaper CSS Layout Tutorial 1</p></div>
<p>The list items are right next to each other. We can add a margin-left on the li items to solve this. Lets do that now.</p>
<p>ul.gallery li{<br />
/* keep all existing rules */<br />
margin-left: 2%;<br />
}</p>
<p>You can work in px, or %. If your working in a fixed width layout, it does not really matter.  If you refresh and take a look, you'll notice were looking a lot better. Now, lets add our actual images.</p>
<p>Your unordered list will now look like this:</p>
<p>&lt;ul class="gallery"&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper1"/&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper2"/&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper3"/&gt;&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>Dont worry about the images sticking out...we will fix this.<br />
Ideally, you should have a full size image, and a thumbnail image. This allows for faster load times.<em> By reducing the size of a pictures height and width in css, you do NOT reduce the load time, the full image is loaded, and then scaled, so best practice = have 2 sizes!</em></p>
<p>now we will add rules to style our image</p>
<p>ul.gallery li img{<br />
display: block;<br />
margin: 0 auto;<br />
width: 180px;<br />
height: 150px;<br />
border: 1px solid #ccc; /*border effect*/<br />
padding: 2px 8px 10px 8px; /*padding +border gives a nice effect*/<br />
margin-bottom: 2px; /*push the next item below me down 2 pixels*/<br />
}</p>
<p>You'll notice theres a little space beneath the image, dont get rid of it! We have plans for this <img src='http://theinfiniteloopblog.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Also, a lot of the above was included because it looked nice. All of the above are optional, the image would just be aligned left with no padding/border.</p>
<p>Modify your markup so it looks like this</p>
<p>&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 1&lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 2&lt;/p&gt;&lt;/li&gt; &lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 3&lt;/p&gt;&lt;/li&gt;</p>
<p>We will now style the p tag. Remember the margin-bottom on the img ? This will push this down 2pixels, so we have space <img src='http://theinfiniteloopblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ul.gallery li p{<br />
margin: 0 auto; /* center the box*/<br />
text-align: center; /* center the text within the box*/<br />
width: 192px; /*set a width for our label*/<br />
border: 1px solid #ccc;<br />
}</p>
<p>Copy and paste the li's. So that you double/triple them, like so.</p>
<p>&lt;ul class="gallery"&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 1&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 2&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 3&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 1&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 2&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 3&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 1&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 2&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 3&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 1&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 2&lt;/p&gt;&lt;/li&gt;<br />
&lt;li&gt;&lt;img src="wall.jpg" alt="Wallpaper 1"/&gt;&lt;p&gt;Wallpaper 3&lt;/p&gt;&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>Here you'll notice that the spacing between rows is none.<br />
We add this rule to  ul.gallery li{ margin-bottom: 5px;}</p>
<p>Now, take out the borders from ul.gallery and ul.gallery li And were done <img src='http://theinfiniteloopblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><!--adsense--></p>
<p>here is the full css<br />
-------------------------------------------------------------------------<br />
ul.gallery{<br />
width: 100%; /*this can be changed*/<br />
list-style-type: none;<br />
overflow: hidden; /*helps fix certain issues*/<br />
}</p>
<p>ul.gallery li{<br />
width: 30%;<br />
height: 190px; /*set the row-height(actually the li height, but it simulates row height)*/<br />
margin-left: 2%;<br />
margin-bottom: 5px;<br />
float: left;<br />
}</p>
<p>ul.gallery li img{<br />
display: block;<br />
margin: 0 auto;<br />
width: 180px;<br />
height: 150px;<br />
border: 1px solid #ccc; /*border effect*/<br />
padding: 2px 8px 10px 8px; /*padding +border gives a nice effect*/<br />
margin-bottom: 2px; /*push the next item below me down 2 pixels*/<br />
}</p>
<p>ul.gallery li p{<br />
border: 1px solid #ccc;<br />
width: 192px; /*set a width for our label*/<br />
text-align: center;<br />
margin: 0 auto;<br />
}</p>
<p>AND the final product:</p>
<div id="attachment_146" class="wp-caption aligncenter" style="width: 310px"><a href="http://theinfiniteloopblog.com/wp-content/uploads/2009/06/wp_tutfinal.jpg"><img class="size-medium wp-image-146" title="wp_tutfinal" src="http://theinfiniteloopblog.com/wp-content/uploads/2009/06/wp_tutfinal-300x214.jpg" alt="CSS Wallpaper Tutorial" width="300" height="214" /></a><p class="wp-caption-text">CSS Wallpaper Tutorial</p></div>
<p>Hope you enjoyed.<br />
Feel free to comment/make requests.</p>
<p>Download: <a href="http://theinfiniteloopblog.com/wp-content/uploads/2009/06/wallpaper_tut.html">wallpaper_tut.html</a></p>
<p>Right click and click Save Link As..to Download</p>
]]></content:encoded>
			<wfw:commentRss>http://theinfiniteloopblog.com/gen/wallpaperimage-gallery-tutorial-using-htmlcss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rounded Corners Using CSS Technique</title>
		<link>http://theinfiniteloopblog.com/xhtmlcss/rounded-corners-using-css-technique/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rounded-corners-using-css-technique</link>
		<comments>http://theinfiniteloopblog.com/xhtmlcss/rounded-corners-using-css-technique/#comments</comments>
		<pubDate>Thu, 07 May 2009 10:51:01 +0000</pubDate>
		<dc:creator>Scott</dc:creator>
				<category><![CDATA[XHTML/CSS]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css techniques]]></category>
		<category><![CDATA[css tricks]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://scottmoniz.com/programmingBlog/?p=82</guid>
		<description><![CDATA[This is a neat lil trick, that doesnt take to long to do, but makes a site look that much more professional. It works across browsers, and is used quite often. It may become obsolete once IE and other browsers decide to support the new set of CSS3 specs. Until then this is a good [...]]]></description>
			<content:encoded><![CDATA[
<!-- ALL ADSENSE ADS DISABLED -->
<p>This is a neat lil trick, that doesnt take to long to do, but makes a site look that much more professional.<br />
It works across browsers, and is used quite often.<br />
It may become obsolete once IE and other browsers decide to support the new set of CSS3 specs. Until then this is a good technique to depend on. If designing for Mozilla based browsers, there is a css property in the making named border-radius.<br />
-moz-border-radius will allow you to set a rounded border on any block object.</p>
<p>This technique however, involves using 4 images and 3 divs.<br />
Here are the images we will be using:</p>
<p><img class="alignleft size-full wp-image-83" title="tl" src="http://coulditgetworse.com/theinfiniteloopblog/wp-content/uploads/2009/05/tl.gif" alt="tl" width="16" height="16" />Top Left<br />
<img class="alignleft size-full wp-image-86" title="tr1" src="http://coulditgetworse.com/theinfiniteloopblog/wp-content/uploads/2009/05/tr1.gif" alt="tr1" width="16" height="16" />Top Right</p>
<p><img class="alignleft size-full wp-image-85" title="bl" src="http://coulditgetworse.com/theinfiniteloopblog/wp-content/uploads/2009/05/bl.gif" alt="bl" width="16" height="16" />Bottom Left<br />
<img class="alignleft size-full wp-image-88" title="br" src="http://coulditgetworse.com/theinfiniteloopblog/wp-content/uploads/2009/05/br.gif" alt="br" width="16" height="16" />Bottom Right</p>
<p><strong>Open up notepad, or notepad++, or whichever editor you use.<br />
Type</strong></p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Rounded Corner Tutorial&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;body&gt;<br />
&lt;html&gt;</p>
<p><strong>In the head section add:</strong><br />
&lt;style&gt;<br />
body{background-color: #e0e0e0;} //these are zeros not o's<br />
&lt;/style&gt;</p>
<p>Save as .html and view it in your browser. You should have a gray page.<br />
<strong>Now, between your body tags type this</strong></p>
<p>&lt;div id="roundDiv"&gt;<br />
This is the content<br />
&lt;/div&gt;</p>
<p><strong>And add this to your style definition</strong><br />
#roundDiv{background-color: white; width: 800px;}</p>
<p>Now, previewing in browser you should see a gray page with a white div containing the words "this is content".</p>
<p>We are going to add a div to roundDiv. Since this is the first item in round div, it starts at the top left corner.<br />
In this top div, we will add the image for the top left corner.<br />
<strong>Add this to roundDiv <em>Before</em> "this is content"</strong><br />
&lt;div class="roundTop"&gt;&lt;img src="tl.gif" class="corner"/&gt;&lt;/div&gt;</p>
<p>After this line would come the content.<br />
<strong>Add this to roundDiv <em>After</em> "this is content"</strong><br />
This holds your bottom left image</p>
<p>&lt;div class="roundBot"&gt;&lt;img src="bl.gif" class="corner"/&gt;&lt;/div&gt;</p>
<p><strong>Now, between your style tags add this definition</strong><br />
.corner{display: block; width: 16px; height: 16px;} //use your actual values here, for this example our images are 16x16</p>
<p><strong>So far our html page should look like this:</strong></p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;style&gt;<br />
body{background-color: #e0e0e0;}<br />
#roundDiv{width: 800px; background-color: white;}<br />
.corner{display: block; width: 16px; height: 16px;}<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div id="roundDiv"&gt;<br />
&lt;div class="roundTop"&gt;&lt;img src="tl.gif" class="corner"/&gt;&lt;/div&gt;<br />
This is content<br />
&lt;div class="roundBot"&gt;&lt;img src="bl.gif" class="corner"/&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>If you preview this in your browser you should see a white div, with rounded corners on the left side.<br />
This in itself is a neat div and you don't have to add the right corners. This effect is good in itself.</p>
<p>To get the rounded corners we really want, we are gonna set a background image on the top and bottom divs.<br />
We will set a background image url, set it to not repeat/tile, and set its position accordingly.</p>
<p><strong>To your style tags add this definition for the top right corner</strong><br />
.roundTop{<br />
background-image: url('tr.gif');<br />
background-repeat: no-repeat;<br />
background-position: top right; // specify to align top, and to the right of the div<br />
}</p>
<p><strong>Now for the bottom right corner</strong><br />
.roundBottom{<br />
background-image: url('br.gif');<br />
background-repeat: no-repeat;<br />
background-position: bottom right; // specify to align bottom, and to the right of the div<br />
}<br />
<strong>Your entire html file should look like this:</strong></p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;style&gt;<br />
body{background-color: #e0e0e0;}<br />
#roundDiv{width: 800px; background-color: white;}<br />
.corner{display: block; width: 16px; height: 16px;}<br />
.roundTop{<br />
background-image: url('tr.gif');<br />
background-repeat: no-repeat;<br />
background-position: top right; // specify to align top, and to the right of the div<br />
}<br />
.roundBot{<br />
background-image: url('br.gif');<br />
background-repeat: no-repeat;<br />
background-position: bottom right; // specify to align top, and to the right of the div<br />
}<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div id="roundDiv"&gt;<br />
&lt;div class="roundTop"&gt;&lt;img src="tl.gif" class="corner"/&gt;&lt;/div&gt;<br />
This is content<br />
&lt;div class="roundBot"&gt;&lt;img src="bl.gif" class="corner"/&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>This is the result (low-quality pic):<br />
<img class="aligncenter size-full wp-image-102" title="final1" src="http://coulditgetworse.com/theinfiniteloopblog/wp-content/uploads/2009/05/final1.jpg" alt="final1" width="815" height="62" /></p>
<p>And there you have it, easy rounded corners!</p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://theinfiniteloopblog.com/xhtmlcss/rounded-corners-using-css-technique/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

