<?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>JaffnaCampus.com &#187; CSS Advanced</title>
	<atom:link href="http://jaffnacampus.com/category/css/css-advanced/feed/" rel="self" type="application/rss+xml" />
	<link>http://jaffnacampus.com</link>
	<description>Gateway to your IT potential</description>
	<lastBuildDate>Tue, 27 Sep 2011 13:57:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Summary</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-summary/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-summary/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:53:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Summary]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=192</guid>
		<description><![CDATA[You Have Learned CSS, Now What?
This tutorial has taught you how to create style sheets to control   the [...]]]></description>
			<content:encoded><![CDATA[<h2>You Have Learned CSS, Now What?</h2>
<p>This tutorial has taught you how to create style sheets to control   the style   and layout of multiple web sites at once.</p>
<p>You have learned how to use CSS to add backgrounds, format text,   add and format borders, and specify padding and margins of elements.</p>
<p>You have also learned how to position an element, control the   visibility and   size of an element, set the shape of an element, place an element behind     another, and to add special effects to some selectors, like links.</p>
<p>For more information on CSS, please take a look at our <a href="http://JaffnaCampus.com/css/css-reference"> CSS reference</a>.</p>
<hr />
<h2>Now You Know CSS, What&#8217;s Next?</h2>
<p>The next step is to learn XHTML and JavaScript.</p>
<p><strong>XHTML</strong></p>
<p>XHTML reformulates HTML 4.01 in XML.</p>
<p>If you want to learn more about XHTML, please   visit our <a href="http://JaffnaCampus.com/xhtml/">XHTML   tutorial</a>.</p>
<p><strong>JavaScript</strong></p>
<p>JavaScript can   make your web site more dynamic.</p>
<p>A static web site is nice when you just want to show flat content,   but a dynamic   web site can react to events and allow user interaction. </p>
<p>JavaScript is the most popular scripting language on the internet and   it   works with all major browsers.</p>
<p>If you want to learn more about JavaScript, please   visit our <a href="http://JaffnaCampus.com/javascript/">JavaScript   tutorial</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-summary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Do Not</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-do-not/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-do-not/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:49:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Don't]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=190</guid>
		<description><![CDATA[Here are some technologies you should try to avoid when   using CSS.

Internet Explorer Behaviors
What is it? Internet Explorer [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some technologies you should try to avoid when   using CSS.</p>
<hr />
<h2>Internet Explorer Behaviors</h2>
<p><strong>What is it? </strong>Internet Explorer 5 introduced behaviors.   Behaviors are a way to add behaviors to HTML elements with the use of   CSS styles.</p>
<p><strong>Why avoid it?</strong> The behavior attribute is only supported by   Internet Explorer.</p>
<p><strong>What to use instead? </strong>Use JavaScript and the HTML DOM instead.</p>
<hr />
<h2>Example 1 &#8211; Mouseover Highlight</h2>
<p>The following HTML file has a &lt;style&gt; element that defines a   behavior for the &lt;h1&gt; element:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
        &lt;head&gt;<br />
        &lt;style type=&quot;text/css&quot;&gt;<br />
        h1 { behavior:url(behave.htc); }<br />
        &lt;/style&gt;<br />
        &lt;/head&gt;</p>
<p>        &lt;body&gt;<br />
        &lt;h1&gt;Mouse over me!!!&lt;/h1&gt;<br />
        &lt;/body&gt;<br />
        &lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>The XML document &quot;behave.htc&quot; is shown below:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example (IE 5+ Only)</h2>
<p>The behavior file contains a JavaScript and event handlers for the   elements.</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;attach for=&quot;element&quot; event=&quot;onmouseover&quot; handler=&quot;hig_lite&quot; /&gt;<br />
                &lt;attach for=&quot;element&quot; event=&quot;onmouseout&quot; handler=&quot;low_lite&quot; /&gt;</p>
<p>                &lt;script type=&quot;text/javascript&quot;&gt;<br />
                function hig_lite()<br />
                {<br />
                element.style.color=&#8217;red&#8217;;<br />
                }</p>
<p>                function low_lite()<br />
                {<br />
                element.style.color=&#8217;blue&#8217;;<br />
                }<br />
                &lt;/script&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<hr />
<h2>Example 2 &#8211; Typewriter Simulation</h2>
<p>The following HTML file has a &lt;style&gt; element that defines a   behavior for elements with an id of &quot;typing&quot;:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
        &lt;head&gt;<br />
        &lt;style type=&quot;text/css&quot;&gt;<br />
        #typing<br />
        {<br />
        behavior:url(behave_typing.htc);<br />
        font-family:&quot;courier new&quot;;<br />
        }<br />
        &lt;/style&gt;<br />
        &lt;/head&gt;</p>
<p>        &lt;body&gt;<br />
        &lt;span id=&quot;typing&quot; speed=&quot;100&quot;&gt;IE5 introduced DHTML behaviors.<br />
        Behaviors are a way to add DHTML functionality to HTML elements<br />
        with the ease of CSS.&lt;br /&gt;&lt;br /&gt;How do behaviors   work?&lt;br /&gt;<br />
        By using XML we can link behaviors to any element in a web page<br />
        and manipulate that element.&lt;/p&gt;<br />
        &lt;/span&gt;<br />
        &lt;/body&gt;<br />
        &lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>The XML document &quot;typing.htc&quot; is shown below:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example (IE 5+ Only)</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;attach for=&quot;window&quot; event=&quot;onload&quot; handler=&quot;beginTyping&quot; /&gt; <br />
                &lt;method name=&quot;type&quot; /&gt;</p>
<p>                &lt;script type=&quot;text/javascript&quot;&gt; <br />
                var i,text1,text2,textLength,t;</p>
<p>                function beginTyping()<br />
                {<br />
                i=0;<br />
                text1=element.innerText;<br />
                textLength=text1.length;<br />
                element.innerText=&quot;&quot;;<br />
                text2=&quot;&quot;;<br />
                t=window.setInterval(element.id+&quot;.type()&quot;,speed);<br />
                }</p>
<p>                function type()<br />
                {<br />
                text2=text2+text1.substring(i,i+1);<br />
                element.innerText=text2;<br />
                i=i+1;<br />
                if (i==textLength)<br />
                {<br />
                clearInterval(t);<br />
                }<br />
                }<br />
                &lt;/script&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-do-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Attribute Selectors</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-attribute-selectors/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-attribute-selectors/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:47:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Attribute Selectors]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=188</guid>
		<description><![CDATA[Style HTML Elements With Specific Attributes
It is possible to style HTML elements that have specific attributes,   not just [...]]]></description>
			<content:encoded><![CDATA[<h2>Style HTML Elements With Specific Attributes</h2>
<p>It is possible to style HTML elements that have specific attributes,   not just   class and id.</p>
<p><strong>Note:</strong> Internet Explorer 7 (and higher) supports attribute   selectors   only if a !DOCTYPE is specified. Attribute selection is <strong>NOT</strong> supported in IE6 and lower.</p>
<hr />
<h2>Attribute Selector</h2>
<p>The example below styles all elements with a title attribute:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> [title]<br />
                {<br />
                color:blue;<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Attribute and Value Selector</h2>
<p>The example below styles all elements with title=&quot;W3Schools&quot;:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> [title=W3Schools]<br />
                {<br />
                border:5px solid green;<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Attribute and Value Selector &#8211; Multiple Values</h2>
<p>The example below styles all elements with a title attribute that   contains a   specified value. This works even if the attribute has space separated   values:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> [title~=hello]  {  color:blue;  }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>The example below styles all elements with a lang attribute that   contains a   specified value. This works even if the attribute has hyphen ( &#8211; )   separated values:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> [lang|=en]  {  color:blue;  } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Styling Forms</h2>
<p>The attribute selectors are particularly useful for styling forms   without   class or ID:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> input[type=&quot;text&quot;]<br />
                {<br />
                width:150px;<br />
                display:block;<br />
                margin-bottom:10px;<br />
                background-color:yellow;<br />
                }<br />
                input[type=&quot;button&quot;]<br />
                {<br />
                width:120px;<br />
                margin-left:35px;<br />
                display:block;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-attribute-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Media Types</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-media-types/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-media-types/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:46:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Media Types]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=186</guid>
		<description><![CDATA[Media Types allow you to specify how documents will be   presented  in different media. The document can [...]]]></description>
			<content:encoded><![CDATA[<p>Media Types allow you to specify how documents will be   presented  in different media. The document can be displayed differently on the   screen, on  the paper, with an aural browser, etc. </p>
<hr />
<h2>Media Types</h2>
<p>Some CSS properties are only designed for a certain   media. For example the  &quot;voice-family&quot; property is designed for aural user agents. Some other  properties can be used for different media types. For example, the  &quot;font-size&quot; property can be used for both screen and print media, but  perhaps with different values. A document usually needs a larger   font-size on a  screen than on paper, and sans-serif fonts are easier to read on the   screen, while  serif fonts are easier to read on paper.</p>
<hr />
<h2>The @media Rule</h2>
<p>The @media rule allows different style rules for different media in   the same style sheet.</p>
<p>The style in the example below tells the browser to display a 14   pixels  Verdana font on the screen. But if the page is printed, it will be in a   10  pixels Times font. Notice that the font-weight is set to bold, both on   screen  and on paper:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
        &lt;head&gt;<br />
        &lt;style&gt;<br />
        @media screen<br />
        {<br />
        p.test {font-family:verdana,sans-serif;font-size:14px;}<br />
        }<br />
        @media print<br />
        {<br />
        p.test {font-family:times,serif;font-size:10px;}<br />
        }<br />
        @media screen,print<br />
        {<br />
        p.test {font-weight:bold;}<br />
        }<br />
        &lt;/style&gt;<br />
        &lt;/head&gt;</p>
<p>        &lt;body&gt;<br />
        &#8230;.<br />
        &lt;/body&gt;<br />
        &lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p><strong>See it yourself !</strong> If you are using Mozilla/Firefox or IE 5+   and print this page, you will see  that the paragraph under &quot;Media Types&quot; will be displayed in another   font, and have a  smaller font size than the rest of the text.</p>
<hr />
<h2>Different Media Types</h2>
<p><strong>Note:</strong> The media type names are not case-sensitive.</p>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<th align="left" width="20%">Media Type</th>
<th align="left" width="80%">Description</th>
</tr>
<tr>
<td>all</td>
<td> Used for all media type devices</td>
</tr>
<tr>
<td>aural</td>
<td> Used for speech and sound synthesizers</td>
</tr>
<tr>
<td>braille</td>
<td> Used for braille tactile feedback devices</td>
</tr>
<tr>
<td>embossed</td>
<td> Used for paged braille printers</td>
</tr>
<tr>
<td>handheld</td>
<td> Used for small or handheld devices</td>
</tr>
<tr>
<td>print</td>
<td> Used for printers</td>
</tr>
<tr>
<td>projection</td>
<td> Used for projected presentations, like slides</td>
</tr>
<tr>
<td>screen</td>
<td> Used for computer screens</td>
</tr>
<tr>
<td>tty</td>
<td> Used for media using a fixed-pitch character grid, like teletypes and   terminals</td>
</tr>
<tr>
<td>tv</td>
<td> Used for television-type devices</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-media-types/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Image Sprites</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-image-sprites/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-image-sprites/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:45:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Image Sprites]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=184</guid>
		<description><![CDATA[Image Sprites
An image sprite is a collection of images put into a single image.
A web page with many images can [...]]]></description>
			<content:encoded><![CDATA[<h2>Image Sprites</h2>
<p>An image sprite is a collection of images put into a single image.</p>
<p>A web page with many images can take a long time to load and   generates   multiple server requests.</p>
<p>Using image sprites will reduce the number of server requests and   save   bandwidth.</p>
<hr />
<h2>Image Sprites &#8211; Simple Example</h2>
<p>Instead of using three separate images, we use this single image   (&quot;img_navsprites.gif&quot;):</p>
<p><img src="http://JaffnaCampus.com/wp-content/images/img_navsprites.gif" alt="navigation images" /></p>
<p>With CSS, we can show just the part of the image we need.</p>
<p>In the following example the CSS specifies which part of the   &quot;img_navsprites.gif&quot;   image to show:</p>
<table id="table3" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table4" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> img.home<br />
                {<br />
                width:46px;<br />
                height:44px;<br />
                background:url(img_navsprites.gif) 0 0;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><strong>Example explained:</strong></p>
<ul>
<li>&lt;img class=&quot;home&quot; src=&quot;img_trans.gif&quot; /&gt; &#8211; Only defines a   small transparent image   	because the src attribute cannot be empty. The displayed image will be   the background image   	we specify in CSS</li>
<li>width:46px;height:44px; &#8211; Defines the portion of the image we want   to   	use</li>
<li>background:url(img_navsprites.gif) 0 0; &#8211; Defines the background   	image and its position (left 0px, top 0px)</li>
</ul>
<p>This is the easiest way to use image sprites, now we want to expand   it by   using links and hover effects.</p>
<hr />
<h2>Image Sprites &#8211; Create a Navigation List</h2>
<p>We want to use the sprite image (&quot;img_navsprites.gif&quot;) to create a   navigation   list.</p>
<p>We will use an HTML list, because it can be a link and also supports a     background image:</p>
<table id="table5" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table6" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> #navlist{position:relative;}<br />
                #navlist li{margin:0;padding:0;list-style:none;position:absolute;top:0;}<br />
                #navlist li, #navlist a{height:44px;display:block;}</p>
<p>                #home{left:0px;width:46px;}<br />
                #home{background:url(&#8216;img_navsprites.gif&#8217;) 0 0;}</p>
<p>                #prev{left:63px;width:43px;}<br />
                #prev{background:url(&#8216;img_navsprites.gif&#8217;) -47px 0;}</p>
<p>                #next{left:129px;width:43px;}<br />
                #next{background:url(&#8216;img_navsprites.gif&#8217;) -91px 0;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><strong>Example explained:</strong></p>
<ul>
<li>#navlist{position:relative;} &#8211; position is set to relative to allow     	absolute positioning inside it</li>
<li>#navlist   li{margin:0;padding:0;list-style:none;position:absolute;top:0;}   	- margin and padding is set to 0, list-style is removed, and all list   items   	are absolute positioned</li>
<li>#navlist li, #navlist a{height:44px;display:block;} &#8211; the height of   all   	the images are 44px</li>
</ul>
<p>Now start to position and style for each specific part:</p>
<ul>
<li>#home{left:0px;width:46px;} &#8211; Positioned all the way to the left,   and   	the width of the image is 46px</li>
<li>#home{background:url(img_navsprites.gif) 0 0;} &#8211;   	Defines the background   	image and its position (left 0px, top 0px)</li>
<li>#prev{left:63px;width:43px;} &#8211; Positioned 63px to the   	right (#home width 46px + some extra space between items), and   	the width is 43px.</li>
<li>#prev{background:url(&#8216;img_navsprites.gif&#8217;) -47px 0;} &#8211; Defines the   background   	image 47px to the right (#home width 46px + 1px line   	divider)</li>
<li>#next{left:129px;width:43px;}- Positioned 129px to   	the right (start of #prev is 63px + #prev width 43px +   	extra space), and the width is 43px.</li>
<li>#next{background:url(&#8216;img_navsprites.gif&#8217;) no-repeat -91px 0;} &#8211;   	Defines the background   	image 91px to the right (#home width 46px + 1px   	line divider + #prev width 43px + 1px line divider )</li>
</ul>
<hr />
<h2>Image Sprites &#8211; Hover Effect</h2>
<p>Now we want to add a hover effect to our   navigation list.</p>
<p>Our new image (&quot;img_navsprites_hover.gif&quot;) contains three navigation   images   and three images to use for hover effects:</p>
<p><img src="http://JaffnaCampus.com/wp-content/images/img_navsprites_hover.gif" alt="navigation images" /></p>
<p>Because this is one single image, and not six separate files, there   will be <strong>no   loading delay</strong> when a user hovers over the image.</p>
<p>We only add three lines of code to add the hover effect:</p>
<table id="table9" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table10" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> #home a:hover{background: url(&#8216;img_navsprites_hover.gif&#8217;) 0 -45px;}<br />
                #prev a:hover{background: url(&#8216;img_navsprites_hover.gif&#8217;) -47px   -45px;}<br />
                #next a:hover{background: url(&#8216;img_navsprites_hover.gif&#8217;) -91px   -45px;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Example explained:</p>
<ul>
<li>Since the list item contains a link, we can use the :hover   pseudo-class</li>
<li>#home a:hover{background: transparent url(img_navsprites_hover.gif)   0 -45px;} &#8211;   	For all three hover images we specify the same background position,    	only 45px further down.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-image-sprites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Image Opacity / Transparency</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-image-opacity-transparency/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-image-opacity-transparency/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:40:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Image Opacity]]></category>
		<category><![CDATA[CSS Image Transparency]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=182</guid>
		<description><![CDATA[Creating transparent images with CSS is easy.

Note: This is not yet a CSS standard. However, it works in all  [...]]]></description>
			<content:encoded><![CDATA[<p>Creating transparent images with CSS is easy.</p>
<hr />
<p><strong>Note:</strong> This is not yet a CSS standard. However, it works in all   modern browsers, and is a part of the W3C CSS 3 recommendation.</p>
<h2>Example 1 &#8211; Creating a Transparent Image</h2>
<p>First we will show you how to create a transparent image with CSS.</p>
<p>Regular image:</p>
<p><img src="http://www.w3schools.com/css/klematis.jpg" alt="klematis" height="113" width="150" /></p>
<p>The same image with transparency:</p>
<p><img src="http://www.w3schools.com/css/klematis.jpg" alt="klematis" height="113" width="150" /></p>
<p>Look at the following source code:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;img src=&quot;klematis.jpg&quot; width=&quot;150&quot; height=&quot;113&quot; alt=&quot;klematis&quot;<br />
        style=&quot;opacity:0.4;filter:alpha(opacity=40)&quot; /&gt;</td>
</tr>
</tbody>
</table>
<p>Firefox uses the property <strong>opacity:x</strong> for transparency, while IE   uses <strong>filter:alpha(opacity=x)</strong>.</p>
<p><strong>Tip:</strong> The CSS3 syntax for transparency is <strong>opacity:x</strong>.</p>
<p>In Firefox (opacity:x) x can be a value from 0.0 &#8211; 1.0. A lower value   makes the element more transparent.</p>
<p>In IE (filter:alpha(opacity=x)) x can be a value from 0 &#8211; 100. A   lower value makes the element more transparent.</p>
<hr />
<h2>Example 2 &#8211; Image Transparency &#8211; Mouseover Effect</h2>
<p>Mouse over the images:</p>
<p><img src="http://www.w3schools.com/css/klematis.jpg" alt="klematis" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" height="113" width="150" /> <img src="http://www.w3schools.com/css/klematis2.jpg" alt="klematis" onmouseover="this.style.opacity=1;this.filters.alpha.opacity=100" onmouseout="this.style.opacity=0.4;this.filters.alpha.opacity=40" height="113" width="150" /></p>
<p>The source code looks like this:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;img src=&quot;klematis.jpg&quot; style=&quot;opacity:0.4;filter:alpha(opacity=40)&quot;<br />
        onmouseover=&quot;this.style.opacity=1;this.filters.alpha.opacity=100&quot;<br />
        onmouseout=&quot;this.style.opacity=0.4;this.filters.alpha.opacity=40&quot; /&gt;</p>
<p>        &lt;img src=&quot;klematis2.jpg&quot; style=&quot;opacity:0.4;filter:alpha(opacity=40)&quot;<br />
        onmouseover=&quot;this.style.opacity=1;this.filters.alpha.opacity=100&quot;<br />
        onmouseout=&quot;this.style.opacity=0.4;this.filters.alpha.opacity=40&quot; /&gt;</td>
</tr>
</tbody>
</table>
<p>We see that the first line of the source code is similar to the   source code in Example 1. In addition, we have added an onmouseover   attribute and an   onmouseout attribute. The onmouseover attribute defines what will happen   when the mouse pointer moves over the image. In this case we want the   image to NOT be   transparent when we move the mouse pointer over it.</p>
<p>The syntax for this in Firefox is: <strong>this.style.opacity=1</strong> and   the syntax in IE is: <strong>this.filters.alpha.opacity=100</strong>.</p>
<p>When the mouse pointer moves away from the image, we want the image   to be transparent again. This is done in the onmouseout attribute.</p>
<hr />
<h2>Example 3 &#8211; Text in Transparent Box</h2>
<div>
<div>
<p>This is some text that is placed in the transparent box. This is some   text that is placed in the transparent box. This is some text that is   placed in the transparent box. This is some text that is placed in the   transparent box. This is some text that is placed in the transparent   box. </p>
</p></div>
</div>
<p>The source code looks like this:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
        &lt;head&gt;<br />
        &lt;style type=&quot;text/css&quot;&gt;<br />
        div.background<br />
        {<br />
        width:500px;<br />
        height:250px;<br />
        background:url(klematis.jpg) repeat;<br />
        border:2px solid black;<br />
        }<br />
        div.transbox<br />
        {<br />
        width:400px;<br />
        height:180px;<br />
        margin:30px 50px;<br />
        background-color:#ffffff;<br />
        border:1px solid black;<br />
        /* for IE */<br />
        filter:alpha(opacity=60);<br />
        /* CSS3 standard */<br />
        opacity:0.6;<br />
        }<br />
        div.transbox p<br />
        {<br />
        margin:30px 40px;<br />
        font-weight:bold;<br />
        color:#000000;<br />
        }<br />
        &lt;/style&gt;<br />
        &lt;/head&gt;</p>
<p>        &lt;body&gt;</p>
<p>        &lt;div class=&quot;background&quot;&gt;<br />
        &lt;div class=&quot;transbox&quot;&gt;<br />
        &lt;p&gt;This is some text that is placed in the transparent box.<br />
        This is some text that is placed in the transparent box.<br />
        This is some text that is placed in the transparent box.<br />
        This is some text that is placed in the transparent box.<br />
        This is some text that is placed in the transparent box.<br />
        &lt;/p&gt;<br />
        &lt;/div&gt;<br />
        &lt;/div&gt;</p>
<p>        &lt;/body&gt;<br />
        &lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>First, we create a div element (class=&quot;background&quot;) with a fixed   height and width, a background image, and a border.  Then we create a smaller div (class=&quot;transbox&quot;) inside the first div   element. This div also have a fixed width, a background   image, and a border. In addition we make this div transparent.</p>
<p>Inside the transparent div, we add some text inside a p element.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-image-opacity-transparency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Image Gallery</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-image-gallery/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-image-gallery/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:38:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Image Gallery]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=180</guid>
		<description><![CDATA[CSS can be used to create an image gallery.
 
Add a description of the image here

 
Add a description of [...]]]></description>
			<content:encoded><![CDATA[<p>CSS can be used to create an image gallery.</p>
<div> <a target="_blank" href="http://www.w3schools.com/css/klematis_big.htm"><img src="http://JaffnaCampus.com/wp-content/images/flower1.jpg" alt="flower" height="90" width="110" /></a></p>
<div>Add a description of the image here</div>
</div>
<div> <a target="_blank" href="http://JaffnaCampus.com/css/klematis2_big.htm"><img src="http://JaffnaCampus.com/wp-content/images/flower2.jpg" alt="flower" height="90" width="110" /></a></p>
<div>Add a description of the image here</div>
</div>
<div> <a target="_blank" href="http://JaffnaCampus.com/css/klematis3_big.htm"><img src="http://JaffnaCampus.com/wp-content/images/flower3.jpg" alt="flower" height="90" width="110" /></a></p>
<div>Add a description of the image here</div>
</div>
<div> <a target="_blank" href="http://JaffnaCampus.com/css/klematis4_big.htm"><img src="http://JaffnaCampus.com/wp-content/images/flower4.jpg" alt="flower" height="90" width="110" /></a></p>
<div>Add a description of the image here</div>
</div>
<hr />
<h2>Image Gallery</h2>
<p>The following image gallery is created with CSS:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
                &lt;head&gt;<br />
                &lt;style type=&quot;text/css&quot;&gt;<br />
                div.img<br />
                {<br />
                margin:2px;<br />
                border:1px solid #0000ff;<br />
                height:auto;<br />
                width:auto;<br />
                float:left;<br />
                text-align:center;<br />
                }<br />
                div.img img<br />
                {<br />
                display:inline;<br />
                margin:3px;<br />
                border:1px solid #ffffff;<br />
                }<br />
                div.img a:hover img<br />
                {<br />
                border:1px solid #0000ff;<br />
                }<br />
                div.desc<br />
                {<br />
                text-align:center;<br />
                font-weight:normal;<br />
                width:120px;<br />
                margin:2px;<br />
                }<br />
                &lt;/style&gt;<br />
                &lt;/head&gt;<br />
                &lt;body&gt;</p>
<p>                &lt;div class=&quot;img&quot;&gt;<br />
                &lt;a target=&quot;_blank&quot; href=&quot;klematis_big.htm&quot;&gt;<br />
                &lt;img src=&quot;klematis_small.jpg&quot; alt=&quot;Klematis&quot; width=&quot;110&quot;    height=&quot;90&quot; /&gt;<br />
                &lt;/a&gt;<br />
                &lt;div class=&quot;desc&quot;&gt;Add a description of the image   here&lt;/div&gt;<br />
                &lt;/div&gt;<br />
                &lt;div class=&quot;img&quot;&gt;<br />
                &lt;a target=&quot;_blank&quot; href=&quot;klematis2_big.htm&quot;&gt;<br />
                &lt;img src=&quot;klematis2_small.jpg&quot; alt=&quot;Klematis&quot; width=&quot;110&quot;    height=&quot;90&quot; /&gt;<br />
                &lt;/a&gt;<br />
                &lt;div class=&quot;desc&quot;&gt;Add a description of the image   here&lt;/div&gt;<br />
                &lt;/div&gt;<br />
                &lt;div class=&quot;img&quot;&gt;<br />
                &lt;a target=&quot;_blank&quot; href=&quot;klematis3_big.htm&quot;&gt;<br />
                &lt;img src=&quot;klematis3_small.jpg&quot; alt=&quot;Klematis&quot; width=&quot;110&quot;    height=&quot;90&quot; /&gt;<br />
                &lt;/a&gt;<br />
                &lt;div class=&quot;desc&quot;&gt;Add a description of the image   here&lt;/div&gt;<br />
                &lt;/div&gt;<br />
                &lt;div class=&quot;img&quot;&gt;<br />
                &lt;a target=&quot;_blank&quot; href=&quot;klematis4_big.htm&quot;&gt;<br />
                &lt;img src=&quot;klematis4_small.jpg&quot; alt=&quot;Klematis&quot; width=&quot;110&quot;    height=&quot;90&quot; /&gt;<br />
                &lt;/a&gt;<br />
                &lt;div class=&quot;desc&quot;&gt;Add a description of the image   here&lt;/div&gt;<br />
                &lt;/div&gt;</p>
<p>                &lt;/body&gt;<br />
                &lt;/html&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-image-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Navigation Bar</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-navigation-bar/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-navigation-bar/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:26:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Navigation Bar]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=178</guid>
		<description><![CDATA[
Demo: Navigation Bar

Home
Campus News
HTML
XHTML
CSS
About



Navigation Bars
Having easy-to-use navigation is important for any web   site.
With CSS you can transform boring [...]]]></description>
			<content:encoded><![CDATA[<div>
<h2>Demo: Navigation Bar</h2>
<ul>
<li><a href="http://JaffnaCampus.com/">Home</a></li>
<li><a href="http://JaffnaCampus.com/campus-news">Campus News</a></li>
<li><a href="http://JaffnaCampus.com/html/">HTML</a></li>
<li><a href="http://JaffnaCampus.com/xhtml/">XHTML</a></li>
<li><a href="http://JaffnaCampus.com/css/">CSS</a></li>
<li><a href="http://JaffnaCampus.com/about">About</a></li>
</ul>
</div>
<hr />
<h2>Navigation Bars</h2>
<p>Having easy-to-use navigation is important for any web   site.</p>
<p>With CSS you can transform boring HTML menus into good-looking   navigation bars.</p>
<hr />
<h2>Navigation Bar = List of Links</h2>
<p>A navigation bar needs standard HTML as a base.</p>
<p>In our examples we will build the navigation bar from a standard HTML   list.</p>
<p>A navigation bar is   basically a list of links, so using the &lt;ul&gt; and &lt;li&gt;   elements makes perfect   sense:</p>
<table id="table11" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table12" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;ul&gt;<br />
                &lt;li&gt;&lt;a href=&quot;default.asp&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;<br />
                &lt;li&gt;&lt;a href=&quot;news.asp&quot;&gt;News&lt;/a&gt;&lt;/li&gt;<br />
                &lt;li&gt;&lt;a href=&quot;contact.asp&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;<br />
                &lt;li&gt;&lt;a href=&quot;about.asp&quot;&gt;About&lt;/a&gt;&lt;/li&gt;<br />
                &lt;/ul&gt;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Now let&#8217;s remove the bullets and the margins and padding from the   list:</p>
<table id="table21" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table22" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>ul<br />
                {<br />
                list-style-type:none;<br />
                margin:0;<br />
                padding:0;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Example explained:</p>
<ul>
<li>list-style-type:none &#8211; Removes the bullets. A navigation bar   	does not need list markers</li>
<li>Setting margins and padding to 0   	to remove browser default settings</li>
</ul>
<p>The code in the example above is the standard code used in both   vertical,   and horizontal navigation bars.</p>
<hr />
<h2>Vertical Navigation Bar</h2>
<p>To build a vertical navigation bar we only need to style the   &lt;a&gt; elements,   in addition to the code above:</p>
<table id="table17" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table18" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> a<br />
                {<br />
                display:block;<br />
                width:60px;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Example explained:</p>
<ul>
<li>display:block &#8211; Displaying the links as block elements makes the   whole   	link area clickable (not just the text), and it allows us to specify   the   	width</li>
<li>width:60px &#8211; Block elements take up the full width available by   default.   	We want to specify a 60 px width</li>
</ul>
<p><strong>Note:</strong> Always specify the width for &lt;a&gt; elements in a   vertical   navigation bar. If you omit the width, IE6 can produce unexpected   results.</p>
<hr />
<h2>Horizontal Navigation Bar</h2>
<p>There are two ways to create a horizontal navigation bar. Using <strong> inline</strong> or <strong>floating</strong> list items.</p>
<p>Both methods work fine, but if you want the links to be the same   size,   you have to use the floating method.</p>
<h2>Inline List Items</h2>
<p>One way to build a horizontal navigation bar is to specify the   &lt;li&gt; elements   as inline, in addition to the &quot;standard&quot; code above:</p>
<table id="table13" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table14" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> li<br />
                {<br />
                display:inline;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Example explained:</p>
<ul>
<li>display:inline; &#8211; By default, &lt;li&gt; elements are block   elements. Here, we   	remove the line breaks before and after each list   	item, to display them on one line</li>
</ul>
<h2>Floating List Items</h2>
<p>In the example above the links have different widths.</p>
<p>For all the links to have an equal width, float the &lt;li&gt;   elements and specify   a width for the &lt;a&gt; elements:</p>
<table id="table25" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table26" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> li<br />
                {<br />
                float:left;<br />
                }<br />
                a<br />
                {<br />
                display:block;<br />
                width:60px;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Example explained:</p>
<ul>
<li>float:left &#8211; use float to get block elements to slide next to each   other</li>
<li>display:block &#8211;    	Displaying the links as block elements makes the whole link area   clickable   	(not just the text), and it allows us to specify the width</li>
<li>width:60px &#8211; Since block elements take up the full width available,   they   	cannot float next to each other. We specify the   	width of the links to 60px</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-navigation-bar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Pseudo-elements</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-pseudo-elements/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-pseudo-elements/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:04:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Pseudo-elements]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=176</guid>
		<description><![CDATA[CSS pseudo-elements are used to add special effects to   some selectors.

Syntax
The syntax of pseudo-elements:



selector:pseudo-element {property:value;}



CSS classes can also [...]]]></description>
			<content:encoded><![CDATA[<p>CSS pseudo-elements are used to add special effects to   some selectors.</p>
<hr />
<h2>Syntax</h2>
<p>The syntax of pseudo-elements:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>selector:pseudo-element {property:value;}</td>
</tr>
</tbody>
</table>
<p>CSS classes can also be used with pseudo-elements:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>selector.class:pseudo-element {property:value;}</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>The :first-line Pseudo-element</h2>
<p>The &quot;first-line&quot; pseudo-element is used to add a special style to the   first   line of a text.</p>
<p>In the following example the browser formats the first line of text   in a p   element according to the style in the &quot;first-line&quot; pseudo-element (where   the browser breaks the line,  depends on the size of the browser window):</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> p:first-line <br />
                {<br />
                color:#ff0000;<br />
                font-variant:small-caps;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><strong>Note:</strong> The &quot;first-line&quot; pseudo-element can only be used with   block-level elements.</p>
<p><strong>Note:</strong> The following properties apply to the &quot;first-line&quot;   pseudo-element:</p>
<ul>
<li> font properties</li>
<li>color properties </li>
<li> background properties</li>
<li>word-spacing</li>
<li>letter-spacing</li>
<li>text-decoration</li>
<li>vertical-align</li>
<li>text-transform</li>
<li>line-height</li>
<li>clear</li>
</ul>
<hr />
<h2>The :first-letter Pseudo-element</h2>
<p>The &quot;first-letter&quot; pseudo-element is used to add a special style to   the first letter of   a text:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> p:first-letter <br />
                {<br />
                color:#ff0000;<br />
                font-size:xx-large;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><strong>Note:</strong> The &quot;first-letter&quot; pseudo-element can only be used with   block-level elements.</p>
<p><strong>Note:</strong> The following properties apply to the &quot;first-letter&quot;   pseudo- element: </p>
<ul>
<li> font properties</li>
<li> color properties </li>
<li> background properties</li>
<li>margin properties</li>
<li>padding properties</li>
<li>border properties</li>
<li>text-decoration</li>
<li>vertical-align (only if &quot;float&quot; is &quot;none&quot;)</li>
<li>text-transform</li>
<li>line-height</li>
<li>float</li>
<li>clear</li>
</ul>
<hr />
<h2>Pseudo-elements and CSS Classes</h2>
<p>Pseudo-elements can be combined with CSS classes: </p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> p.article:first-letter {color:#ff0000;}</p>
<p>        &lt;p class=&quot;article&quot;&gt;A paragraph in an article&lt;/p&gt;</td>
</tr>
</tbody>
</table>
<p>The example above will display the first letter of all paragraphs   with class=&quot;article&quot;,   in red.</p>
<hr />
<h2>Multiple Pseudo-elements</h2>
<p>Several pseudo-elements can also be combined.</p>
<p>In the following example, the first letter of a paragraph will be   red, in   an xx-large font size. The rest of the first line will be blue, and in   small-caps. The rest of the paragraph will be the default font size and   color:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> p:first-letter<br />
                {<br />
                color:#ff0000;<br />
                font-size:xx-large;<br />
                }<br />
                p:first-line <br />
                {<br />
                color:#0000ff;<br />
                font-variant:small-caps;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>CSS &#8211; The :before Pseudo-element</h2>
<p>The &quot;:before&quot; pseudo-element can be used to insert some content   before the content of an element.</p>
<p>The following example inserts an image before each &lt;h1&gt;   element:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> h1:before <br />
                {<br />
                content:url(smiley.gif);<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>CSS &#8211; The :after Pseudo-element</h2>
<p>The &quot;:after&quot; pseudo-element can be used to insert some content after   the content of an element.</p>
<p>The following example inserts an image after each &lt;h1&gt; element:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> h1:after<br />
                {<br />
                content:url(smiley.gif);<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Pseudo-elements</h2>
<p>The &quot;CSS&quot; column indicates in which CSS version the property is   defined (CSS1 or CSS2).</p>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<th align="left" width="27%">Pseudo name</th>
<th align="left" width="68%">Description</th>
<th align="left" width="5%">CSS</th>
</tr>
<tr>
<td>:after</td>
<td>Adds content after an element</td>
<td>2</td>
</tr>
<tr>
<td>:before</td>
<td>Adds content before an element</td>
<td>2</td>
</tr>
<tr>
<td>:first-letter</td>
<td>Adds a style to the first character of a text</td>
<td>1</td>
</tr>
<tr>
<td>:first-line</td>
<td>Adds a style to the first line of a text</td>
<td>1</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-pseudo-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Pseudo-classes</title>
		<link>http://jaffnacampus.com/css/css-advanced/css-pseudo-classes/</link>
		<comments>http://jaffnacampus.com/css/css-advanced/css-pseudo-classes/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 09:02:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Advanced]]></category>
		<category><![CDATA[CSS Pseudo-classes]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=174</guid>
		<description><![CDATA[CSS pseudo-classes are used to add special effects to   some selectors.

Syntax
The syntax of pseudo-classes:



selector:pseudo-class {property:value;}



CSS classes can also [...]]]></description>
			<content:encoded><![CDATA[<p>CSS pseudo-classes are used to add special effects to   some selectors.</p>
<hr />
<h2>Syntax</h2>
<p>The syntax of pseudo-classes:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>selector:pseudo-class {property:value;}</td>
</tr>
</tbody>
</table>
<p>CSS classes can also be used with pseudo-classes:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>selector.class:pseudo-class {property:value;}</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Anchor Pseudo-classes</h2>
<p>Links can be displayed in different ways in a CSS-supporting browser:</p>
<table id="table11" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table12" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>a:link {color:#FF0000;}      /* unvisited link */<br />
                a:visited {color:#00FF00;}  /* visited link */<br />
                a:hover {color:#FF00FF;}  /* mouse over link */<br />
                a:active {color:#0000FF;}  /* selected link */</td>
</tr>
</tbody>
</table>
<p></td>
</tr>
</tbody>
</table>
<p><strong>Note:</strong> a:hover MUST come after a:link and a:visited in the CSS   definition in order to be effective!!</p>
<p><strong>Note:</strong> a:active MUST come after a:hover in the CSS definition   in order to be effective!!</p>
<p><strong>Note:</strong> Pseudo-class names are not case-sensitive.</p>
<hr />
<h2>Pseudo-classes and CSS Classes</h2>
<p>Pseudo-classes can be combined with CSS classes:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> a.red:visited {color:#FF0000;}</p>
<p>        &lt;a class=&quot;red&quot; href=&quot;css_syntax.asp&quot;&gt;CSS Syntax&lt;/a&gt;</td>
</tr>
</tbody>
</table>
<p>If the link in the example above has been visited, it will be   displayed in red.</p>
<hr />
<h2>CSS &#8211; The :first-child Pseudo-class</h2>
<p>The :first-child pseudo-class matches a specified element that is the   first child of another element.</p>
<p><strong>Note:</strong> For :first-child to work in IE a <a href="http://www.w3schools.com/tags/tag_doctype.asp">&lt;!DOCTYPE&gt;</a> must be declared.</p>
<h2>Match the first &lt;p&gt; element</h2>
<p>In the following example, the selector matches any &lt;p&gt; element   that is the first child of any element:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
                &lt;head&gt;<br />
                &lt;style type=&quot;text/css&quot;&gt;<br />
                p:first-child<br />
                {<br />
                color:blue;<br />
                } <br />
                &lt;/style&gt;<br />
                &lt;/head&gt;</p>
<p>                &lt;body&gt;<br />
                &lt;p&gt;I am a strong man.&lt;/p&gt;<br />
                &lt;p&gt;I am a strong man.&lt;/p&gt;<br />
                &lt;/body&gt;<br />
                &lt;/html&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<hr />
<h2>Match the first &lt;i&gt; element in all &lt;p&gt; elements</h2>
<p>In the following example, the selector matches the first &lt;i&gt;   element in all &lt;p&gt; elements:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
                &lt;head&gt;<br />
                &lt;style type=&quot;text/css&quot;&gt;<br />
                p &gt; i:first-child<br />
                {<br />
                font-weight:bold;<br />
                } <br />
                &lt;/style&gt;<br />
                &lt;/head&gt;</p>
<p>                &lt;body&gt;<br />
                &lt;p&gt;I am a &lt;i&gt;strong&lt;/i&gt; man. I am a   &lt;i&gt;strong&lt;/i&gt; man.&lt;/p&gt;<br />
                &lt;p&gt;I am a &lt;i&gt;strong&lt;/i&gt; man. I am a   &lt;i&gt;strong&lt;/i&gt; man.&lt;/p&gt;<br />
                &lt;/body&gt;<br />
                &lt;/html&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<hr />
<h2>Match all &lt;i&gt; elements in all first child &lt;p&gt; elements</h2>
<p>In the following example, the selector matches all &lt;i&gt; elements   in &lt;p&gt; elements that are the first child of another element:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
                &lt;head&gt;<br />
                &lt;style type=&quot;text/css&quot;&gt;<br />
                p:first-child i<br />
                {<br />
                color:blue;<br />
                } <br />
                &lt;/style&gt;<br />
                &lt;/head&gt;</p>
<p>                &lt;body&gt;<br />
                &lt;p&gt;I am a &lt;i&gt;strong&lt;/i&gt; man. I am a   &lt;i&gt;strong&lt;/i&gt; man.&lt;/p&gt;<br />
                &lt;p&gt;I am a &lt;i&gt;strong&lt;/i&gt; man. I am a   &lt;i&gt;strong&lt;/i&gt; man.&lt;/p&gt;<br />
                &lt;/body&gt;<br />
                &lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p></td>
</tr>
</tbody>
</table>
<hr />
<h2>CSS &#8211; The :lang Pseudo-class</h2>
<p>The :lang pseudo-class allows you to define special rules for   different languages.</p>
<p><strong>Note:</strong> Internet Explorer 8 (and higher) supports the :lang   pseudo-class   if a &lt;!DOCTYPE&gt; is specified.</p>
<p>In the example below, the :lang class defines the quotation marks for   q elements with lang=&quot;no&quot;:</p>
<table id="table9" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table10" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
                &lt;head&gt;<br />
                &lt;style type=&quot;text/css&quot;&gt;<br />
                q:lang(no)  {quotes: &quot;~&quot; &quot;~&quot;;}<br />
                &lt;/style&gt;<br />
                &lt;/head&gt;</p>
<p>                &lt;body&gt;<br />
                &lt;p&gt;Some text &lt;q lang=&quot;no&quot;&gt;A quote in a paragraph&lt;/q&gt;   Some text.&lt;/p&gt;<br />
                &lt;/body&gt;<br />
                &lt;/html&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Pseudo-classes</h2>
<p>The &quot;CSS&quot; column indicates in which CSS version the property is   defined (CSS1 or CSS2).</p>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<th align="left" width="27%">Pseudo name</th>
<th align="left" width="68%">Description</th>
<th align="left" width="5%">CSS</th>
</tr>
<tr>
<td>:active</td>
<td>Adds a style to an element that is activated</td>
<td>1</td>
</tr>
<tr>
<td>:first-child</td>
<td>Adds a style to an element that is the first child of   	another element</td>
<td>2</td>
</tr>
<tr>
<td>:focus</td>
<td>Adds a style to an element that has keyboard input focus</td>
<td>2</td>
</tr>
<tr>
<td>:hover</td>
<td>Adds a style to an element when you mouse over it</td>
<td>1</td>
</tr>
<tr>
<td>:lang</td>
<td>Adds a style to an element with a specific lang attribute</td>
<td>2</td>
</tr>
<tr>
<td>:link</td>
<td>Adds a style to an unvisited link</td>
<td>1</td>
</tr>
<tr>
<td>:visited</td>
<td>Adds a style to a visited link</td>
<td>1</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-advanced/css-pseudo-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

