<?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 Basic</title>
	<atom:link href="http://jaffnacampus.com/category/css/css-basic/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 How To</title>
		<link>http://jaffnacampus.com/css/css-basic/css-how-to/</link>
		<comments>http://jaffnacampus.com/css/css-basic/css-how-to/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:07:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Basic]]></category>
		<category><![CDATA[CSS How To]]></category>
		<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=139</guid>
		<description><![CDATA[When a browser reads a style sheet, it will format the   document according to it.

Three Ways to Insert [...]]]></description>
			<content:encoded><![CDATA[<p>When a browser reads a style sheet, it will format the   document according to it.</p>
<hr />
<h2>Three Ways to Insert CSS</h2>
<p>There are three ways of inserting a style sheet:</p>
<ul>
<li>External style sheet</li>
<li>Internal style sheet</li>
<li>Inline style</li>
</ul>
<hr />
<h2>External Style Sheet</h2>
<p>An external style sheet is ideal when the style is applied to many   pages. With an  external style sheet, you can change the look of an entire Web site by   changing one file.  Each page must link to the style sheet using the &lt;link&gt; tag. The   &lt;link&gt; tag goes inside the head section:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;head&gt;<br />
        &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot;  href=&quot;mystyle.css&quot; /&gt;<br />
        &lt;/head&gt;</td>
</tr>
</tbody>
</table>
<p>An external style sheet can be written in any text editor. The file   should not contain any html tags. Your style sheet should be saved with a   .css extension.  An example of a style sheet file is shown below:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> hr {color:sienna;}<br />
        p {margin-left:20px;}<br />
        body {background-image:url(&quot;images/back40.gif&quot;);}</td>
</tr>
</tbody>
</table>
<h3>Do not leave spaces between the property value and the   units! &quot;margin-left:20 px&quot;   (instead of &quot;margin-left:20px&quot;) will work in IE, but not in Firefox or   Opera.</h3>
<hr />
<h2>Internal Style Sheet</h2>
<p>An internal style sheet should be used when a single document has a   unique style. You define internal styles in the head section   of an HTML page, by using the &lt;style&gt; tag, like this:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;head&gt;<br />
        &lt;style type=&quot;text/css&quot;&gt;<br />
        hr {color:sienna;}<br />
        p {margin-left:20px;}<br />
        body {background-image:url(&quot;images/back40.gif&quot;);}<br />
        &lt;/style&gt;<br />
        &lt;/head&gt;</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Inline Styles</h2>
<p>An inline style loses many of the advantages of style sheets by   mixing  content with presentation. Use this method sparingly!</p>
<p>To use inline styles you use the style attribute in the relevant tag.   The  style attribute can contain any CSS property. The example shows how to   change  the color and the left margin of a paragraph:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>&lt;p style=&quot;color:sienna;margin-left:20px&quot;&gt;This is a   paragraph.&lt;/p&gt;</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Multiple Style Sheets</h2>
<p>If some properties have been set for the same selector in different   style sheets,  the values will be inherited from the more specific style sheet. </p>
<p> For example, an external style sheet has these properties for the h3   selector:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> h3<br />
        {<br />
        color:red;<br />
        text-align:left;<br />
        font-size:8pt;<br />
        }</td>
</tr>
</tbody>
</table>
<p>And an internal style sheet has these properties for the h3 selector:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> h3<br />
        {<br />
        text-align:right;<br />
        font-size:20pt;<br />
        }</td>
</tr>
</tbody>
</table>
<p>If the page with the internal style sheet also links to the external   style sheet the properties for h3 will be:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> color:red;<br />
        text-align:right;<br />
        font-size:20pt;</td>
</tr>
</tbody>
</table>
<p>The color is inherited from the external style sheet and the   text-alignment and the font-size is replaced by the internal style   sheet.</p>
<hr />
<h2>Multiple Styles Will Cascade into One</h2>
<p>Styles can be specified:</p>
<ul>
<li>inside an HTML element</li>
<li>inside the head section of an HTML page</li>
<li>in an external CSS file</li>
</ul>
<p><strong>Tip:</strong> Even multiple external style sheets can be referenced   inside a single HTML document.</p>
<h3>Cascading order</h3>
<p>What style will be used when there is more than one style specified   for an HTML element?</p>
<p>Generally speaking we can say that all the styles will &quot;cascade&quot; into   a new &quot;virtual&quot; style  sheet by the following rules, where number four has the highest   priority:</p>
<ol>
<li>Browser default</li>
<li>External style sheet</li>
<li>Internal style sheet (in the head section)</li>
<li>Inline style (inside an HTML element)</li>
</ol>
<p>So, an inline style (inside an HTML element) has the highest   priority, which means that it will override a style defined inside the   &lt;head&gt; tag, or in  an external style sheet, or in a browser (a default value).</p>
<h3><strong>Note:</strong> If the link to the external style sheet is   placed after the internal style sheet in HTML &lt;head&gt;, the external   style   sheet will override the internal style sheet!</h3>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-basic/css-how-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Id and Class</title>
		<link>http://jaffnacampus.com/css/css-basic/css-id-and-class/</link>
		<comments>http://jaffnacampus.com/css/css-basic/css-id-and-class/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:05:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Basic]]></category>
		<category><![CDATA[CSS class]]></category>
		<category><![CDATA[CSS Id]]></category>
		<category><![CDATA[CSS Id and Class]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=137</guid>
		<description><![CDATA[The id and class Selectors
In addition to setting a style for a HTML element, CSS allows you to   [...]]]></description>
			<content:encoded><![CDATA[<h2>The id and class Selectors</h2>
<p>In addition to setting a style for a HTML element, CSS allows you to   specify   your own selectors called &quot;id&quot; and &quot;class&quot;.</p>
<hr />
<h2>The id Selector</h2>
<p>The id selector is used to specify a style for a single, unique   element.</p>
<p>The id selector uses the id attribute of the HTML element, and is   defined   with a &quot;#&quot;.</p>
<p>The style rule below will be applied to the element with id=&quot;para1&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> #para1<br />
                {<br />
                text-align:center;<br />
                color:red;<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h3>Do NOT start an ID name with a number! It will not   work in Mozilla/Firefox.</h3>
<hr />
<h2>The class Selector</h2>
<p>The class selector is used to specify a style for a group of   elements. Unlike the id   selector, the class selector is most often used on several elements. </p>
<p>This allows you to set a particular style for any HTML elements with   the same class. </p>
<p>The class selector uses the HTML class   attribute, and is defined with a &quot;.&quot;</p>
<p>In the example   below, all HTML elements with class=&quot;center&quot; will be center-aligned:</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> .center {text-align:center;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>You can also specify that only specific HTML elements should be   affected by a   class.</p>
<p>In the example   below, all p elements with class=&quot;center&quot; will be center-aligned:</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.center {text-align:center;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h3>Do NOT start a class name with a number! This is only   supported in Internet Explorer.</h3>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-basic/css-id-and-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Syntax</title>
		<link>http://jaffnacampus.com/css/css-basic/css-syntax/</link>
		<comments>http://jaffnacampus.com/css/css-basic/css-syntax/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:00:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Basic]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Syntax]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=135</guid>
		<description><![CDATA[A CSS rule has two main parts: a selector, and one or more   declarations:

The selector is normally the [...]]]></description>
			<content:encoded><![CDATA[<p>A CSS rule has two main parts: a selector, and one or more   declarations:</p>
<p><img src="http://w3schools.com/css/selector.gif" alt="" border="0" /></p>
<p>The selector is normally the HTML element you want to style.</p>
<p>Each declaration consists of a property and a value.</p>
<p>The property is the  style attribute you want to change. Each property has a value.</p>
<hr />
<h2>CSS Example</h2>
<p>CSS declarations always ends with a semicolon, and declaration groups   are   surrounded by curly brackets:</p>
<table id="table1" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>p {color:red;text-align:center;}</td>
</tr>
</tbody>
</table>
<p>To make the CSS more readable, you can put one declaration on each   line, like this:</p>
<hr />
<h2>CSS Comments</h2>
<p>Comments are used to explain your code, and may help you when you   edit the source code at a later date.   Comments are ignored by   browsers.</p>
<p>A CSS comment begins with &quot;/*&quot;, and ends with &quot;*/&quot;, like this:</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> /*This is a comment*/<br />
        p<br />
        {<br />
        text-align:center;<br />
        /*This is another comment*/<br />
        color:black;<br />
        font-family:arial;<br />
        }</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-basic/css-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Introduction</title>
		<link>http://jaffnacampus.com/css/css-basic/css-introduction/</link>
		<comments>http://jaffnacampus.com/css/css-basic/css-introduction/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 03:58:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Basic]]></category>
		<category><![CDATA[CSS Introduction]]></category>
		<category><![CDATA[Introduction to CSS]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/css/css-basic/css-introduction/</guid>
		<description><![CDATA[What You Should Already Know
Before you continue you should have a basic understanding of the   following:

HTML / XHTML

If [...]]]></description>
			<content:encoded><![CDATA[<h2>What You Should Already Know</h2>
<p>Before you continue you should have a basic understanding of the   following:</p>
<ul>
<li>HTML / XHTML</li>
</ul>
<p>If you want to study these subjects first, find the tutorials on our <a target="_top" href="http://jaffnaCampus.com/html/">HTML</a>.</p>
<hr />
<h2>What is CSS?</h2>
<ul>
<li><strong>CSS</strong> stands for <strong>C</strong>ascading <strong>S</strong>tyle <strong>S</strong>heets</li>
<li>Styles define <strong> how to display</strong> HTML elements</li>
<li>Styles were added to HTML 4.0 <strong>to solve a problem</strong></li>
<li><strong>External Style Sheets</strong> can save a lot of work</li>
<li>External Style Sheets are stored in <strong>CSS files</strong></li>
</ul>
<hr />
<h2>Styles Solved a Big Problem</h2>
<p>HTML was never intended to contain tags for formatting a document.</p>
<p>HTML was intended to define the content of a document, like:</p>
<p>&lt;h1&gt;This is a heading&lt;/h1&gt;</p>
<p>&lt;p&gt;This is a paragraph.&lt;/p&gt;</p>
<p>When tags like &lt;font&gt;, and color attributes were added to the   HTML 3.2   specification, it started a nightmare for web developers. Development of   large   web sites, where fonts and color information were added to every single      page, became a long and expensive process.</p>
<p>To solve this problem, the World Wide Web Consortium (W3C) created   CSS.</p>
<p>In HTML 4.0, all formatting could be removed from the HTML document,   and stored   in a separate CSS file.</p>
<p>All browsers support CSS today.</p>
<hr />
<h2>CSS Saves a Lot of Work!</h2>
<p>CSS defines HOW HTML elements are to be displayed.</p>
<p>Styles are normally saved in external .css files. External style   sheets enable you to change the  appearance and layout of all the pages in a Web site, just by editing   one single file!</p>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-basic/css-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

