<?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; Css</title>
	<atom:link href="http://www.argee.org/tag/css/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>
	</channel>
</rss>
