<?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 Styling</title>
	<atom:link href="http://jaffnacampus.com/category/css/css-styling/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 Tables</title>
		<link>http://jaffnacampus.com/css/css-styling/css-tables/</link>
		<comments>http://jaffnacampus.com/css/css-styling/css-tables/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:29:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Styling]]></category>
		<category><![CDATA[CSS Tables]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=151</guid>
		<description><![CDATA[The look of an HTML table can be greatly improved with   CSS:



Company
Contact
Country


Alfreds Futterkiste
Maria Anders
Germany


Berglunds snabbköp
Christina Berglund
Sweden


Centro comercial Moctezuma
Francisco [...]]]></description>
			<content:encoded><![CDATA[<p>The look of an HTML table can be greatly improved with   CSS:</p>
<table id="customers">
<tbody>
<tr>
<th>Company</th>
<th>Contact</th>
<th>Country</th>
</tr>
<tr>
<td>Alfreds Futterkiste</td>
<td>Maria Anders</td>
<td>Germany</td>
</tr>
<tr>
<td>Berglunds snabbköp</td>
<td>Christina Berglund</td>
<td>Sweden</td>
</tr>
<tr>
<td>Centro comercial Moctezuma</td>
<td>Francisco Chang</td>
<td>Mexico</td>
</tr>
<tr>
<td>Ernst Handel</td>
<td>Roland Mendel</td>
<td>Austria</td>
</tr>
<tr>
<td>Island Trading</td>
<td>Helen Bennett</td>
<td>UK</td>
</tr>
<tr>
<td>Königlich Essen</td>
<td>Philip Cramer</td>
<td>Germany</td>
</tr>
<tr>
<td>Laughing Bacchus Winecellars</td>
<td>Yoshi Tannamuri</td>
<td>Canada</td>
</tr>
<tr>
<td>Magazzini Alimentari Riuniti</td>
<td>Giovanni Rovelli</td>
<td>Italy</td>
</tr>
<tr>
<td>North/South</td>
<td>Simon Crowther</td>
<td>UK</td>
</tr>
<tr>
<td>Paris spécialités</td>
<td>Marie Bertrand</td>
<td>France</td>
</tr>
<tr>
<td>The Big Cheese</td>
<td>Liz Nixon</td>
<td>USA</td>
</tr>
<tr>
<td>Vaffeljernet</td>
<td>Palle Ibsen</td>
<td>Denmark</td>
</tr>
</tbody>
</table>
<hr />
<h2>Table Borders</h2>
<p>To specify table borders in CSS, use the border property.</p>
<p>The example below specifies a black border for table, th, and td   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> table, th, td<br />
                {<br />
                border: 1px solid black;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Notice that the table in the example above has double borders. This   is because both the table, th, and td elements have separate borders.</p>
<p>To display a single border for the table, use the border-collapse   property.</p>
<h2>Collapse Borders</h2>
<p>The border-collapse property sets whether the table borders are   collapsed into a single border or separated:</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> table<br />
                {<br />
                border-collapse:collapse;<br />
                }<br />
                table,th, td<br />
                {<br />
                border: 1px solid black;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Table Width and Height</h2>
<p>Width and height of a table is defined by the width and height   properties.</p>
<p>The example below sets the width of the table to 100%, and the height   of the   th elements to 50px:</p>
<table id="table7" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table8" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> table <br />
                {<br />
                width:100%;<br />
                }<br />
                th<br />
                {<br />
                height:50px;<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Table Text Alignment</h2>
<p>The text in a table is aligned with the text-align and vertical-align     properties.</p>
<p>The text-align property sets the horizontal alignment, like left,   right, or   center:</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> td<br />
                {<br />
                text-align:right;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>The vertical-align property sets the vertical alignment, like top,   bottom, or middle:</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> td<br />
                {<br />
                height:50px;<br />
                vertical-align:bottom;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Table Padding</h2>
<p>To control the space between the border and content in a table, use   the padding   property on td and th 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> td<br />
                {<br />
                padding:15px;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Table Color</h2>
<p>The example below specifies the color of the borders, and the   text and background color of th 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> table, td, th<br />
                {<br />
                border:1px solid green;<br />
                }<br />
                th<br />
                {<br />
                background-color:green;<br />
                color:white;<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-styling/css-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lists</title>
		<link>http://jaffnacampus.com/css/css-styling/css-lists/</link>
		<comments>http://jaffnacampus.com/css/css-styling/css-lists/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:26:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Styling]]></category>
		<category><![CDATA[CSS Lists]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=149</guid>
		<description><![CDATA[The CSS list properties allow you to:

Set different list item markers for ordered lists
Set different list item markers for unordered [...]]]></description>
			<content:encoded><![CDATA[<p>The CSS list properties allow you to:</p>
<ul>
<li>Set different list item markers for ordered lists</li>
<li>Set different list item markers for unordered lists</li>
<li>Set an image as the list item marker</li>
</ul>
<p></p>
<hr />
<h2>List</h2>
<p>In HTML, there are two types of lists:</p>
<ul>
<li>unordered lists &#8211; the list items are marked with bullets</li>
<li>ordered lists &#8211; the list items are marked with numbers or letters</li>
</ul>
<p>With CSS, lists can be styled further, and images can be used as the   list item marker.</p>
<hr />
<h2>Different List Item Markers</h2>
<p>The type of list item marker is specified with the   list-style-type property:</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> ul.a {list-style-type: circle;}<br />
                ul.b {list-style-type: square;}</p>
<p>                ol.c {list-style-type: upper-roman;}<br />
                ol.d {list-style-type: lower-alpha;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Some of the property values are for unordered lists, and some for   ordered lists.</p>
<h2>Values for Unordered Lists</h2>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<th align="left" width="30%">Value</th>
<th align="left" width="70%">Description</th>
</tr>
<tr>
<td>none</td>
<td>No marker</td>
</tr>
<tr>
<td>disc</td>
<td>Default. The marker is a filled circle</td>
</tr>
<tr>
<td>circle</td>
<td>The marker is a circle</td>
</tr>
<tr>
<td>square</td>
<td>The marker is a square</td>
</tr>
</tbody>
</table>
<h2>Values for Ordered Lists</h2>
<table border="1" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<th align="left" width="30%">Value</th>
<th align="left" width="70%">Description</th>
</tr>
<tr>
<td>armenian</td>
<td>The marker is traditional Armenian numbering</td>
</tr>
<tr>
<td>decimal</td>
<td>The marker is a number</td>
</tr>
<tr>
<td>decimal-leading-zero</td>
<td>The marker is a number padded by initial zeros (01, 02, 03,   etc.)</td>
</tr>
<tr>
<td>georgian</td>
<td>The marker is traditional Georgian numbering (an, ban, gan,   etc.)</td>
</tr>
<tr>
<td>lower-alpha</td>
<td>The marker is lower-alpha (a, b, c, d, e, etc.)</td>
</tr>
<tr>
<td>lower-greek</td>
<td>The marker is lower-greek (alpha, beta, gamma, etc.)</td>
</tr>
<tr>
<td>lower-latin</td>
<td>The marker is lower-latin (a, b, c, d, e, etc.)</td>
</tr>
<tr>
<td>lower-roman</td>
<td>The marker is lower-roman (i, ii, iii, iv, v,        etc.)</td>
</tr>
<tr>
<td>upper-alpha</td>
<td>The marker is upper-alpha (A, B, C, D, E, etc.) </td>
</tr>
<tr>
<td>upper-latin</td>
<td>The marker is upper-latin (A, B, C, D, E, etc.)</td>
</tr>
<tr>
<td>upper-roman</td>
<td>The marker is upper-roman (I, II, III, IV, V,        etc.)</td>
</tr>
</tbody>
</table>
<h3><strong>Note:</strong> No versions of Internet Explorer (including   IE8) support the property values   &quot;decimal-leading-zero&quot;, &quot;lower-greek&quot;, &quot;lower-latin&quot;, &quot;upper-latin&quot;,   &quot;armenian&quot;, or &quot;georgian&quot;.</h3>
<hr />
<h2>An Image as The List Item Marker</h2>
<p>To specify an image as the list item marker, use the list-style-image   property:</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> ul<br />
                {<br />
                list-style-image: url(&#8217;sqpurple.gif&#8217;);<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>The example above does not display equally in all browsers. IE and   Opera will display the image-marker a little bit higher than Firefox,   Chrome, and Safari.</p>
<p>If you want the image-marker to be placed equally in all browsers, a   crossbrowser solution is explained below.</p>
<h2>Crossbrowser Solution</h2>
<p>The following example displays the image-marker equally in all   browsers:</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> ul<br />
                {<br />
                list-style-type: none;<br />
                padding: 0px;<br />
                margin: 0px;<br />
                }<br />
                li<br />
                {<br />
                background-image: url(sqpurple.gif);<br />
                background-repeat: no-repeat;<br />
                background-position: 0px 5px; <br />
                padding-left: 14px; <br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Example explained:</p>
<ul>
<li>For ul:
<ul>
<li>Set the list-style-type to none to remove the list item marker</li>
<li>Set both padding and margin to 0px (for cross-browser   compatibility)</li>
</ul>
</li>
<li>For li:
<ul>
<li>Set the URL of the image, and show it only once (no-repeat)</li>
<li>Position the image where you want   	it (left 0px and   	down 5px)</li>
<li>Position the text in the list with padding-left</li>
</ul>
</li>
</ul>
<hr />
<h2>List &#8211; Shorthand property</h2>
<p>It is also possible to specify all   the list properties in one, single property. This is called a shorthand   property.</p>
<p>The shorthand property used for lists, is the list-style property:</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> ul<br />
                {<br />
                list-style: square url(&quot;sqpurple.gif&quot;);<br />
                }</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>When using the shorthand property, the order of the values are:</p>
<ul>
<li>list-style-type</li>
<li>list-style-position (for a description, see the CSS properties   table below)</li>
<li>list-style-image</li>
</ul>
<p>It does not matter if one of the values above are missing, as long as   the rest are in the specified order.</p>
<hr />
<h2>All CSS List Properties</h2>
<p>The number in 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="20%">Property</th>
<th align="left" width="48%">Description</th>
<th align="left" width="25%">Values</th>
<th align="left" width="7%">CSS</th>
</tr>
<tr>
<td>list-style</td>
<td>Sets all the properties for        a list in one declaration</td>
<td><em>list-style-type<br />
        list-style-position<br />
        list-style-image<br />
      </em>inherit</td>
<td>1</td>
</tr>
<tr>
<td>list-style-image</td>
<td>Specifies an image as the list-item marker</td>
<td>URL<br />
        none<br />
        inherit</td>
<td>1</td>
</tr>
<tr>
<td>list-style-position</td>
<td>Specifies if the list-item markers should appear inside or   	outside the content flow</td>
<td>inside<br />
        outside<br />
        inherit</td>
<td>1</td>
</tr>
<tr>
<td>list-style-type</td>
<td>Specifies the type of list-item marker</td>
<td>none<br />
        disc<br />
        circle<br />
        square<br />
        decimal<br />
        decimal-leading-zero<br />
        armenian<br />
        georgian<br />
        lower-alpha<br />
        upper-alpha<br />
        lower-greek<br />
        lower-latin<br />
        upper-latin<br />
        lower-roman<br />
        upper-roman<br />
        inherit</td>
<td>1</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-styling/css-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Links</title>
		<link>http://jaffnacampus.com/css/css-styling/css-links/</link>
		<comments>http://jaffnacampus.com/css/css-styling/css-links/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:22:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Styling]]></category>
		<category><![CDATA[CSS Links]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=147</guid>
		<description><![CDATA[Links can be styled in different ways.

Styling Links
Links can be style with any CSS property (e.g. color, font-family,   [...]]]></description>
			<content:encoded><![CDATA[<p>Links can be styled in different ways.</p>
<hr />
<h2>Styling Links</h2>
<p>Links can be style with any CSS property (e.g. color, font-family,   background-color).</p>
<p>Special for links are that they can be styled   differently depending on what state they are in.</p>
<p>The four links states are: </p>
<ul>
<li>a:link &#8211; a normal, unvisited link</li>
<li>a:visited &#8211; a link the user has visited</li>
<li>a:hover &#8211; a link when the user mouses over it</li>
<li>a:active &#8211; a link the moment it is clicked</li>
</ul>
<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>
</td>
</tr>
</tbody>
</table>
<p>When setting the style for several link states, there are some order   rules:</p>
<ul>
<li>a:hover MUST come after a:link and a:visited</li>
<li>a:active MUST come after a:hover</li>
</ul>
<hr />
<h2>Common Link Styles</h2>
<p>In the example above the link changes color depending on what   state it is in.</p>
<p>Lets go through some of the other common ways to style links:</p>
<h2>Text Decoration</h2>
<p>The text-decoration property is mostly used to remove underlines from   links:</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> a:link {text-decoration:none;}<br />
                a:visited {text-decoration:none;}<br />
                a:hover {text-decoration:underline;}<br />
                a:active {text-decoration:underline;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h2>Background Color</h2>
<p>The background-color property specifies the background color for   links:</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:link {background-color:#B2FF99;}<br />
                a:visited {background-color:#FFFF85;}<br />
                a:hover {background-color:#FF704D;}<br />
                a:active {background-color:#FF704D;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-styling/css-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Font</title>
		<link>http://jaffnacampus.com/css/css-styling/css-font/</link>
		<comments>http://jaffnacampus.com/css/css-styling/css-font/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:21:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Styling]]></category>
		<category><![CDATA[CSS Font]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=145</guid>
		<description><![CDATA[CSS font properties define the font family, boldness,   size, and   the style of a text.

Difference Between [...]]]></description>
			<content:encoded><![CDATA[<p>CSS font properties define the font family, boldness,   size, and   the style of a text.</p>
<hr />
<h2>Difference Between Serif and Sans-serif Fonts</h2>
<p><img alt="Serif vs. Sans-serif" src="http://w3schools.com/css/serif.gif" border="0" height="142" width="398" /></p>
<p><img src="http://w3schools.com/images/lamp.gif" alt="Remark" border="0" /> On computer screens, sans-serif fonts are considered easier   to read than   serif fonts.</p>
<hr />
<h2>CSS Font Families</h2>
<p>In CSS, there are two types of font family names:</p>
<ul>
<li><strong>generic family</strong> &#8211; a group of font families with a   	similar look (like &quot;Serif&quot; or &quot;Monospace&quot;)</li>
<li><strong>font family</strong> &#8211; a specific font family (like &quot;Times New Roman&quot;     	or &quot;Arial&quot;)</li>
</ul>
<table id="table1" border="1" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<th align="left" width="20%">Generic family</th>
<th align="left" width="30%">Font family</th>
<th align="left" width="50%">Description</th>
</tr>
<tr>
<td>Serif</td>
<td>Times   New Roman<br />
        Georgia</td>
<td>Serif fonts have small lines at the ends on some characters</td>
</tr>
<tr>
<td>Sans-serif</td>
<td>Arial<br />
        Verdana</td>
<td>&quot;Sans&quot; means without &#8211; these fonts do not have the   lines at the ends of characters</td>
</tr>
<tr>
<td>Monospace</td>
<td>Courier New<br />
        Lucida   Console</td>
<td>All monospace characters has the same width</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Font Family</h2>
<p>The font family of a text is set with the font-family property.</p>
<p>The font-family property should hold several font names as a   &quot;fallback&quot; system.   If the browser does not support the first font, it tries the next font.</p>
<p>Start with the font you want, and end with a generic family, to let   the   browser pick a similar font in the generic family, if no other fonts are     available. </p>
<p><strong>Note</strong>: If the name of a font family is more than one word, it   must be in   quotation marks, like font-family: &quot;Times New Roman&quot;.</p>
<p>More than one font family is specified in a comma-separated list:</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{font-family:&quot;Times New Roman&quot;, Times, serif;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<hr />
<h2>Font Style</h2>
<p>The font-style property is mostly used to specify italic text.</p>
<p>This property has three values:</p>
<ul>
<li>normal &#8211; The text is shown normally</li>
<li>italic &#8211; The text is shown in italics</li>
<li>oblique &#8211; The text is &quot;leaning&quot;  	(oblique is very similar to italic, but less supported)</li>
</ul>
<table id="table2" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table3" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> p.normal {font-style:normal;}<br />
                p.italic {font-style:italic;}<br />
                p.oblique {font-style:oblique;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Font Size</h2>
<p>The font-size property sets the size of the text.</p>
<p>Being able to manage the text size is important in web design.   However, you   should not use font size adjustments to make paragraphs look like   headings, or   headings look like paragraphs.</p>
<p>Always use the proper HTML tags, like &lt;h1&gt; &#8211; &lt;h6&gt; for   headings and &lt;p&gt; for   paragraphs.</p>
<p>The font-size value can be    an absolute, or relative size.</p>
<p>Absolute size:</p>
<ul>
<li>Sets the text to a specified size</li>
<li>Does not allow a user to change the text size in all browsers (bad   for accessibility   	reasons)</li>
<li>Absolute size is useful when the physical size of the output is   known</li>
</ul>
<p>Relative size:</p>
<ul>
<li>Sets the size relative to surrounding elements</li>
<li>Allows a user to change the text size in browsers</li>
</ul>
<h3>If you do not specify   a font size, the default size for normal text, like paragraphs, is 16px   (16px=1em).</h3>
<hr />
<h2>Set Font Size With Pixels</h2>
<p>Setting the text size with pixels, gives you full control over the   text size:</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 {font-size:40px;}<br />
                h2 {font-size:30px;}<br />
                p {font-size:14px;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>The example above allows Firefox, Chrome, and Safari to resize the   text, <strong>but not Internet   Explorer</strong>.</p>
<p>The text can be resized in all browsers using the zoom tool   (however, this resizes the entire page, not just the text).</p>
<hr />
<h2>Set Font Size With Em</h2>
<p>To avoid the resizing problem with Internet Explorer, many   developers use em instead of pixels.</p>
<p>The em size unit is recommended by the W3C.</p>
<p>1em is equal to the current font size. The default text size in   browsers is   16px. So, the default size of 1em is 16px.</p>
<p>The size can be calculated from pixels to em using this formula: <em>pixels</em>/16=<em>em</em></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 {font-size:2.5em;} /* 40px/16=2.5em */<br />
                h2 {font-size:1.875em;} /* 30px/16=1.875em */<br />
                p {font-size:0.875em;} /* 14px/16=0.875em */</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>In the example above, the text size in em is the same as the previous   example   in pixels. However, with the em size, it is possible to adjust the text   size   in all browsers.</p>
<p>Unfortunately, there is still a problem with IE.   When resizing the text, it becomes larger than it should   when made larger, and smaller than it should when made smaller.</p>
<hr />
<h2>Use a Combination of Percent and Em</h2>
<p>The solution that works in all browsers, is to set a default   font-size in   percent for the body 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> body {font-size:100%;}<br />
                h1 {font-size:2.5em;}<br />
                h2 {font-size:1.875em;}<br />
                p {font-size:0.875em;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Our code now works great! It shows the same text size in   all browsers, and allows all browsers to zoom or resize the text!</p>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-styling/css-font/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Text</title>
		<link>http://jaffnacampus.com/css/css-styling/css-text/</link>
		<comments>http://jaffnacampus.com/css/css-styling/css-text/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:18:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Styling]]></category>
		<category><![CDATA[CSS Text]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=143</guid>
		<description><![CDATA[
text formatting
This   text is styled with some of the text formatting properties. The heading   uses the [...]]]></description>
			<content:encoded><![CDATA[<div>
<h1>text formatting</h1>
<p>This   text is styled with some of the text formatting properties. The heading   uses the text-align, text-transform, and color properties.  The paragraph is indented, aligned, and the space between characters is   specified.</p>
</div>
<h2>Text Color</h2>
<p>The color property is used to set the color of the text. The color   can be   specified by:</p>
<ul>
<li>name &#8211; a color name, like &quot;red&quot;</li>
<li>RGB &#8211; an RGB value, like &quot;rgb(255,0,0)&quot;</li>
<li>Hex &#8211; a hex value, like &quot;#ff0000&quot;</li>
</ul>
<p>The default color for a page is defined in the body selector.</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> body {color:blue;}<br />
                h1 {color:#00ff00;}<br />
                h2 {color:rgb(255,0,0);}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p><img src="http://w3schools.com/images/lamp.gif" alt="Remark" border="0" /> For W3C compliant CSS:   If you define the color property, you must also define the   background-color   property. </p>
<hr />
<h2>Text Alignment</h2>
<p>The text-align property is used to set the horizontal alignment of a   text.</p>
<p>Text can be   centered, or aligned to the left or right, or justified.</p>
<p>When text-align is set to &quot;justify&quot;, each line is stretched so that   every line has equal width, and the left and right   margins are straight (like in magazines and   newspapers).</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 {text-align:center;}<br />
                p.date {text-align:right;}<br />
                p.main {text-align:justify;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Text Decoration</h2>
<p>The text-decoration property is used to set or remove decorations   from text.</p>
<p>The text-decoration property is mostly used to remove underlines from   links for   design purposes:</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> a {text-decoration:none;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>It can also be used to decorate 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> h1 {text-decoration:overline;}<br />
                h2 {text-decoration:line-through;}<br />
                h3 {text-decoration:underline;}<br />
                h4 {text-decoration:blink;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<h3> It is not recommended   to underline text that is not a link, as this often confuse users.</h3>
<hr />
<h2>Text Transformation</h2>
<p>The text-transform property is used to specify uppercase and   lowercase letters   in a text.</p>
<p>It can be used to turn everything into uppercase or lowercase   letters, or   capitalize the first letter of each word.</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.uppercase {text-transform:uppercase;}<br />
                p.lowercase {text-transform:lowercase;}<br />
                p.capitalize {text-transform:capitalize;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Text Indentation</h2>
<p>The text-indentation property is used to specify the indentation of   the first line   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 {text-indent:50px;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>All CSS Text Properties</h2>
<p>The number in 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="20%">Property</th>
<th align="left" width="53%">Description</th>
<th align="left" width="20%">Values</th>
<th align="left" width="7%">CSS</th>
</tr>
<tr>
<td>color</td>
<td>Sets the color of a text</td>
<td><em>color</em></td>
<td>1</td>
</tr>
<tr>
<td>direction</td>
<td>Sets the text direction</td>
<td>ltr<br />
        rtl</td>
<td>2</td>
</tr>
<tr>
<td>line-height</td>
<td>Sets the distance between lines</td>
<td>normal<br />
        <em>number<br />
          length<br />
          %</em></td>
<td>1</td>
</tr>
<tr>
<td>letter-spacing</td>
<td>Increase or decrease the space between characters</td>
<td>normal<br />
        <em>length</em></td>
<td>1</td>
</tr>
<tr>
<td>text-align</td>
<td>Aligns the text in an element</td>
<td>left<br />
        right<br />
        center<br />
        justify</td>
<td>1</td>
</tr>
<tr>
<td>text-decoration</td>
<td>Adds decoration to text</td>
<td>none<br />
        underline<br />
        overline<br />
        line-through<br />
        blink</td>
<td>1</td>
</tr>
<tr>
<td>text-indent</td>
<td>Indents the first line of text in an element</td>
<td><em>length<br />
        %</em></td>
<td>1</td>
</tr>
<tr>
<td>text-shadow</td>
<td> </td>
<td>none<br />
        <em>color</em><br />
        <em>length</em></td>
<td> </td>
</tr>
<tr>
<td>text-transform</td>
<td>Controls the letters in an element</td>
<td>none<br />
        capitalize<br />
        uppercase<br />
        lowercase</td>
<td>1</td>
</tr>
<tr>
<td>unicode-bidi</td>
<td> </td>
<td>normal<br />
        embed<br />
        bidi-override</td>
<td>2</td>
</tr>
<tr>
<td>vertical-align</td>
<td>Sets the vertical alignment of an element</td>
<td>baseline<br />
        sub<br />
        super<br />
        top<br />
        text-top<br />
        middle<br />
        bottom<br />
        text-bottom<br />
        <em>length</em><br />
        <em>%</em></td>
<td>1</td>
</tr>
<tr>
<td>white-space</td>
<td>Sets how white space inside an element is handled</td>
<td>normal<br />
        pre<br />
        nowrap</td>
<td>1</td>
</tr>
<tr>
<td>word-spacing</td>
<td>Increase or decrease the space between words</td>
<td>normal<br />
        <em>length</em></td>
<td>1</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-styling/css-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Background</title>
		<link>http://jaffnacampus.com/css/css-styling/css-background/</link>
		<comments>http://jaffnacampus.com/css/css-styling/css-background/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:12:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS Styling]]></category>
		<category><![CDATA[CSS Background]]></category>

		<guid isPermaLink="false">http://jaffnacampus.com/?p=141</guid>
		<description><![CDATA[
CSS background properties are used to   define the background effects of an element.
CSS properties used for background effects:

background-color
background-image
background-repeat
background-attachment
background-position


Background [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>CSS background properties are used to   define the background effects of an element.</p>
<p>CSS properties used for background effects:</p>
<ul>
<li>background-color</li>
<li>background-image</li>
<li>background-repeat</li>
<li>background-attachment</li>
<li>background-position</li>
</ul>
</div>
<h2>Background Color</h2>
<p>The background-color property specifies the background color of an   element.</p>
<p>The background color of a page is defined in the body selector:</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> body {background-color:#b0c4de;} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>The background color can be specified by:</p>
<ul>
<li>name &#8211; a color name, like &quot;red&quot;</li>
<li>RGB &#8211; an RGB value, like &quot;rgb(255,0,0)&quot;</li>
<li>Hex &#8211; a hex value, like &quot;#ff0000&quot;</li>
</ul>
<p>In the example below, the h1, p, and div elements have different   background colors:</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 {background-color:#6495ed;}<br />
                p {background-color:#e0ffff;}<br />
                div {background-color:#b0c4de;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Background Image</h2>
<p>The background-image property specifies an image to use as the   background of an   element.</p>
<p>By default, the image is repeated so it covers the   entire element.</p>
<p>The background image for a page can be set like this:</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> body {background-image:url(&#8216;paper.gif&#8217;);} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Below is an example of a bad combination of text and background   image. The   text is almost not readable:</p>
<table id="table1" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<h2>Example</h2>
<table id="table2" border="0" cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td> body {background-image:url(&#8216;bgdesert.jpg&#8217;);} </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Background Image &#8211; Repeat Horizontally or Vertically</h2>
<p>By default, the background-image property repeats an image both   horizontally   and vertically.</p>
<p>Some images should be repeated only horizontally or vertically, or   they   will look strange, like this:  </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> body<br />
                {<br />
                background-image:url(&#8216;gradient2.png&#8217;);<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>If the image is repeated only horizontally (repeat-x), the background   will look   better:</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> body<br />
                {<br />
                background-image:url(&#8216;gradient2.png&#8217;);<br />
                background-repeat:repeat-x;<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Background Image &#8211; Set position and no-repeat</h2>
<p> <strong>When using a background image, use an image that does not   disturb the   text.</strong></p>
<p>Showing the image only once is specified by the background-repeat   property:</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> body<br />
                {<br />
                background-image:url(&#8216;img_tree.png&#8217;);<br />
                background-repeat:no-repeat;<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>In the example above, the background image is shown in the same place   as the text. We want to change the position of the image, so that it   does not   disturb the text too much.</p>
<p>The position of the image is specified by the background-position   property:</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> body<br />
                {<br />
                background-image:url(&#8216;img_tree.png&#8217;);<br />
                background-repeat:no-repeat;<br />
                background-position:top right;<br />
                } </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p></p>
<hr />
<h2>Background &#8211; Shorthand property</h2>
<p>As you can see from the examples above, there are many properties to   consider   when dealing with backgrounds.</p>
<p>To shorten the code, it is also possible to specify all the   properties in one   single property. This is called a shorthand property.</p>
<p>The shorthand property for background is simply &quot;background&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> body {background:#ffffff url(&#8216;img_tree.png&#8217;) no-repeat top right;}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p> When using the shorthand property the order of the property values are:</p>
<ul>
<li>background-color</li>
<li>background-image</li>
<li>background-repeat</li>
<li>background-attachment</li>
<li>background-position</li>
</ul>
<p>It does not matter if one of the property values are missing, as long   as the   ones that are present are in this order.</p>
]]></content:encoded>
			<wfw:commentRss>http://jaffnacampus.com/css/css-styling/css-background/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

