<?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>Clickfire &#187; CSS</title>
	<atom:link href="http://www.clickfire.com/viewpoints/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clickfire.com</link>
	<description>Web reviews and how to&#039;s for site owners, bloggers and social media users</description>
	<lastBuildDate>Mon, 30 Jan 2012 13:05:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Simplest Ever Cascading Style Sheets (CSS) Tutorial</title>
		<link>http://www.clickfire.com/simplest-ever-css-tutorial/</link>
		<comments>http://www.clickfire.com/simplest-ever-css-tutorial/#comments</comments>
		<pubDate>Sat, 24 Nov 2007 16:53:07 +0000</pubDate>
		<dc:creator>emory @ clickfire</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[beginner tutorials]]></category>
		<category><![CDATA[cascading style sheets]]></category>
		<category><![CDATA[css tutorial]]></category>

		<guid isPermaLink="false">http://www.clickfire.com/simplest-ever-css-tutorial/</guid>
		<description><![CDATA[Learn CSS with the simplest ever cascading style sheets tutorial.]]></description>
			<content:encoded><![CDATA[<h2>CSS Tutorial Requirements:</h2>
<ul>
<li>Beginners Only</li>
<li>Basic knowledge of HTML</li>
<li>No knowledge of CSS</li>
<li>5 &#8211; 10 minutes</li>
<li>2 brain cells of any size and color</li>
</ul>
<p><span id="more-63"></span></p>
<h2><em>Insultingly Easy</em></h2>
<p>Efficient use of Cascading Style Sheets means faster page load times for visitors and easier administration for webmasters. CSS are a set of rules that determine how page elements look (or how they will be styled). Elements are the items between the HTML tags that markup the structure of a web page document. For example, the &lt;body&gt; tag contains the body element.</p>
<p>There are 4 ways to use cascading style sheets: inline, embedded, imported and external. We&#8217;ll look at the one that&#8217;s the most powerful and widely used: external. With this method, an external CSS file is linked to the HTML document so that the CSS file can be easily changed to update the style of all HTML documents linking it.</p>
<h3>Step 1 &#8211; Basic CSS Syntax</h3>
<p>If you remember nothing else from this tutorial, make sure you embed the basic syntax for CSS deep into the crevasses of your brain:</p>
<p align="center">selector {property: value}</p>
<p>If you become confused, just chant &#8220;selector, property, value&#8221; three times and that should help get you back on track. The above three components of a CSS rule can be defined as follows:</p>
<ul>
<li>The selector is simply an HTML element such as h1, p, table, etc.</li>
<li>The property is the characteristic of the selector that you want to change such as color, font, width, height, etc.</li>
<li>A value is assigned to the property, such as a number defining the size of the font.</li>
</ul>
<p>A real life CSS example using the above syntax would be:</p>
<table width="49%" border="0" cellpadding="10">
<tbody>
<tr>
<td><strong>h1 {color: black; }</strong></td>
</tr>
</tbody>
</table>
<p>The above rule tells a browser like Internet Explorer or Netscape to display all text between the heading tags &lt;h1&gt; and &lt;/h1&gt; as black. A style sheet can set rules like this for any allowable HTML element. You will likely want to create style sheets with rules that make the heading, paragraph, link, and table text a certain color, font, and size. You&#8217;ll want the body background to be a certain color and maybe the tables to be a certain color.</p>
<p>Webmasters and developers might create a hundred or so rules in a given external style sheet. To get an idea of how this is done, expand the above example to include styling for font type, and size of the h1 selector:</p>
<table width="49%" border="0" cellspacing="0" cellpadding="10">
<tbody>
<tr>
<td width="235">
<p align="left"><strong>h1 {color: black;<br />
font-family: arial, helvetica;<br />
font-size: 14pt}</strong></p>
</td>
</tr>
</tbody>
</table>
<p>Notice:</p>
<ul>
<li>A colon, &#8220;<strong>:</strong>&#8221; separates the property and value declarations (as in <strong>color: </strong><strong>black</strong>).</li>
<li>The &#8220;<strong>{</strong>&#8221; curly braces enclose all the property and value declarations.</li>
<li>A comma, &#8220;<strong>,</strong>&#8221; appears between alternate values (if the browser can&#8217;t find <strong>arial</strong>, it loads <strong>helvetica</strong>). A comma can also separate multiple selectors.</li>
<li>A semicolon, &#8220;<strong>;</strong>&#8221; follows all lines except the last one. That&#8217;s because the semicolon signifies that another rule is to follow.</li>
</ul>
<p>What if you want to declare more rules? Go a bit further and add rules to style the paragraph tag (&lt;p&gt;) and throw in a background color for the body:</p>
<table width="49%" border="0" cellspacing="0" cellpadding="10">
<tbody>
<tr>
<td width="100%"><strong>h1 {color: black;<br />
font-family: arial, helvetica;<br />
font-size: 14pt}</strong><strong>p {color: gray;<br />
font-family: verdana;<br />
font-size: 12pt}</strong><strong>body {background-color: white}</strong></td>
</tr>
</tbody>
</table>
<p>The above example should show the heading in black 14pt arial, paragraphs in gray 12pt verdana, and a white body background.</p>
<p><strong>Tip:</strong> When declaring rules for fonts in your CSS file, remember to use a common font such as arial, verdana, helvetica, etc rather than an uncommon one. If your website&#8217;s visitors don’t have the font you reference, they will be welcomed by the unforgiving default font.</p>
<h3>Step 2 &#8211; Open Notepad</h3>
<p>From your Windows Start Menu, click Start &gt; Programs &gt; Accessories &gt; Notepad</p>
<p>You have probably used Notepad if you are familiar with HTML, however, any text editor or HTML editor should work fine for this CSS tutorial.</p>
<p align="center"><img src="http://www.clickfire.com/notepadcsswide.gif" alt="Notepad - Text editor for CSS or HTML" border="0" /></p>
<h3>Step 3 &#8211; Insert Code</h3>
<p>Copy and paste the final code from Step 1 into the blank Notepad document as below:</p>
<p align="center"><img src="http://www.clickfire.com/notepadcss2.gif" alt="CSS code in Notepad" border="0" /></p>
<p>This will be your external CSS file.</p>
<h3>Step 4 &#8211; Save CSS File</h3>
<p>In Notepad, go to File &gt; Save As</p>
<h3><img src="http://www.clickfire.com/save_as.gif" alt="Save As .css file" border="0" /></h3>
<p>Find your Desktop under &#8220;Save in:&#8221; and highlight it. Type the name &#8220;default.css&#8221; in the file name field.</p>
<p align="center"><img src="http://www.clickfire.com/file_name_css.gif" alt="Type a file name" border="0" /></p>
<p>Little known secret: an external CSS file is just a text file (.txt) saved with a &#8220;.css&#8221; extension.</p>
<h3>Step 5 &#8211; Create an HTML File</h3>
<p>Open Notepad again as in Step 2. Type in the following HTML code:</p>
<p align="center"><img src="http://www.clickfire.com/notepadcss.gif" alt="CSS link code in HTML document" border="0" /></p>
<p>This will be your HTML document that links to the cascading style sheet file created in the previous steps. Notice that the above code appears as very basic HTML except for the line of code between the &lt;head&gt; and &lt;/head&gt; tags which reads:</p>
<p align="center">&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;default.css&#8221;&gt;</p>
<p>This is what links the external CSS file &#8220;default.css&#8221; to the HTML document and causes the HTML document to style itself accordingly.</p>
<h3>Step 6 &#8211; Save as an HTML File</h3>
<p>In Notepad, go to File &gt; Save As</p>
<p>Save the file as in Step 4, except this time, save it on your Desktop as &#8220;mycsspage.htm.&#8221;</p>
<p>This is the HTML document file.</p>
<h3>Step 7 &#8211; Open the HTML File</h3>
<p>Look on your Desktop and double-click on the file you saved called &#8220;mycsspage.htm.&#8221; Your browser will open up and you should see this:</p>
<p align="center"><img src="http://www.clickfire.com/ie_css.gif" alt="External CSS displayed in IE" border="0" /></p>
<p>If the page in your browser doesn&#8217;t look something like the above, then the most likely reason is due to a typo somewhere in the CSS file or HTML document. A typo in the code linking your CSS document will prevent any styling from appearing.</p>
<p>Notice:</p>
<ul>
<li>The heading text is larger than the paragraph.</li>
<li>The heading color is black.</li>
<li>The paragraph color is gray.</li>
<li>The background color is white.</li>
</ul>
<p>Note:</p>
<p>It is very important to enter the file location or url correctly in the HTML document that links to the external cascading style sheet. Otherwise it will not display. In our example, both the external CSS file and the HTML document were in the same directory (your Desktop). In the real world, instead of linking to your desktop, you would link to the location of the external CSS file on your web server, in which case the path might look like this:</p>
<p align="center">&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;http://www.mydomain.com/default.css&#8221;&gt;</p>
<p align="center">instead of this:</p>
<p align="center">&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;default.css&#8221;&gt;</p>
<p>Experiment with changing the rules and adding new ones in the CSS file. Remember that you don&#8217;t have to use HTML tags like the font tag anymore, if you have defined fonts in an external cascading style sheet. By the way, you&#8217;ve just created a cascading style sheet.</p>
<p>There is much more to CSS than covered in this tutorial. There are also several versions of CSS: CSS1, CSS2, and CSS3 which become more powerful with each release. There are also advanced CSS features like class selectors that can greatly extend the webmaster&#8217;s control over the way web pages appear. Inheritance in CSS is another important concept that you may want to pursue.</p>
<p><a href="http://www.clickfire.com/download/csstutorial.zip">Download</a> a zip of the CSS Tutorial Files:</p>
<ul>
<li>default.css</li>
<li>mycsspage.htm</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.clickfire.com/simplest-ever-css-tutorial/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

