<?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>Argee &#187; Tutorials</title>
	<atom:link href="http://www.argee.org/tag/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.argee.org</link>
	<description>Personal Blog, Design, Development and Programming</description>
	<lastBuildDate>Tue, 18 May 2010 21:16:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Tutorial: The Display Property</title>
		<link>http://www.argee.org/old-blog/the-display-property/</link>
		<comments>http://www.argee.org/old-blog/the-display-property/#comments</comments>
		<pubDate>Sun, 08 Mar 2009 01:15:05 +0000</pubDate>
		<dc:creator>RG</dc:creator>
				<category><![CDATA[Old Blogs]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.argee.org/?p=207</guid>
		<description><![CDATA[This tutorial introduces the display property that can be applied to elements via CSS. I will also be using some techniques from the hover tutorial, so you might want to read that first &#8211; it is, however, not compulsory.
The display property determines how an element is displayed, or whether it is displayed at all. While [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial introduces the display property that can be applied to elements via CSS. I will also be using some techniques from the <a href="http://www.argee.org/css-tutorials/css-tutorial-hover-selectors/">hover tutorial</a>, so you might want to read that first &#8211; it is, however, not compulsory.</p>
<p>The display property determines how an element is displayed, or whether it is displayed at all. While there are 17 possible values, I will only be focusing on three &#8211; block, inline and none. Personally, I feel that the last value of none is the most important of the three. However, an understanding of the first two properties is needed to utilize its full potential.</p>
<h3><em>1.</em> Display an element as a block</h3>
<p>Quite simply, applying this property to an element means that the element will be displayed as a block level element, with a line break before and after the element. This is commonly applied to inline elements so that they respect other properties given to them. (such as absolute positioning)</p>
<p>Given the following link, which is inline by default:</p>
<p><a name="code" class="css"><br />
&lt;a id=&quot;my-link&quot;&gt;Hi, I am a link!&lt;/a&gt;<br />
</a></p>
<p>We can apply the display block property as follows:</p>
<p><a name="code" class="css"><br />
/* Style for the link */<br />
#my-link {<br />
	display: block;<br />
}</a></p>
<p>Note that applying such a style will only make a difference if other properties have to be applied to the link which are not respected by inline elements.</p>
<h3><em>2.</em> Display an element as inline</h3>
<p>Pretty much the same concept as above, except for the fact that we are now displaying the element as inline &#8211; there will be no line breaks and the element will not respect certain properties, such as positioning. This is usually the default for most elements, so no CSS is required unless overriding a previous property.</p>
<h3><em>3.</em> Hiding and displaying an element</h3>
<p>This is where the display none property comes in &#8211; we can use it to display or hide elements under certain conditions, on hover for example. Since I have already done a tutorial on the nuances of the hover selector, I will not be going through them again.</p>
<p>Since an element which is hidden cannot be hovered over, we generally use the parent-child relationship of elements to make this work. Javascript may also be used for this purpose, but it is far more cumbersome, especially if you are already using an external CSS file. Given the following HTML:</p>
<p><a name="code" class="css"><br />
&lt;div id=&quot;parent&quot;&gt;<br />
	&lt;div id=&quot;child&quot;&gt;<br />
	Hidden text!<br />
	&lt;/div&gt;<br />
&lt;/div&gt;<br />
</a></p>
<p>We can use the following CSS to achieve the desired effect:</p>
<p><a name="code" class="css"><br />
/* Style when no hover */<br />
#parent #child {<br />
	display: none;<br />
}</a></p>
<p><a name="code" class="css"><br />
/* Style when mouse-overed */<br />
#parent:hover #child {<br />
	display: block;<br />
}</a></p>
<p>If the parent div is empty, it will not be visible. To make sure the parent div can be seen and hovered over, use the following CSS:</p>
<p><a name="code" class="css"><br />
/* Style for parent div */<br />
#parent {<br />
	height: 40px;<br />
	width: 60px;<br />
	background-color: #ccc;<br />
}</a></p>
<p>That&#8217;s all you need to know &#8211; anything beyond these basics should be quite simple if you understand this property. Hopefully you will take what you&#8217;ve learned from this and let your imagination run wild!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.argee.org/old-blog/the-display-property/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CSS Tutorial: Hover Selectors</title>
		<link>http://www.argee.org/old-blog/hover-selectors/</link>
		<comments>http://www.argee.org/old-blog/hover-selectors/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 17:42:35 +0000</pubDate>
		<dc:creator>RG</dc:creator>
				<category><![CDATA[Old Blogs]]></category>
		<category><![CDATA[Css]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.argee.org/?p=200</guid>
		<description><![CDATA[I decided to bring this tutorial back from the grave since people seemed to like it. This one is pretty simple, we will just be walking through the nuances of the :hover selector in CSS.
This selector, like most styles, can be applied to absolutely any HTML element in your web page to create a rollover [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to bring this tutorial back from the grave since people seemed to like it. This one is pretty simple, we will just be walking through the nuances of the :hover selector in CSS.</p>
<p>This selector, like most styles, can be applied to absolutely any HTML element in your web page to create a rollover effect. A lot of people still use javascript to do this, which works but is deprecated. In other words, this is the ninja way to do things.</p>
<h3><em>1.</em> Applying hover to a link element</h3>
<p>Say that you have the following element in your web page, just a basic link with the id &#8216;my-link&#8217;.</p>
<p><a name="code" class="css"><br />
&lt;a id=&quot;my-link&quot;&gt;Hi, I am a link!&lt;/a&gt;<br />
</a></p>
<p>The id tag lets us apply a style specifically to this element &#8211; a web page may only have one instance of a given id, which means you can&#8217;t give the id of &#8216;my-link&#8217; to any more elements on your page. Let the link given above be the one we will be styling.</p>
<p>Now, to apply the actual hover effect, you would put the following code in your CSS &#8211; which should preferably be an external stylesheet.</p>
<p><a name="code" class="css"><br />
/* Style when no hover */<br />
#my-link {<br />
	color: #ccc;<br />
	text-decoration: none;<br />
}</a></p>
<p><a name="code" class="css"><br />
/* Style when mouse-overed */<br />
#my-link:hover {<br />
	color: #000;<br />
	text-decoration: underline;<br />
}<br />
</a></p>
<p>This will give you a basic text link that changes color and is underlined upon mouse over. Not good enough for you? Well, read on over to the next section&#8230;</p>
<h3><em>2.</em> Applying hover to a div element</h3>
<p>What&#8217;s great about cascading style is it&#8217;s versatility &#8211; it can be applied to any kind of element to change it&#8217;s appearance in various ways. Let the following be the div element that you wish to apply styling to:</p>
<p><a name="code" class="css"><br />
&lt;div id=&quot;my-div&quot;&gt;Hi, I am a div!&lt;/div&gt;<br />
</a></p>
<p>I will give you a basic example, keep in mind that which styles you apply is totally up to you.</p>
<p><a name="code" class="css"><br />
/* Style when no hover */<br />
#my-div {<br />
	color: #ccc;<br />
	background-color: #fff;<br />
	text-decoration: none;<br />
	font-family: Georigia, serif;<br />
	padding: 5px;<br />
}</a></p>
<p><a name="code" class="css"><br />
/* Style when mouse-overed */<br />
#my-div:hover {<br />
	color: #000;<br />
	background-color:#ddd;<br />
	text-decoration: underline;<br />
	border: 1px solid #000;<br />
}</a></p>
<p>This should give you a div element that changes in appearance when hovered over. Of course, these are only example styles &#8211; you may choose to apply a different, better styling to your elements.</p>
<p>Note that while we only experimented with &lt;a&gt; and &lt;div&gt; tags here, the hover selector can be used for styling any HTML tags.</p>
<p>Well, that was all. Not too tough, was it? Hope you enjoy your new-found skills!</p>
<h3>A note about pre-loading images</h3>
<p>Maybe you&#8217;re one of those people who don&#8217;t like to see the short lived flicker that occurs when you hover your image links &#8211; the time the browser takes to load the rollover image. There are ways around that too, my favorite being the background positioning technique. You can read more about that <a target="_blank" rel="nofollow" href="http://wellstyled.com/css-nopreload-rollovers.html">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.argee.org/old-blog/hover-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tutorial: Using CSS For Image Descriptions</title>
		<link>http://www.argee.org/old-blog/tutorial-using-css-for-image-descriptions/</link>
		<comments>http://www.argee.org/old-blog/tutorial-using-css-for-image-descriptions/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 15:46:35 +0000</pubDate>
		<dc:creator>RG</dc:creator>
				<category><![CDATA[Old Blogs]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.deepsarcasm.com/?p=205</guid>
		<description><![CDATA[I was planning on writing this one quite a while ago, but I got a little busy and it slipped my mind. Sorry about that! Well, here it is at last, the tutorial that will show you how to display the summary of an image when it is hovered over &#8211; for example, the website [...]]]></description>
			<content:encoded><![CDATA[<p>I was planning on writing this one quite a while ago, but I got a little busy and it slipped my mind. Sorry about that! Well, here it is at last, the tutorial that will show you how to display the summary of an image when it is hovered over &#8211; for example, the website thumbnails in <a href="http://www.deepsarcasm.com/the-link-gallery/" target="_blank">the link gallery</a>.</p>
<h3>Getting Started</h3>
<p>Before doing anything else, you must first decide on a fixed size for your image, or images. All subsequent images that need a hover description using the same CSS should have the same size as the first one, because we will be basing our measurements off of it.</p>
<p>For this tutorial, I will be using the scaled down image of a cloudy sky from <a href="http://www.sxc.hu/home" target="_blank">stock.xchng</a>, the free stock photo resource. This is what the original image looks like when resized to 300&#215;200 pixels:</p>
<div><img id="captionize" align="middle" class="size-medium wp-image-212" title="Cloudy Sky" src="http://www.deepsarcasm.com/wp-content/uploads/2008/08/tut_cloudimg.jpg" alt="The Original Image" width="300" height="200" /></div>
<h3>Preparing The HTML</h3>
<p>The thing with CSS is that when using it for styling, there has to be something to apply the style to. Assuming all your images are not the same size and you want this effect on only a select few, we will enclose the image &#8211; along with the summary &#8211; in nested div elements.</p>
<p>Here is what my code looks like, and what yours should resemble:</p>
<p><a class="html" name="code">&lt;div class=&quot;imageshell&quot;&gt;<br />
&lt;a href=&quot;your-url-here&quot;&gt;&lt;span&gt;<br />
&lt;img width=&quot;300&quot; height=&quot;200&quot; alt=&quot;Cloudy Sky&quot;<br />
src=&quot;wp-content/uploads/2008/08/tut_cloudimg.jpg&quot; /&gt;<br />
&lt;div&gt;<br />
This is a caption for this image, which depicts white clouds<br />
against a beautiful blue sky. This space, besides containing text,<br />
can also house other media &#8211; you can even treat it like a small<br />
individual web page (within limits, of course).<br />
&lt;/div&gt;<br />
&lt;/span&gt;&lt;/a&gt;<br />
&lt;/div&gt;</a></p>
<h3>Styling It With CSS</h3>
<p>Okay, here&#8217;s the part you&#8217;ve been waiting for &#8211; here&#8217;s where the fun of making it work begins. Now before you pull out your stylesheet, I need to remind you that this code is based off the size of the image you are using, and you may have to modify it to suit your needs. With that out of the way, here&#8217;s the magic recipe:</p>
<p><a class="css" name="code"><br />
.imageshell{<br />
	width:300px;<br />
	height:200px;<br />
	text-align:left;<br />
}<br />
.imageshell a:hover div {<br />
	color:#333333;<br />
	display:block;<br />
}<br />
.imageshell div {<br />
	background-color:#F3EBCC;<br />
	display:none;<br />
	width:290px;<br />
	height:190px;<br />
	position:relative;<br />
	padding:5px;<br />
	left:0px;<br />
	top:-200px;<br />
}</a>You will notice that the size of the inner div is smaller than the image by 10px each on height and width (or 5px on each side) &#8211; this allows the padding to expand it to fill the image. Of course, you are free to modify any part of the code as you please, for example changing colors, sizes and padding. Some modifications may break it, but that depends on what you are trying to do.</p>
<p><strong>Note:</strong> The most probable thing you will need to tweak is the top and left attributes in the style for the inner div. This is because it depends on the default border and padding settings on your image from the pre-existing CSS.</p>
<h3>The Final Product</h3>
<p>I&#8217;ve removed the example that was here for W3C reasons, you will find the end product in the link gallery. Leave a comment if you have any issues. <a href="http://www.deepsarcasm.com/the-link-gallery/">Demo here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.argee.org/old-blog/tutorial-using-css-for-image-descriptions/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Tutorial: CSS Rollovers As Anchors</title>
		<link>http://www.argee.org/old-blog/tutorial-css-rollovers-as-anchors/</link>
		<comments>http://www.argee.org/old-blog/tutorial-css-rollovers-as-anchors/#comments</comments>
		<pubDate>Thu, 31 Jul 2008 10:29:51 +0000</pubDate>
		<dc:creator>RG</dc:creator>
				<category><![CDATA[Old Blogs]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.deepsarcasm.com/?p=178</guid>
		<description><![CDATA[This tutorial is for those who want to give their visitors a simple way to navigate to different places on the same page. For example, a link at the bottom that sends you to the top of the page &#8211; especially helpful on long pages, where no one wants to do the scrolling. You will [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial is for those who want to give their visitors a simple way to navigate to different places on the same page. For example, a link at the bottom that sends you to the top of the page &#8211; especially helpful on long pages, where no one wants to do the scrolling. You will need a very basic knowledge of HTML, the will to brave messing with your source code, and a couple of images (if you want an image link).</p>
<h3>Step 1 &#8211; Doing it without the images</h3>
<p>We&#8217;re starting off with the simple concept of anchors &#8211; links that link to links that link to nothing. Okay, maybe I need to explain that&#8230;an anchor, by itself, is something that exists for the sole purpose of marking a position on a webpage. Then, you can link to that anchor, which will essentially send anyone who clicks the link to the position defined by the anchor. Still don&#8217;t get it? Let&#8217;s go hands on.</p>
<p>First off, put this line of code right after your &lt;body&gt; tag:</p>
<p><a name="code" class="html">&lt;a name=&quot;top&quot; /&gt;</a></p>
<p>This defines the very beginning of your document as the location of the &#8220;top&#8221; anchor. Next, let&#8217;s try linking to it &#8211; put the following code where you want your &#8220;Back to top&#8221; link to appear (you can change the text, of course):</p>
<p><a name="code" class="html">&lt;a href=&quot;#top&quot;&gt;Back to top&lt;/a&gt;</a></p>
<p>The &#8216;#&#8217; in there tells your browser that this link is pointing to an anchor and not to an independent URL. After you&#8217;re done, try clicking the link. Does it work? If it doesn&#8217;t, go back and try again. :P</p>
<h3>Step 2 &#8211; CSSing it up + images</h3>
<p>Before we go any further, you will need to grab a couple of images: one will be the active link, and the other image will appear when the user hovers the mouse over that link. Let&#8217;s say one of the images is named link_normal.gif and the other one is link_hover.gif &#8211; note that they must be of the same dimensions, in this case let&#8217;s assume they are both 220px by 50px.</p>
<p>All you have to do to your actual code at this point, is to include the following code where the link is to appear:</p>
<p><a name="code" class="html">&lt;a href=&quot;#top&quot; class=myanchorlink&gt;&lt;/a&gt;</a></p>
<p>Comparing this code to the above without-images HTML, you may notice that there isn&#8217;t that much of a difference &#8211; all you did was replace the text with a div element. But where is the image, you ask? Well, we&#8217;re going to implement that now.</p>
<p>All the real magic will take place in your CSS file. I hope you know where your CSS file is &#8211; in case you don&#8217;t, you can always view your source and find it. For WordPress the CSS file is style.css in your current theme&#8217;s folder. After you find it, add the following code to the end.</p>
<p><a name="code" class="html">.myanchorlink{<br />
	width: 220px;	//use your own image&#8217;s width!<br />
	height: 50px;	//use your own image&#8217;s height!<br />
	background: url(images/link_normal.gif);	//your image url<br />
	cursor: pointer;<br />
	display: block;<br />
}<br />
.myanchorlink:hover{<br />
	background: url(images/link_hover.gif);<br />
}<br />
</a></p>
<p>Voila! You&#8217;re done. Unless you copy-pasted my code without modifications, it should be working fine. If you did just copy-paste my code, it might not work because this is a tutorial that simply gives you an example to modify and implement with your own images.</p>
<p>If you have any problems, drop me a line and I&#8217;ll try to help you out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.argee.org/old-blog/tutorial-css-rollovers-as-anchors/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
