<?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>CSS Basics</title>
	<atom:link href="http://www.cssbasics.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cssbasics.com</link>
	<description>Everything you ever wanted to know about the basics of CSS</description>
	<lastBuildDate>Sat, 28 Jan 2012 18:43:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Create a Calendar With CSS</title>
		<link>http://www.cssbasics.com/create-a-calendar-with-css/</link>
		<comments>http://www.cssbasics.com/create-a-calendar-with-css/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 23:13:14 +0000</pubDate>
		<dc:creator>Wayne Ernest</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?p=91</guid>
		<description><![CDATA[A calendar can make a nice addition to your website and provide your visitors with additional benefits and value &#8211; two things that will make sure they keep coming back to view your site on a regular basis. Creating a basic calendar made up of six or seven columns or rows is a relatively easy [...]]]></description>
				<content:encoded><![CDATA[<p>A <a href="http://en.wikipedia.org/wiki/Calendar">calendar</a> can make a nice addition to your website and provide your visitors with additional benefits and value &#8211; two things that will make sure they keep coming back to view your site on a regular basis. Creating a basic calendar made up of six or seven columns or rows is a relatively easy undertaking with CSS. Follow the simple steps below to add your own calendar to your website.</p>
<p><strong>Create The Page</strong></p>
<p>Firstly, you will need to set up a new text editor file and create a new HTML document. The following code should be typed into your text editor to create a new file:</p>
<p><strong>New Page</strong></p>
<p>Make sure you save the file as .html so that your computer knows the file will be used to make a web page.</p>
<p><strong>Setting Up Your Table</strong></p>
<p>You will now need to add extra fields to your file to create a basic seven row table. Enter the following piece of code between theandtags in your main file:</p>
<table>
<tbody>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p>Once this step is completed, you should add the code designed for month display. Again, enter this code between the</p>
<p>and</p>
<p>tags above:</p>
<p><a href="#">Prev</a>November 2009<a href="#">Next</a></p>
<p>Similarly, create a row containing the days of the week&#8230;.:</p>
<p>SuMoTuWeThFrSa</p>
<p>&#8230;.and calendar days:</p>
<p>1234567</p>
<p>Now that the main body of your calendar is completed, you can define your table with various stylistic touches. For example, this piece of code will create a black border around the table and fill the page with the calendar:</p>
<p>When you are happy with the layout of your calendar, you are free to publish it to your website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/create-a-calendar-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download CSS Styles From a Website</title>
		<link>http://www.cssbasics.com/download-css-styles-from-a-website/</link>
		<comments>http://www.cssbasics.com/download-css-styles-from-a-website/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 23:08:11 +0000</pubDate>
		<dc:creator>Wayne Ernest</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?p=89</guid>
		<description><![CDATA[If you are looking to build your own website, you really need to have at least some knowledge of CSS code in order to layout your site. Although it can seem complicated at first, it can be easy to get the hang of eventually. Of course, that’s not to say there aren’t websites already out [...]]]></description>
				<content:encoded><![CDATA[<p>If you are looking to build your own website, you really need to have at least some knowledge of CSS code in order to layout your site. Although it can seem complicated at first, it can be easy to get the hang of eventually. Of course, that’s not to say there aren’t websites already out there that are using styles you like the look of and want to emulate.</p>
<p>When you see a website that particularly catches your eye, you needn’t spend hours writing the code from scratch &#8211; in fact, you can often download the CSS they used and replicate it yourself. Once you have found a website that you like the look of, follow these simple steps in order to access the necessary code.</p>
<p><strong>Viewing Source Code</strong></p>
<p>Once you have pointed your browser to that particularly web page, you will need to access its source code in order to download it. There are a number of ways to do this &#8211; for example, if you are using Firefox as a browser you can simply hold down ‘ctrl’ and ‘U’ and the source code will appear. Similarly, the most recent versions of Internet Explorer allow you to right click on the page and ‘view source’. If neither of these options are working, you can usually look at the source code by selecting ‘View’ from the top menu.</p>
<p><strong>Includes</strong></p>
<p>Although very occasionally the styles of webpages are kept within the pages themselves, most of the time they are added to the core HTML of the page with ‘includes’. These are designated bits of code that tell the webpage to use an external style for layout. A typical ‘include’ may look like this:</p>
<p>href=”/css/styles.css”</p>
<p>You can find the ‘includes’ in the CSS source code by pressing ‘ctrl’ and ‘F’ to execute a find, then typing CSS.</p>
<p><strong>Domains</strong></p>
<p>Once you have located the ‘includes’, you can add them onto the end of your chosen website’s URL to view the style sheet. For example, if you were looking to replicate the style from www.thispersonswebsite.com and the above code was found as the ‘include’, you would type www.thispersonswebsite.com/css/styles.css into your navigation bar. Once you select to search on this domain, you should see the style sheet of the website will all the various bits of code necessary for replicating the look.</p>
<p><a href="http://en.wikipedia.org/wiki/Uploading_and_downloading"><strong>Download</strong></a></p>
<p>You can now simply select ‘File’ and ‘Save As’ from the drop down menu to save the CSS style code to your desktop or another area of your computer. Alternatively, you can copy and paste the entire code if you are wary of leaving any behind when you save it.</p>
<p>It is worth remembering that a web page may use a number of different styles and layouts. If this is the case and there are different .css files for each web page, you will need to download and save each one. Once you have down this, you will be free to play around with the look and feel of your own website using this code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/download-css-styles-from-a-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Table With CSS</title>
		<link>http://www.cssbasics.com/creating-a-table-with-css/</link>
		<comments>http://www.cssbasics.com/creating-a-table-with-css/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 23:04:40 +0000</pubDate>
		<dc:creator>Wayne Ernest</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?p=86</guid>
		<description><![CDATA[Whether you are creating an entire web page or just a simple blog, chances are that you will need to use the CSS programming language to lay out and plan your site. CSS is useful for a variety of HTML and web projects. If you want to use CSS to create a table on your [...]]]></description>
				<content:encoded><![CDATA[<p>Whether you are creating an entire web page or just a simple blog, chances are that you will need to use the CSS programming language to lay out and plan your site. CSS is useful for a variety of HTML and web projects. If you want to use CSS to create a table on your site, you should follow the below steps to make your table is programmed correctly.</p>
<p><strong>Tables and Borders</strong></p>
<p>You should first decide what kind of table you are going to have &#8211; this includes setting up the correct number of columns and rows. You can use various HTML elements to create column and row headers, depending on the layout of the table. Next, you will need to create come borders for your table. The first border you create should be for the outside areas of the table, and then you may wish to set up a border-collapse rule. This will ensure that there is only one line between the cells in your table. Here is an example of how your code should look if you choose to set up the border-collapse rule:</p>
<p>table {</p>
<p>border-width: 1px;</p>
<p>border-style: solid;</p>
<p>border-color: #000000;</p>
<p>border-collapse: collapse;</p>
<p>}</p>
<p>Now you can also choose to add a border around the header and data cells in your table. Should you choose to keep the border-collapse rule in place, your table will have a single border between its cells. An example of this code would look like this:</p>
<p>th, td {</p>
<p>border-width: 1px;</p>
<p>border-style: solid;</p>
<p>border-color: #000000;</p>
<p>}</p>
<p><strong>Captions</strong></p>
<p>CSS can also be used to create captions for your tables. Depending on where you want to place your caption in your table, you can create either a caption-side: top or caption-side: bottom rule. Switch between the rules and play around with your table if you are not certain which layout will look best.</p>
<p>As standard, the caption text will appear centered and in bold in your table. If you want to change this style, you can write additional rules to alter the color and size of your font. For example, the following rule will alter the spacing of the letter and the variant of the font in your caption:</p>
<p>th {</p>
<p>font-variant: small-caps;</p>
<p>color: #666666;</p>
<p>letter-spacing: 0.2em;</p>
<p>}</p>
<p>Alignment</p>
<p>CSS code can also alter the alignment of your table. Text in cells in automatically aligned in the middle of data rows with CSS, although you can change it to align at the top with the following piece of code:</p>
<p>td {</p>
<p>vertical-align: top;</p>
<p>}</p>
<p>Similarly, if you want your code aligned at the top and in the center of the row, rather than fully justified to the left as it appears in the default setting, you can add this line to the rule:</p>
<p>td {</p>
<p>vertical-align: top;</p>
<p>text-align: center;</p>
<p>}</p>
<p>These basic rules should help you create tables and edit them for your web pages.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/creating-a-table-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Books</title>
		<link>http://www.cssbasics.com/books/</link>
		<comments>http://www.cssbasics.com/books/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 05:01:57 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?page_id=71</guid>
		<description><![CDATA[]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.cssbasics.com/order/4"><img src="http://www.cssbasics.com/ad1.gif" alt="Designing without Tables" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/books/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print all chapters</title>
		<link>http://www.cssbasics.com/print-all-chapters/</link>
		<comments>http://www.cssbasics.com/print-all-chapters/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 04:57:20 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?page_id=68</guid>
		<description><![CDATA[NOTE: We also have this in PDF format. We also have an assortment of helpful CSS &#38; related books. Chapter: 1 &#8211; Introduction to CSS A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it&#8217;s style. As always you use your (X)HTML file to arrange the content, but [...]]]></description>
				<content:encoded><![CDATA[<p><strong>NOTE: </strong> We also have this in <a href="http://www.cssbasics.com/download-all-chapters/">PDF format</a>. We also have an assortment of <a href="http://www.cssbasics.com/books/">helpful CSS &amp; related books</a>.</p>
<h1>Chapter: 1 &#8211; Introduction to CSS</h1>
<p>A CSS (cascading style sheet) file allows you to separate your web sites (X)HTML content from it&#8217;s style. As always you use your (X)HTML file to arrange the content, but all of the presentation (fonts, colors, background, borders, text formatting, link effects &amp; so on&#8230;) are accomplished within a CSS.</p>
<p>At this point you have some choices of how to use the CSS, either internally or externally.</p>
<p>      <a name="internal_stylesheets"></a><br />
<h2>Internal Stylesheet</h2>
<p>First we will explore the internal method. This way you are simply placing the CSS code within the &lt;head&gt;&lt;/head&gt; tags of each (X)HTML file you want to style with the CSS. The format for this is shown in the example below.</p>
<p class="code">&lt;head&gt;<br />&lt;title&gt;&lt;title&gt;<br />&lt;style type=&#8221;text/css&#8221;&gt;<br /><em><span class="paths">CSS Content Goes Here</span></em><br />&lt;/style&gt;<br />&lt;/head&gt;<br />&lt;body&gt;</p>
<p>With this method each (X)HTML file contains the CSS code needed to style the page. Meaning that any changes you want to make to one page, will have to be made to all. This method can be good if you need to style only one page, or if you want different pages to have varying styles.</p>
<p>      <a name="external_stylesheets"></a><br />
<h2>External Stylesheet</h2>
<p>Next we will explore the external method. An external CSS file can be created with any text or HTML editor such as &#8220;Notepad&#8221; or &#8220;Dreamweaver&#8221;. A CSS file contains no (X)HTML, only CSS. You simply save it with the .css file extension. You can link to the file externally by placing one of the following links in the head section of every (X)HTML file you want to style with the CSS file.</p>
<p class="code">&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=<em><span class="paths">&#8220;Path To stylesheet.css&#8221;</span></em> /&gt;</p>
<p>Or you can also use the @import method as shown below</p>
<p class="code">&lt;style type=&#8221;text/css&#8221;&gt;@import url(<em><span class="paths">Path To stylesheet.css</span></em>)&lt;/style&gt;</p>
<p>Either of these methods are achieved by placing one or the other in the head section as shown in example below.</p>
<p class="code">&lt;head&gt;<br />&lt;title&gt;&lt;title&gt;<br /><em><span class="paths">&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221;href=&#8221;style.css&#8221; /&gt;</span></em><br />&lt;/head&gt;<br />&lt;body&gt;</p>
<p>or</p>
<p>&lt;head&gt;<br />&lt;title&gt;&lt;title&gt;<br />&lt;style type=&#8221;text/css&#8221;&gt; <em><span class="paths">@import url(<em><span class="paths">Path To stylesheet.css</span></em>)</span></em> &lt;/style&gt;<br />&lt;/head&gt;<br />&lt;body&gt;</p>
<p>By using an external style sheet, all of your (X)HTML files link to one CSS file in order to style the pages. This means, that if you need to alter the design of all your pages, you only need to edit one .css file to make global changes to your entire website.</p>
<p>Here are a few reasons this is better.</p>
<ul>
<li>Easier Maintenance</li>
<li>Reduced File Size</li>
<li>Reduced Bandwidth</li>
<li>Improved Flexibility</li>
</ul>
<p><strong>Are you getting the idea? It&#8217;s really cool.</strong></p>
<p>      <a name="cascading_order"></a><br />
<h2>Cascading Order</h2>
<p>In the previous paragraphs, I have explained how to link to a css file either internally or externally. If you understood, than I am doing a good job. If not don&#8217;t fret, there is a long way to go before we are finished. Assuming you have caught on already, you are probably asking, well can I do both? The answer is yes. You can have both internal, external, and now wait a minute a third way? Yes inline styles also.</p>
<p>      <a name="inline_styles"></a><br />
<h3>Inline Styles</h3>
<p>I have not mentioned them until now because in a way they defeat the purpose of using CSS in the first place. Inline styles are defined right in the (X)HTML file along side the element you want to style. See example below.</p>
<p><span class="code">&lt;p style=&#8221;color: #ff0000;&#8221;&gt;<em>Some red text</em>&lt;/p&gt;</span></p>
<p style="color: #ff0000;">Some red text</p>
<p>Inline styles will NOT allow the user to change styles of elements or text formatted this way</p>
<p>      <a name="misc"></a><br />
<h3>So, which is better?</h3>
<p>So with all these various ways of inserting CSS into your (X)HTML files, you may now be asking well which is better, and if I use more than one method, in what order do these different ways load into my browser?</p>
<p>All the various methods will cascade into a new &#8220;pseudo&#8221; stylesheet in the following order:</p>
<ol>
<li>Inline Style (inside (X)HTML element)</li>
<li>Internal Style Sheet (inside the &lt;head&gt; tag)</li>
<li>External Style Sheet</li>
</ol>
<p>As far as which way is better, it depends on what you want to do. If you have only one file to style then placing it within the &lt;head&gt;&lt;/head&gt; tags (internal) will work fine. Though if you are planning on styling multiple files then the external file method is the way to go.</p>
<p>Choosing between the &lt;link related=&gt; &amp; the @import methods are completely up to you. I will mention that the @import method may take a second longer to read the CSS file in Internet Explorer than the &lt;link related=&gt; option. To combat this see&nbsp;<a href="http://www.bluerobot.com/web/css/fouc.asp" title="FOUC">Flash of unstyled content</a></p>
<h2>Users with Disabilities</h2>
<p>The use of external style sheets also can benefit users that suffer from disabilities. For instance, a user can turn off your stylesheet or substitute one of there own to increase text size, change colors and so on. For more information on making your website accessible to all users please read <a href="http://diveintoaccessibility.org/" title="30 days to a more accessible web site">Dive into accessibility</a></p>
<h2>Power Users</h2>
<p>Swapping stylesheets is beneficial not only for users with disabilities, but also power users who are particular about how they read Web documents.</p>
<h2>Browser Issues</h2>
<p>You will discover as you delve farther into the world of CSS that all browsers are not created equally, to say the least. CSS can and will render differently in various browsers causing numerous headaches.</p>
<h1>Chapter 2 &#8211; CSS Syntax</h1>
<p>The syntax for CSS is different than that of (X)HTML markup. Though it is not too confusing, once you take a look at it. It consists of only 3 parts.</p>
<p class="code">selector { property: value }</p>
<p>The selector is the (X)HTML element that you want to style. The property is the actual property title, and the value is the style you apply to that property.</p>
<p>Each selector can have multiple properties, and each property within that selector can have independent values. The property and value are seperated with a colon and contained within curly brackets. Multiple properties are seperated by a semi colon. Multiple values within a property are sperated by commas, and if an individual value contains more than one word you surround it with quotation marks. As shown below.</p>
<p class="code">body {<br />&nbsp;&nbsp;background: #eeeeee;<br />&nbsp;&nbsp;font-family: &#8220;Trebuchet MS&#8221;, Verdana, Arial, serif;<br />}</p>
<p>As you can see in the above code I have seperated the color from the font-family with a semi-colon, seperated the various fonts with commas and contained the &#8220;Trebuchet MS&#8221; within quotations marks. The final result sets the body color to light grey, and sets the font to ones that most users will have installed on there computer.</p>
<p>I have changed the way I layout my code, but you can arrange it in one line if you choose. I find that it is more readable if I spread each property to a seperate line, with a 2 space indention.</p>
<p>      <a name="inheritance"></a><br />
<h2>Inheritance</h2>
<p>When you nest one element inside another, the nested element will inherit the properties assigned to the containing element. Unless you modify the inner elements values independently.</p>
<p>For example, a font declared in the body will be inherited by all text in the file no matter the containing element, unless you declare another font for a specific nested element.</p>
<p class="code">body {font-family: Verdana, serif;}</p>
<p>Now all text within the (X)HTML file will be set to Verdana.</p>
<p>If you wanted to style certain text with another font, like an h1 or a paragraph then you could do the following.</p>
<p class="code">h1 {font-family: Georgia, sans-serif;}<br />p {font-family: Tahoma, serif;}</p>
<p>Now all &lt;h1&gt; tags within the file will be set to Georgia and all &lt;p&gt; tags are set to Tahoma, leaving text within other elements unchanged from the body declaration of Verdana.</p>
<p>There are instances where nested elements do not inherit the containing elements properties.</p>
<p>For example, if the body margin is set to 20 pixels, the other elements within the file will not inherit the body margin by default.</p>
<p class="code">body {margin: 20px;}</p>
<p>      <a name="combining_selectors"></a><br />
<h2>Combining Selectors</h2>
<p>You can combine elements within one selector in the following fashion.</p>
<p class="code">h1, h2, h3, h4, h5, h6 {<br />&nbsp;&nbsp;color: #009900;<br />&nbsp;&nbsp;font-family: Georgia, sans-serif;<br />}</p>
<p>As you can see in the above code, I have grouped all the header elements into one selector. Each one is seperated by a comma. The final result of the above code sets all headers to green and to the specified font. If the user does not have the first font I declared it will go to another sans-serif font the user has installed on there computer.</p>
<p>      <a name="comment_tags"></a><br />
<h2>Comment tags</h2>
<p>Comments can be used to explain why you added certain selectors within your css file. So as to help others who may see your file, or to help you remember what you we&#8217;re thinking at a later date. You can add comments that will be ignored by browsers in the following manner.</p>
<p class="code">/* This is a comment */</p>
<p>You will note that it begins with a / (forward slash) and than an * (asterisks) then the comment, then the closing tag which is just backward from the opening tag * (asterisks) then the / (forward slash).</p>
<h1>Chapter 3: CSS Classes</h1>
<p>The class selector allows you to style items within the same (X)HTML element differently. Similiar to what I mentioned in the introduction about inline styles. Except with classes the style can be overwritten by changing out stylesheets. You can use the same class selector again and again within an (X)HTML file.</p>
<p>To put it more simply, this sentence you are reading is defined in my CSS file with the following.</p>
<p class="code">p &#123; <br />&nbsp;&nbsp;font-size&#58; small&#59; <br />&nbsp;&nbsp;color&#58; #333333<br />&#125;</p>
<p>Pretty simple, but lets say that I wanted to change the word &#8220;sentence&#8221; to green bold text, while leaving the rest of the sentence untouched. I would do the following to my (X)HTML file.</p>
<p class="code">&#60;p&#62;<br />To put it more simply, this <span class="paths">&#60;span class=&#8221;greenboldtext&#8221;&#62;</span>sentence<span class="paths">&#60;/span&#62;</span> you are reading is styled in my CSS file by the following.<br />&#60;/p&#62;</p>
<p>Then in my CSS file I would add this style selector:</p>
<p class="code">.greenboldtext&#123; <br />&nbsp;&nbsp;font-size&#58; small&#59; <br />&nbsp;&nbsp;color&#58; #008080&#59;<br />&nbsp;&nbsp;font-weight&#58; bold&#59;<br />&#125;</p>
<p>The final result would look like the following:</p>
<p>To put it more simply, this <span class="greenboldtext">sentence</span> you are reading is styled in my CSS file by the following.</p>
<p>Please note that a class selector begins with a (<span class="paths">.</span>) period. The reason I named it &#8220;greenboldtext&#8221; is for example purposes, you can name it whatever you want. Though I do encourage you to use selector names that are descriptive. You can reuse the &#8220;greenboldtext&#8221; class as many times as you want.</p>
<h1>Chapter 4: CSS IDs</h1>
<p>IDs are similar to <a href="chapter_3_css_class.html" title="Chapter 3 - Classes">classes</a>, except once a specific id has been declared it cannot be used again within the same (X)HTML file.</p>
<p>I generally use IDs to style the layout elements of a page that will only be needed once, whereas I use <a href="chapter_3_css_class.html" title="Chapter 3 - Classes">classes</a> to style text and such that may be declared multiple times.</p>
<p>The main container for this page is defined by the following.</p>
<p class="code">&#60;div <span class="paths">id</span>=&#8221;container&#8221;&#62;<br />Everything within my document is inside this division.<br />&#60;/div&#62;</p>
<p>I have chosen the id selector for the &#8220;container&#8221; division over a class, because I only need to use it one time within this file.</p>
<p>Then in my CSS file I have the following:</p>
<p class="code"><span class="paths">#</span>container&#123; <br />&nbsp;&nbsp;width: 80%&#59;<br />&nbsp;&nbsp;margin: auto&#59;<br />&nbsp;&nbsp;padding: 20px&#59;<br />&nbsp;&nbsp;border: 1px solid #666&#59;<br />&nbsp;&nbsp;background: #ffffff&#59;<br />&#125;</p>
<p>You will notice that the id selector begins with a (<span class="paths">#</span>) number sign instead of a (<span class="paths">.</span>) period, as the class selector does.</p>
<h1>Chapter 5: CSS Divisions</h1>
<p>Ok so you have finished the first 4 chapters in my series. You have learned the very basics of CSS, how the syntax works and a bit about classes and IDs. Now we are gonna take a quick break from CSS and focus on the (X)HTML side of using it.</p>
<h2>Divsions</h2>
<p>Divisions are a block level (X)HTML element used to define sections of an (X)HTML file. A division can contain all the parts that make up your website. Including additional divisions, spans, images, text and so on.</p>
<p>You define a division within an (X)HTML file by placing the following between the &#60;body&#62;&#60;/body&#62; tags:</p>
<p class="code">&#60;div&#62;<br />Site contents go here<br />&#60;/div&#62;</p>
<p>Though most likely you will want to add some style to it. You can do that in the following fashion:</p>
<p class="code">&#60;div id=&#8221;container&#8221;&#62;<br />Site contents go here<br />&#60;/div&#62;</p>
<p>The CSS file contains this:</p>
<p class="code">#container&#123;<br />&nbsp;&nbsp;width: 70%&#59;<br />&nbsp;&nbsp;margin: auto&#59;<br />&nbsp;&nbsp;padding: 20px&#59;<br />&nbsp;&nbsp;border: 1px solid #666&#59;<br />&nbsp;&nbsp;background: #ffffff&#59;<br />&#125;</p>
<p>Now everything within that division will be styled by the &#8220;container&#8221; style rule, I defined within my CSS file. A division creates a linebreak by default. You can use both <a href="chapter_3_css_class.html" title="Chapter 3: Classes">classes</a> and <a href="chapter_4_css_id.html" title="Chapter 4 - IDs">IDs</a> with a division tag to style sections of your website.</p>
<h1>Chapter 6: CSS Spans</h1>
<p>Spans are very similar to divisions except they are an inline element versus a block level element. No linebreak is created when a span is declared.</p>
<p>You can use the span tag to style certain areas of text, as shown in the following:</p>
<p class="code">&#60;span class=&#8221;italic&#8221;&#62;This text is italic&#60;/span&#62;</p>
<p>Then in my CSS file:</p>
<p class="code">.italic&#123; <br />&nbsp;&nbsp;font-style: italic&#59; <br />&#125;</p>
<p>The final result is: <span class="italic">This text is italic.</span></p>
<p>The purpose of the last 2 chapters was to provide you with a basis for using CSS in an (X)HTML file. For a more detailed explaination of XHTML please visit <a href="http://www.w3schools.com/xhtml/xhtml_intro.asp" title="XHTML Tutorial">W3Schools</a></p>
<h1>Chapter 7: CSS Margins</h1>
<h3>Inherited: No</h3>
<p>As you may have guessed, the margin property declares the margin between an (X)HTML element and the elements around it. The margin property can be set for the top, left, right and bottom of an element. (see example below)</p>
<p class="code">&nbsp;&nbsp;margin-top&#58; <span class="paths">length percentage or auto</span>&#59; <br />&nbsp;&nbsp;margin-left&#58; <span class="paths">length percentage or auto</span>&#59;<br />&nbsp;&nbsp;margin-right&#58; <span class="paths">length percentage or auto</span>&#59;<br />&nbsp;&nbsp;margin-bottom&#58; <span class="paths">length percentage or auto</span>&#59;</p>
<p>As you can also see in the above example you have 3 choices of values for the margin property</p>
<ul>
<li>length</li>
<li>percentage</li>
<li>auto</li>
</ul>
<p>You can also declare all the margins of an element in a single property as follows:</p>
<p class="code">&nbsp;&nbsp;margin&#58; 10px 10px 10px 10px&#59;</p>
<p>If you declare all 4 values as I have above, the order is as follows:</p>
<ol>
<li>top</li>
<li>right</li>
<li>bottom</li>
<li>left</li>
</ol>
<p>If only one value is declared, it sets the margin on all sides. (see below)</p>
<p class="code">&nbsp;&nbsp;margin&#58; 10px&#59;</p>
<p>If you only declare two or three values, the undeclared values are taken from the opposing side. (see below)</p>
<p class="code">&nbsp;&nbsp;margin&#58; 10px 10px&#59; <span class="paths">/* 2 values */</span><br />&nbsp;&nbsp;margin&#58; 10px 10px 10px&#59; <span class="paths">/* 3 values */</span></p>
<p>You can set the margin property to negative values. If you do not declare the margin value of an element, the margin is 0 (zero).</p>
<p class="code">&nbsp;&nbsp;margin&#58; -10px&#59; </p>
<p>Elements like paragraphs have default margins in some browsers, to combat this set the margin to 0 (zero).</p>
<p class="code">&nbsp;&nbsp;p {margin&#58; 0&#59;}</p>
<p>Note: You do not have to add px (pixels) or whatever <a href="http://www.w3schools.com/css/css_units.asp" title="W3Schools">units</a> you use, if the value is 0 (zero).</p>
<p>You can see in the example below, the elements for this site are set to be 20px (pixels) from the body</p>
<p class="code">body&#123; <br />&nbsp;&nbsp;<span class="paths">margin: 20px&#59;</span><br />&nbsp;&nbsp;background: #eeeeee&#59;<br />&nbsp;&nbsp;font-size: small&#59;<br />&nbsp;&nbsp;font-family: Tahoma, Arial, &#8220;Trebuchet MS&#8221;, Helvetica, sans-serif&#59;<br />&nbsp;&nbsp;text-align: left&#59;<br />&#125;</p>
<h1>Chapter 8: CSS Padding</h1>
<h3>Inherited: No</h3>
<p>Padding is the distance between the border of an (X)HTML element and the content within it.</p>
<p>Most of the rules for <a href="chapter_7_css_margins.html" title="Chapter 7 - Margins">margins</a> also apply to padding, except there is no &#8220;auto&#8221; value, and negative values cannot be declared for padding.</p>
<p class="code">&nbsp;&nbsp;padding-top&#58; <span class="paths">length percentage</span>&#59; <br />&nbsp;&nbsp;padding-left&#58; <span class="paths">length percentage</span>&#59;<br />&nbsp;&nbsp;padding-right&#58; <span class="paths">length percentage</span>&#59;<br />&nbsp;&nbsp;padding-bottom&#58; <span class="paths">length percentage</span>&#59;</p>
<p>As you can also see in the above example you have 2 choices of values for the <span class="hilight">padding</span> property</p>
<ul>
<li>length</li>
<li>percentage</li>
</ul>
<p>You can also declare all the padding of an element in a single property as follows:</p>
<p class="code">&nbsp;&nbsp;padding&#58; 10px 10px 10px 10px&#59;</p>
<p>If you declare all 4 values as I have above, the order is as follows:</p>
<ol>
<li>top</li>
<li>right</li>
<li>bottom</li>
<li>left</li>
</ol>
<p>If only one value is declared, it sets the padding on all sides. (see below)</p>
<p class="code">&nbsp;&nbsp;padding&#58; 10px&#59;</p>
<p>If you only declare two or three values, the undeclared values are taken from the opposing side. (see below)</p>
<p class="code">&nbsp;&nbsp;padding&#58; 10px 10px&#59; <span class="paths">/* 2 values */</span><br />&nbsp;&nbsp;padding&#58; 10px 10px 10px&#59; <span class="paths">/* 3 values */</span></p>
<p>If you do not declare the padding value of an element, the padding is 0 (zero).</p>
<p>Note: You do not have to add px (pixels) or whatever <a href="http://www.w3schools.com/css/css_units.asp" title="W3Schools">units</a> you use, if the value is 0 (zero).</p>
<p>You can see in the example below, the main container for this site has 30px (pixels) of padding between the border and the text.</p>
<p class="code">#container&#123; <br />&nbsp;&nbsp;width: 70%&#59;<br />&nbsp;&nbsp;margin: auto&#59;<br />&nbsp;&nbsp;<span class="paths">padding: 30px&#59;</span><br />&nbsp;&nbsp;border: 1px solid #666&#59;<br />&nbsp;&nbsp;background: #ffffff&#59;<br />&#125;</p>
<h1>Chapter 9: CSS Text Properties</h1>
<h5>Inherited: Yes</h5>
<p>      <a name="color"></a><br />
<h2>Color</h2>
<p>You can set the color of text with the following:</p>
<p class="code">&nbsp;&nbsp;color: value;</p>
<p>Possible values are</p>
<ul>
<li>color name &#8211; example:(<span class="paths">red, black&#8230;</span>)</li>
<li>hexadecimal number &#8211; example:(<span class="paths">#ff0000, #000000</span>)</li>
<li>RGB color code &#8211; example:(<span class="paths">rgb(255, 0, 0), rgb(0, 0, 0)</span>)</li>
</ul>
<p>      <a name="letter_spacing"></a><br />
<h2>Letter Spacing</h2>
<p>You can adjust the space between letters in the following manner. Setting the value to 0, prevents the text from justifying. You can use negative values.</p>
<p class="code">&nbsp;&nbsp;letter-spacing: value;</p>
<p>Possible values are</p>
<ul>
<li>normal</li>
<li>length</li>
</ul>
<div class="example">
<p>Example:</p>
<p class="letter_space">These letters are spaced at 5px.</p>
</p></div>
<p>      <a name="text_align"></a><br />
<h2>Text Align</h2>
<p>You can align text with the following:</p>
<p class="code">&nbsp;&nbsp;text-align: value;</p>
<p>Possible values are</p>
<ul>
<li>left</li>
<li>right</li>
<li>center</li>
<li>justify</li>
</ul>
<div class="example">
<p>Examples:</p>
<p class="align_left">This text is aligned left.</p>
<p class="align_center">This text is aligned in the center.</p>
<p class="align_right">This text is aligned right.</p>
<p class="align_justify">This text is justified.</p>
</p></div>
<p>      <a name="text_decoration"></a><br />
<h2>Text Decoration</h2>
<p>You can decorate text with the following:</p>
<p class="code">&nbsp;&nbsp;text-decoration: value;</p>
<p>Possible values are</p>
<ul>
<li>none</li>
<li>underline</li>
<li>overline</li>
<li>line through</li>
<li>blink</li>
</ul>
<div class="example">
<p>Examples:</p>
<p class="underline">This text is underlined.</p>
<p class="overline">This text is overlined.</p>
<p class="line_through">This text has a line through it.</p>
<p class="blink">This text is blinking (not in internet explorer).</p>
</p></div>
<p>      <a name="text_indent"></a><br />
<h2>Text Indent</h2>
<p>You can indent the first line of text in an (X)HTML element with the following:</p>
<p class="code">&nbsp;&nbsp;text-indent: value;</p>
<p>Possible values are</p>
<ul>
<li>length</li>
<li>percentage</li>
</ul>
<div class="example">
<p>Examples:</p>
<p class="indent">This text is indented 10px pixels.</p>
</p></div>
<p>      <a name="text_transform"></a><br />
<h2>Text Transform</h2>
<p>You can control the size of letters in an (X)HTML element with the following:</p>
<p><span class="code">&nbsp;&nbsp;text-transform: value;</span></p>
<p>Possible values are</p>
<ul>
<li>none</li>
<li>capitalize</li>
<li>lowercase</li>
<li>uppercase</li>
</ul>
<div class="example">
<p>Examples:</p>
<p class="transform_caps">this first letter in each word is capitalized, though it is not in my file.</p>
<p class="transform_up">this text is all uppercase, though it is all lowercase in my file.</p>
<p class="transform_low">THIS TEXT IS ALL LOWERCASE. THOUGH IT IS ALL UPPERCASE IN MY FILE.</p>
</p></div>
<p>      <a name="white_space"></a><br />
<h2>White Space</h2>
<p>You can control the whitespace in an (X)HTML element with the following:</p>
<p><span class="code">&nbsp;&nbsp;white-space: value;</span></p>
<p>Possible values are</p>
<ul>
<li>normal</li>
<li>pre</li>
<li>nowrap</li>
</ul>
<p>      <a name="word_spacing"></a><br />
<h2>Word Spacing</h2>
<p>You can adjust the space between words in the following manner. You can use negative values.</p>
<p><span class="code">&nbsp;&nbsp;word-spacing: value;</span></p>
<p>Possible values are</p>
<ul>
<li>normal</li>
<li>length</li>
</ul>
<div class="example">
<p>Example:</p>
<p class="word_space">These words are spaced at 5px.</p>
</p></div>
<h1>Chapter 10: CSS Font Properties</h1>
<h5>Inherited: Yes</h5>
<h2>Font</h2>
<p>The <span class="hilight">font</span> property can set the style, weight, variant, size, line height and font:</p>
<p><span class="code">&nbsp;&nbsp;font: italic bold normal small/1.4em Verdana, sans-serif;</span></p>
<p>The above would set the text of an element to an italic style a bold weight a normal variant a relative size a line height of 1.4em and the font to Verdana or another sans-serif typeface.</p>
<p>      <a name="font_family"></a><br />
<h2>Font-Family</h2>
<p>You can set what font will be displayed in an element with the <span class="hilight">font-family</span> property.</p>
<p>There are 2 choices for values:</p>
<ul>
<li>family-name</li>
<li>generic family</li>
</ul>
<p>If you set a family name it is best to also add the generic family at the end. As this is a priortized list. So if the user does not have the specified font name it will use the same generic family. (see below)</p>
<p><span class="code">&nbsp;&nbsp;font-family: Verdana, sans-serif;</span></p>
<p>      <a name="font_size"></a><br />
<h2>Font Size</h2>
<p>You can set the size of the text used in an element by using the <span class="hilight">font-size</span> property.</p>
<p><span class="code">&nbsp;&nbsp;font-size: value;</span></p>
<p>There are a lot of choices for values:</p>
<ul>
<li>xx-large</li>
<li>x-large</li>
<li>larger</li>
<li>large</li>
<li>medium</li>
<li>small</li>
<li>smaller</li>
<li>x-small</li>
<li>xx-small</li>
<li>length</li>
<li>% (percent)</li>
</ul>
<p>There is quite a bit to learn about font sizes with CSS so, I am not even going to try to explain it. Actually there are already some great resources on how to size your text. (see below)</p>
<ul>
<li><a href="http://sitepoint.com/forums/showpost.php?p=1239970&amp;postcount=6" title="What size text should I use in my css?">What size text should I use in my css by Paul O&#8217;B</a></li>
<li><a href="http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html" title="Dive into accessibility - Day 26 using relative font sizes">Dive into accessibility &#8211; Font Sizes</a></li>
</ul>
<p>      <a name="font_style"></a><br />
<h2>Font Style</h2>
<p>You can set the style of text in a element with the <span class="hilight">font-style</span> property</p>
<p><span class="code">&nbsp;&nbsp;font-style: value;</span></p>
<p>Possible values are</p>
<ul>
<li>normal</li>
<li>itailc</li>
<li>oblique</li>
</ul>
<p>      <a name="font_variant"></a><br />
<h2>Font Variant</h2>
<p>You can set the variant of text within an element with the <span class="hilight">font-variant</span> property</p>
<p><span class="code">&nbsp;&nbsp;font-variant: value;</span></p>
<p>Possible values are</p>
<ul>
<li>normal</li>
<li>small-caps</li>
</ul>
<p>      <a name="font_weight"></a><br />
<h2>Font Weight</h2>
<p>You can control the weight of text in an element with the <span class="hilight">font-weight</span> property:</p>
<p><span class="code">&nbsp;&nbsp;font-weight: value;</span></p>
<p>Possible values are</p>
<ul>
<li>lighter</li>
<li>normal</li>
<li>100</li>
<li>200</li>
<li>300</li>
<li>400</li>
<li>500</li>
<li>600</li>
<li>700</li>
<li>800</li>
<li>900</li>
<li>bold</li>
<li>bolder</li>
</ul>
<h1>Chapter 11: CSS Anchors, Links and Pseudo Classes</h1>
<p>Below are the various ways you can use CSS to style links.</p>
<p class="code">a:link {color: #009900;}</p>
<p>      a:visited {color: #999999;}<br />
      a:hover {color: #333333;}<br />
      a:focus {color: #333333;}<br />
      a:active {color: #009900;}</p>
<p>Now lets take a look at what each one of the above link styles actually does.</p>
<p class="code">a:link {color: #009900;}</p>
<p>The first on the list sets the color of a link when no event is occuring</p>
<p class="code">a:visited {color: #999999;}</p>
<p>The second sets the color a link changes to, when the user has already visited that url</p>
<p class="code">a:hover {color: #333333;}</p>
<p>The third sets the color a link changes to as the user places their mouse pointer over the link</p>
<p class="code">a:focus {color: #333333;}</p>
<p>The fourth is primarilly for the same purpose as the last one, but this one is for users that are not using a mouse and are tabbing through the links via there keyboards tab key, it sets the color a link changes to as the user tabs through the links</p>
<p class="code">a:active {color: #009900;}</p>
<p>The fifth on the list sets the color a link changes to as it is pressed.</p>
<p>Lets look at an example: <a href="http://google.com/" class="example_link" title="Google">Google</a></p>
<p>If your last visit to Google is not stored in your cache than the above link to google is blue, if you have already been to google then the link should be grey. if you mouseover or tab through the links, the link will change to dark grey, and last but not least if you click and hold the link without releasing it you will see it return back to the original blue color.</p>
<p><img src="images/exclamation.gif" width="17" height="17" class="icon" alt="exclamation" />&nbsp; You must declare the a:link and a:visited before you declare a:hover. Furthermore, you must declare a:hover before you can declare a:active.</p>
<p>Using the above code will style all links on your web page, unless you declare a seperate set of link styles for a certain area of your webpage.</p>
<p>      <a name="pseudo_classes"></a><br />
<h2>Pseudo Classes</h2>
<p>You can set links contained in different parts of your web page to be different colors by using the pseudo class. For example, lets say you want your links in the content area to have a different color then the links in the left or right column of your webpage.</p>
<p>You can do this in the following fashion:</p>
<p class="code">#content a:link {color: #009900;}<br />
      #content a:visited {color: #999999;}</p>
<p>      #content a:hover {color: #333333;}<br />
      #content a:focus {color: #333333;}<br />
      #content a:active {color: #009900;}</p>
<p>Now assuming that you have your main content in a division named &#8220;content&#8221; all links within that division will now be styled by this new style selector. Should your selector have a different name, just change the #content selector to match your division name.</p>
<p>Then for the links in a column you could use the following:</p>
<p class="code">#column a:link {color: #009900;}</p>
<p>      #column a:visited {color: #999999;}<br />
      #column a:hover {color: #333333;}<br />
      #column a:focus {color: #333333;}<br />
      #column a:active {color: #009900;}</p>
<p>Once again, this assumes the name of the column division, just change the name to match yours.</p>
<p>This same method can be accomplished by declaring a class instead of an id.</p>
<p class="code">a.column:link {color: #009900;}<br />
      a.column:visited {color: #999999;}<br />
      a.column:hover {color: #333333;}<br />
      a.column:focus {color: #333333;}<br />
      a.column:active {color: #009900;}</p>
<p>Though in this case you will need to add a class to each link</p>
<p class="code">&#60;a <span class="paths">class=&#8221;column&#8221;</span> href=&#8221;" title=&#8221;"&#62;some link text&#60;/a&#62;</p>
<p>But, there is still yet an easier way</p>
<p class="code">.column a:link {color: #009900;}<br />
      .column a:visited {color: #999999;}</p>
<p>      .column a:hover {color: #333333;}<br />
      .column a:focus {color: #333333;}<br />
      .column a:active {color: #009900;}</p>
<p>Then in the (X)HTML file</p>
<p class="code">&#60;div class=&#8221;column&#8221;&#62;<br />&#60;a href=&#8221;" title=&#8221;"&#62;some link text&#60;/a&#62;<br />&#60;/div&#62;</p>
<p>There are other properties that can be added to links other than color, I was just trying to keep it simple. Almost any property that can be used to style <a href="http://www.w3schools.com/css/css_reference.asp#text" title="">text</a> and <a href="http://www.w3schools.com/css/css_reference.asp#font" title="W3Schools Fonts">fonts</a> can be used to style links also</p>
<h1>Chapter 12: CSS Backgrounds</h1>
<h5>Inherited: No</h5>
<p>      <a name="background"></a><br />
<h2>Background</h2>
<p>You can style the background of an element in one declaration with the <span class="hilight">background</span> property.</p>
<p class="code">background: #ffffff url(path_to_image) top left no-repeat fixed;</p>
<p>Values:</p>
<ul>
<li>attachment</li>
<li>color</li>
<li>image</li>
<li>position</li>
<li>repeat</li>
</ul>
<p>Or you can set each property individually</p>
<p>      <a name="background_attachment"></a><br />
<h2>Background Attachment</h2>
<p>If you are using an image as a background. You can set whether the background scrolls with the page or is fixed when the user scrolls down the page with the <span class="hilight">background-attachment</span> property</p>
<p class="code">background-attachment: value;</p>
<p>Values:</p>
<ul>
<li>fixed</li>
<li>scroll</li>
</ul>
<p>      <a name="background_color"></a><br />
<h2>Background Color</h2>
<p>You can specifically declare a color for the background of an element using the <span class="hilight">background-color</span> property.</p>
<p class="code">background-color: value;</p>
<p>Values:</p>
<ul>
<li>color name</li>
<li>hexadecimal number</li>
<li>RGB color code</li>
<li>transparent</li>
</ul>
<p>      <a name="background_image"></a><br />
<h2>Background Image</h2>
<p>You can set an image for the background of an element using the <span class="hilight">background-image</span> property.</p>
<p class="code">background-image: url(path_to_image);</p>
<p>Values:</p>
<ul>
<li>url</li>
<li>none</li>
</ul>
<p>      <a name="background_position"></a><br />
<h2>Background Position</h2>
<p>You can position an image used for the background of an element using the <span class="hilight">background-position</span> property.</p>
<p class="code">background-position: value;</p>
<p>Values:</p>
<ul>
<li>top left</li>
<li>top center</li>
<li>top right</li>
<li>center left</li>
<li>center center</li>
<li>center right</li>
<li>bottom left</li>
<li>bottom center</li>
<li>bottom right</li>
<li>x-% y-%</li>
<li>x-pos y-pos</li>
</ul>
<p>      <a name="background_repeat"></a><br />
<h2>Background Repeat</h2>
<p>You can set if an image set as a background of an element is to repeat (across=x &nbsp; and/or &nbsp; down=y) the screen using the <span class="hilight">background-repeat</span> property.</p>
<p class="code">background-repeat: value;</p>
<p>Values:</p>
<ul>
<li>no-repeat</li>
<li>repeat</li>
<li>repeat-x</li>
<li> repeat-y</li>
</ul>
<h1>Chapter 13: CSS Borders</h1>
<h5>Inherited: No</h5>
<p>      <a name="border"></a><br />
<h2>Border</h2>
<p>You can set the color, style and width of the borders around an element in one declaration by using the <span class="hilight">border</span> property.</p>
<p class="code">border: 1px solid #333333;</p>
<p>Values:</p>
<ul>
<li>color</li>
<li>style</li>
<li>width</li>
</ul>
<p>Or you can set each property individually</p>
<p>      <a name="border_color"></a><br />
<h2>Border Color</h2>
<p>You can set the color of a border independently with the <span class="hilight">border-color</span> property.</p>
<p class="code">border-color: value;</p>
<p>Values:</p>
<ul>
<li>color name</li>
<li>hexadecimal number</li>
<li>RGB color code</li>
<li>transparent</li>
</ul>
<p>      <a name="border_style"></a><br />
<h2>Border Style</h2>
<p>You can set the style of a border independently with the <span class="hilight">border-style</span> property.</p>
<p class="code">border-style: value;</p>
<p>Values:</p>
<ul>
<li>dashed</li>
<li>dotted</li>
<li>double</li>
<li>groove</li>
<li>hidden</li>
<li>inset</li>
<li>none</li>
<li>outset</li>
<li>ridge</li>
<li>solid</li>
</ul>
<p>      <a name="border_width"></a><br />
<h2>Border Width</h2>
<p>You can set the width of a border independently with the <span class="hilight">border-width</span> property.</p>
<p class="code">border-width: value;</p>
<p>Values:</p>
<ul>
<li>Length</li>
<li>Thin</li>
<li>Medium</li>
<li>Thick</li>
</ul>
<p>Or you can set the elements for each borders side individually</p>
<p>      <a name="border_bottom"></a><br />
<h2>Border Bottom</h2>
<p>You can set the color, style and width of the bottom border around an element in one declaration with the <span class="hilight">border-bottom</span> property.</p>
<p class="code">border-bottom: 1px solid #333333;</p>
<p>Values:</p>
<ul>
<li>color</li>
<li>style</li>
<li>width</li>
</ul>
<p>Or you can set each value individually</p>
<h5>Border Bottom Color</h5>
<p>You can set the color of the bottom border around an element with the <span class="hilight">border-bottom-color</span> property.</p>
<p class="code">border-bottom-color: value;</p>
<h5>Border Bottom Style</h5>
<p>You can set the style of the bottom border around an element with the <span class="hilight">border-bottom-style</span> property.</p>
<p class="code">border-bottom-style: value;</p>
<h5>Border Bottom Width</h5>
<p>You can set the width of the bottom border around an element with the <span class="hilight">border-bottom-width</span> property.</p>
<p class="code">border-bottom-width: value;</p>
<p>      <a name="border_left"></a><br />
<h2>Border Left</h2>
<p>You can set the color, style and width of the left border around an element with the <span class="hilight">border-left</span> property.</p>
<p class="code">border-left: 1px solid #333333;</p>
<p>Values:</p>
<ul>
<li>color</li>
<li>style</li>
<li>width</li>
</ul>
<p>Or you can set each value individually</p>
<h5>Border Left Color</h5>
<p>You can set the color of the left border around an element with the <span class="hilight">border-left-color</span> property.</p>
<p class="code">border-left-color: value;</p>
<h5>Border Left Style</h5>
<p>You can set the style of the left border around an element with the <span class="hilight">border-left-style</span> property.</p>
<p class="code">border-left-style: value;</p>
<h5>Border Left Width</h5>
<p>You can set the width of the left border around an element with the <span class="hilight">border-left-width</span> property.</p>
<p class="code">border-left-width: value;</p>
<p>      <a name="border_right"></a><br />
<h2>Border Right</h2>
<p>You can set the color, style and width of the right border around an element in one declaration with the <span class="hilight">border-right</span> property.</p>
<p class="code">border-right: 1px solid #333333;</p>
<p>Values:</p>
<ul>
<li>color</li>
<li>style</li>
<li>width</li>
</ul>
<p>Or you can set each value individually</p>
<h5>Border Right Color</h5>
<p>You can set the color of the right border around an element with the <span class="hilight">border-right-color</span> property.</p>
<p class="code">border-right-color: value;</p>
<h5>Border Right Style</h5>
<p>You can set the style of the right border around an element with the <span class="hilight">border-right-style</span> property.</p>
<p class="code">border-right-style: value;</p>
<h5>Border Right Width</h5>
<p>You can set the width of the right border around an element with the <span class="hilight">border-right-width</span> property.</p>
<p class="code">border-right-width: value;</p>
<p>      <a name="border_top"></a><br />
<h2>Border Top</h2>
<p>You can set the color, style and width of the top border around an element in one declaration with the <span class="hilight">border-top</span> property.</p>
<p class="code">border-top: 1px solid #333333;</p>
<p>Values:</p>
<ul>
<li>color</li>
<li>style</li>
<li>width</li>
</ul>
<p>Or you can set each value individually</p>
<h5>Border Top Color</h5>
<p>You can set the color of the top border around an element with the <span class="hilight">border-top-color</span> property.</p>
<p class="code">border-top-color: value;</p>
<h5>Border Top Style</h5>
<p>You can set the style of the top border around an element with the <span class="hilight">border-top-style</span> property.</p>
<p class="code">border-top-style: value;</p>
<h5>Border Top Width</h5>
<p>You can set the width of the top border around an element with the <span class="hilight">border-top-width</span> property.</p>
<p class="code">border-top-width: value;</p>
<h1>Chapter 14 &#8211; CSS Ordered &amp; Unordered Lists</h1>
<h5>Inherited: Yes</h5>
<p>      <a name="list_style"></a><br />
<h2>List Style</h2>
<p>You can control the appearance of ordered and unordered lists in one declaration with the <span class="hilight">list-style</span> property</p>
<p class="code">list-style: value value;</p>
<p>Values:</p>
<ul>
<li>image</li>
<li>position</li>
<li>type</li>
</ul>
<p>Or you can control them individually</p>
<p>      <a name="list_style_image"></a><br />
<h2>List Style Image</h2>
<p>You can use an image for the bullet of unordered lists with the <span class="hilight">list-style</span> property</p>
<p class="code">list-style-image: url(path_to_image.gif, jpg or png);</p>
<p>If you use an image, it is a good idea to declare the <span class="hilight">list-style-type</span> also in case the user has images turned off.</p>
<p>      <a name="list_style_position"></a><br />
<h2>List Style Position</h2>
<p>You can control the position of ordered and unordered lists with the <span class="hilight">list-style-position</span> property</p>
<p class="code">list-style-position: value;</p>
<p>Values</p>
<ul>
<li>inside</li>
<li>outside</li>
</ul>
<p>      <a name="list_style_type"></a><br />
<h2>List Style Type</h2>
<p>You can control the type of bullet ordered and unordered lists use with the <span class="hilight">list-style-type</span> property</p>
<p class="code">list-style-type: value;</p>
<p>Values</p>
<ul>
<li>disc</li>
<li>circle</li>
<li>square</li>
<li>decimal</li>
<li>lower-roman</li>
<li>upper-roman</li>
<li>lower-alpha</li>
<li>upper-alpha</li>
<li>none</li>
</ul>
<h1>Chapter 15 &#8211; CSS Width and Height Properties</h1>
<h5>Inherited: No</h5>
<p>      <a name="height"></a><br />
<h2>Height</h2>
<p>You can control the height of an element with the <span class="hilight">height</span> property</p>
<p class="code">height: value;</p>
<p>Values:</p>
<ul>
<li>auto</li>
<li>length</li>
<li>percentage</li>
</ul>
<p>      <a name="line_height"></a><br />
<h2>Line Height</h2>
<p>You can control the height between lines with the <span class="hilight">line-height</span> property</p>
<p class="code">line-height: value;</p>
<p>Values:</p>
<ul>
<li>normal</li>
<li>number</li>
<li>length</li>
<li>percentage</li>
</ul>
<p>      <a name="max_height"></a><br />
<h2>Max Height</h2>
<p>You can control the maximum height of an element with the <span class="hilight">max-height</span> property</p>
<p class="code">max-height: value;</p>
<p>Values:</p>
<ul>
<li>none</li>
<li>length</li>
<li>percentage</li>
</ul>
<p>      <a name="min_height"></a><br />
<h2>Min Height</h2>
<p>You can control the minimum height of an element with the <span class="hilight">min-height</span> property</p>
<p class="code">min-height: value;</p>
<p>Values:</p>
<ul>
<li>length</li>
<li>percentage</li>
</ul>
<p>      <a name="width"></a><br />
<h2>Width</h2>
<p>You can control the width of an element with the <span class="hilight">width</span> property</p>
<p class="code">width: value;</p>
<p>Values:</p>
<ul>
<li>auto</li>
<li>length</li>
<li>percentage</li>
</ul>
<p>      <a name="max_width"></a><br />
<h2>Max Width</h2>
<p>You can control the maximum width of an element with the <span class="hilight">max-width</span> property</p>
<p class="code">max-width: value;</p>
<p>Values:</p>
<ul>
<li>none</li>
<li>length</li>
<li>percentage</li>
</ul>
<p>      <a name="min_width"></a><br />
<h2>Min Width</h2>
<p>You can control the minimum width of an element with the <span class="hilight">min-width</span> property</p>
<p class="code">min-width: value;</p>
<p>Values:</p>
<ul>
<li>length</li>
<li>percentage</li>
</ul>
<h1>Chapter 16 &#8211; CSS Classification</h1>
<h5>Inherited: No</h5>
<p>      <a name="clear"></a><br />
<h2>Clear</h2>
<p>You can control if an element allows floated elements to its sides with the <span class="hilight">clear</span> property</p>
<p class="code">clear: value;</p>
<p>Values:</p>
<ul>
<li>none</li>
<li>both</li>
<li>left</li>
<li>right</li>
</ul>
<p><strong>Now, what does all that mean?</strong></p>
<h5>None</h5>
<p>This is the default setting, floated elements can appear on either side of the element set to <span class="hilight">clear: none;</span></p>
<h5>Both</h5>
<p>Setting the value to both, causes no floated elements to appear on either side of the element set to <span class="hilight">clear: both;</span></p>
<h5>Left</h5>
<p>Setting the value to left, causes no floated elements to appear to the left side of the element set to <span class="hilight">clear: left;</span></p>
<h5>Right</h5>
<p>Setting the value to right, causes no floated elements to appear to the right side of the element set to <span class="hilight">clear: right;</span></p>
<p>      <a name="clip"></a><br />
<h2>Clip</h2>
<p>You can control how much of an element is visible with the <span class="hilight">clip</span> property</p>
<p class="code">clip: value;</p>
<p>Values:</p>
<ul>
<li>auto</li>
<li>shape</li>
</ul>
<p>Currently the only shape recognized by the clip property is <span class="hilight">rect</span> (rectangle)</p>
<p class="code">clip: rect(10px, 10px, 10px, 10px);</p>
<p>      <a name="cursor"></a><br />
<h2>Cursor</h2>
<p>You can control the style of cursor to be used in an element with the <span class="hilight">cursor</span> property</p>
<p class="code">cursor: value;</p>
<p>Values:</p>
<ul>
<li>auto</li>
<li>crosshair</li>
<li>default</li>
<li>help</li>
<li>move</li>
<li>pointer</li>
<li>text</li>
<li>url</li>
<li>wait</li>
<li>e-resize</li>
<li>ne-resize</li>
<li>nw-resize</li>
<li>n-resize</li>
<li>se-resize</li>
<li>sw-resize</li>
<li>s-resize</li>
<li>w-resize</li>
</ul>
<p>If you choose to use a custom cursor, it is always a good idea to declare a generic one after the custom value.</p>
<p class="code">cursor: url(&#8220;image.cur&#8221;), default;</p>
<p>      <a name="display"></a><br />
<h2>Display</h2>
<p>You can control how an element is displayed with the <span class="hilight">display</span> property</p>
<p class="code">display: value;</p>
<p>Values:</p>
<ul>
<li>block</li>
<li>inline</li>
<li>list-item</li>
<li>none</li>
</ul>
<p><strong>Now, what does all that mean?</strong></p>
<h5>Block</h5>
<p>Creates a line break before and after the element</p>
<h5>Inline</h5>
<p>No line break is created</p>
<h5>List Item</h5>
<p>Creates a line break before and after the element and adds a list item marker</p>
<h5>None</h5>
<p>Makes an element not display on the page</p>
<p>      <a name="float"></a><br />
<h2>Float</h2>
<p>The float property changes how text and or images within an element are displayed</p>
<p class="code">float: value;</p>
<p>Values:</p>
<ul>
<li>left</li>
<li>right</li>
<li>none</li>
</ul>
<p><strong>Now, what does all that mean?</strong></p>
<h5>Left</h5>
<p>The image/text is displayed to the left of the parent element</p>
<h5>Right</h5>
<p>The image/text is displayed to the right of the parent element</p>
<h5>None</h5>
<p>There is no change in the way the image/text is displayed</p>
<p>      <a name="overflow"></a><br />
<h2>Overflow</h2>
<p>You can control what an elements contents will do if it overflows it boundaries with the <span class="hilight">overflow</span> property</p>
<p class="code">overflow: value;</p>
<p>Values:</p>
<ul>
<li>auto</li>
<li>hidden</li>
<li>visible</li>
<li>scroll</li>
</ul>
<div id="overflow_box">
      <strong>Overflow Example</strong></p>
<p>As you can see, with this property you can mimic an iframe. This box is set to an overflow value of &#8220;auto&#8221;. Meaning that if the contents of the element break the boundaries it should add a scrollbar.</p>
<p>If it we&#8217;re set to an overflow value of &#8220;scroll&#8221;, horizontal and vertical scrollbars would appear no matter what.</p>
<p>If it we&#8217;re set to an overflow value of &#8220;hidden&#8221;, the contents would be clipped at the boundary and no scrollbar would appear.</p>
<p>If it we&#8217;re set to an overflow value of &#8220;visible&#8221;, the contents would expand past the boundaries and no scrollbar would appear.</p>
<p></p></div>
<p>Here is what I have in my CSS file.</p>
<p class="code">#overflow_box {width:200px; height:200px; border-top: 1px solid #eee; border-left: 1px solid #eee; border-bottom: 1px solid #eee; padding: 10px; overflow: auto;}</p>
<p>Then in the (X)HTML file I have this:</p>
<p class="code">&lt;div id=&#8221;overflow_box&#8221;&gt;Contents&lt;/div&gt;</p>
<p>      <a name="vivibility"></a><br />
<h2>Visibility</h2>
<p>You can control if an element is visible or not with the <span class="hilight">visibility</span> property</p>
<p class="code">visibility: value;</p>
<p>Values:</p>
<ul>
<li>hidden</li>
<li>visible</li>
</ul>
<p>      <a name="z_index"></a><br />
<h2>Z-Index</h2>
<p>You can control the layer order of positioned elements with the <span class="hilight">z-index</span> property</p>
<p class="code">z-index: value;</p>
<p>Values:</p>
<ul>
<li>auto</li>
<li>number</li>
</ul>
<p>The higher the number the higher the level. Negative numbers are allowed</p>
<h1>Chapter 17 &#8211; CSS Positioning</h1>
<h5>Inherited: No</h5>
<h2>Position</h2>
<p>The position property (as you may have guessed) changes how elements are positioned on your webpage.</p>
<p class="code">position: value;</p>
<p>Values:</p>
<ul>
<li>static</li>
<li>relative</li>
<li>absolute</li>
<li>fixed</li>
</ul>
<p><strong>Now, what does all that mean?</strong></p>
<h5>Static</h5>
<p>Static positioning is by default the way an element will appear in the normal flow of your (X)HTML file. It is not necessary to declare a position of static. Doing so, is no different than not declaring it at all.</p>
<p class="code">position: static;</p>
<h5>Relative</h5>
<p>Positioning an element relatively places the element in the normal flow of your (X)HTML file and then offsets it by some amount using the properties left, right, top and bottom. This may cause the element to overlap other elements that are on the page, which of course may be the effect that is required.</p>
<p class="code">position: relative;</p>
<h5>Absolute</h5>
<p>Positioning an element absolutely, removes the element from the normal flow of your (X)HTML file, and positions it to the top left of it&#8217;s nearest parent element that has a position declared other than static. If no parent element with a position other than static exists then it will be positioned from the top left of the browser window.</p>
<p class="code">position: absolute;</p>
<h5>Fixed</h5>
<p>Positioning an element with the fixed value, is the same as absolute except the parent element is always the browser window. It makes no difference if the fixed element is nested inside other positioned elements.</p>
<p>Furthermore, an element that is positioned with a fixed value, will not scroll with the document. It will remain in it&#8217;s position regardless of the scroll position of the page.</p>
<p>At this time IE6 (Internet Explorer 6) does not support the fixed value for the positioning of an element. Thus it will not position fixed elements correctly and will still scroll with the page. To see this effect in action you will need to use a standards compliant browser, such as <a href="http://spreadfirefox.com/" title="Get a real browser">Firefox 1.0</a></p>
<p class="code">position: fixed;</p>
<p>When positioning elements with relative, absolute or fixed values the following properties are used to offset the element:</p>
<ul>
<li>top</li>
<li>left</li>
<li>right</li>
<li>bottom</li>
</ul>
<p class="code">position: absolute; top: 10px; right: 10px;</p>
<h1>Chapter 18 &#8211; CSS Pseudo Elements</h1>
<h2>The Syntax</h2>
<p>The syntax for pseudo elements is a bit different than that of regular CSS, but it&#8217;s real close. If you have already read <a href="chapter_11_css_anchors_links_pseudo_classes.html" title="Chapter 11 - CSS Anchors, links and pseudo classes">chapter 11</a> then you are slightly ahead of the game.</p>
<p class="code">selector:<span class="paths">pseudo-element</span> {property: value}</p>
<p>As you can see the only difference is that you place the pseudo element after the selector, and divide the 2 with a (:) colon.</p>
<p>Or you can assign a class to a pseudo element as follows</p>
<p class="code">selector.<span class="paths">p</span>:pseudo-element {property: value}</p>
<p>Using the above code would style all paragraphs within the declared selector with the pseudo element.</p>
<h2>The elements:</h2>
<ul>
<li>first-line</li>
<li>first-letter</li>
</ul>
<h2>First Line</h2>
<p>The first-line pseudo element styles the first line of text in a block level element.</p>
<p class="code">p{font-size: small;}<br />p:<span class="paths">first-line</span> {font-size: medium; color: #ff0000;}</p>
<p>As you can see in the above example paragraphs are set to be a small font size, but the p:first-line is set to be a medium size and a red color. The result is that the first line of all paragraphs will be red in color and a bit larger than the rest of the paragraph.</p>
<p>Though lets say you only want to style a certain paragraph of text with the first-line element. Thats where declaring a class to the pseudo element comes into play.</p>
<h5>first-line with class</h5>
<p class="code">p<span class="paths">.special</span>:first-line {font-size: medium; color: #ff0000;}</p>
<p>I have declared a class of special within my css file.</p>
<p>      <strong>First-Line Example</strong></p>
<p class="special">This is a special sentence I wrote to demonstrate the use and look of the first-line pseudo element. As you can see the first line of this paragraph is styled differently than the rest of the text within it. All of this was done by simply adding class=&#8221;special&#8221; to the opening &lt;p&gt; tag for this paragraph.</p>
<p class="code">&lt;p <span class="paths">class=&#8221;special&#8221;&gt;</span>the content&lt;/p&gt;</p>
<p>Where the first-line ends depends on the width of the browser window or containing element, you can resize this page and see that it adjusts as you change the size of the browser window.</p>
<p>The following properties can be assigned to the first-line pseudo element:</p>
<ul>
<li>background</li>
<li>clear</li>
<li>color</li>
<li>font</li>
<li>letter-spacing</li>
<li>line-height</li>
<li>text-decoration</li>
<li>text-transform</li>
<li>vertical-align</li>
<li>word-spacing</li>
</ul>
<h2>First Letter</h2>
<p>The first-letter pseudo element styles the first letter of text in a block level element.</p>
<p class="code">p{font-size: small;}<br />p:<span class="paths">first-letter</span> {font-size: medium; color: #ff0000;}</p>
<p>As you can see in the above example paragraphs are set to be a small font size, but the p:first-letter is set to be a medium size and a red color. The result is that the first letter of all paragraphs will be red in color and a bit larger than the rest of the paragraph.</p>
<p>Though lets say you only want to style a certain paragraph of text with the first-letter element. Thats where declaring a class to the pseudo element comes into play.</p>
<h5>first-letter with class</h5>
<p class="code">p<span class="paths">.special_letter</span>:first-letter {font-size: x-large; font-weight: bold; color: #ff0000;}</p>
<p>I have declared a class of special_letter within my css file.</p>
<p>      <strong>First-Letter Example</strong></p>
<p class="special_letter">This is a special sentence I wrote to demonstrate the use and look of the first-letter pseudo element. As you can see the first letter of this paragraph is styled differently than the rest of the characters within it. All of this was done by simply adding class=&#8221;special_letter&#8221; to the opening &lt;p&gt; tag for this paragraph.</p>
<p class="code">&lt;p <span class="paths">class=&#8221;special_letter&#8221;&gt;</span>the content&lt;/p&gt;</p>
<p>The following properties can be assigned to the first-letter pseudo element:</p>
<ul>
<li>background</li>
<li>border</li>
<li>clear</li>
<li>color</li>
<li>float</li>
<li>font</li>
<li>line-height</li>
<li>margin</li>
<li>padding</li>
<li>text-decoration</li>
<li>text-transform</li>
<li>word-spacing</li>
</ul>
<p>So once you have mastered all the tricks behind CSS you are ready to build your own website using this code. If you haven&#8217;t got a site just yet then you can start off by registering a domain name and getting <a href="http://www.webhostingsearch.com/">web hosting</a>. One possible place to find a good host could be for example <a href="http://www.webhostingsearch.com/">WHS</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/print-all-chapters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Contact Us</title>
		<link>http://www.cssbasics.com/contact-us/</link>
		<comments>http://www.cssbasics.com/contact-us/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 19:08:47 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?page_id=64</guid>
		<description><![CDATA[Please fill out this form to contact us Your Name(required) Email(valid email required) Website Message &#160; cforms contact form by delicious:days]]></description>
				<content:encoded><![CDATA[
		<div id="usermessagea" class="cf_info "></div>
		<form enctype="multipart/form-data" action="/feed/#usermessagea" method="post" class="cform" id="cformsform">
		<fieldset class="cf-fs1">
		<legend>Please fill out this form to contact us</legend>
		<ol class="cf-ol">
			<li id="li--2"><label for="cf_field_2"><span>Your Name</span></label><input type="text" name="cf_field_2" id="cf_field_2" class="single fldrequired" value="Your Name" onfocus="clearField(this)" onblur="setField(this)"/><span class="reqtxt">(required)</span></li>
			<li id="li--3"><label for="cf_field_3"><span>Email</span></label><input type="text" name="cf_field_3" id="cf_field_3" class="single fldemail fldrequired" value=""/><span class="emailreqtxt">(valid email required)</span></li>
			<li id="li--4"><label for="cf_field_4"><span>Website</span></label><input type="text" name="cf_field_4" id="cf_field_4" class="single" value="http://"/></li>
			<li id="li--5"><label for="cf_field_5"><span>Message</span></label><textarea cols="30" rows="8" name="cf_field_5" id="cf_field_5" class="area"></textarea></li>
		</ol>
		</fieldset>
		<fieldset class="cf_hidden">
			<legend>&nbsp;</legend>
			<input type="hidden" name="cf_working" id="cf_working" value="One%20moment%20please..."/>
			<input type="hidden" name="cf_failure" id="cf_failure" value="Please%20fill%20in%20all%20the%20required%20fields."/>
			<input type="hidden" name="cf_codeerr" id="cf_codeerr" value="Please%20double-check%20your%20verification%20code."/>
			<input type="hidden" name="cf_customerr" id="cf_customerr" value="yyy"/>
			<input type="hidden" name="cf_popup" id="cf_popup" value="nn"/>
		</fieldset>
		<p class="cf-sb"><input type="submit" name="sendbutton" id="sendbutton" class="sendbutton" value="Submit" onclick="return cforms_validate('', false)"/></p>
		</form>
		<p class="linklove" id="ll"><a href="http://www.deliciousdays.com/cforms-plugin"><em>cforms</em> contact form by delicious:days</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/contact-us/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download all chapters</title>
		<link>http://www.cssbasics.com/download-all-chapters/</link>
		<comments>http://www.cssbasics.com/download-all-chapters/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 18:30:02 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?page_id=62</guid>
		<description><![CDATA[All 18 chapters of CSS Basics in one downloadable, printable PDF file: Download CSS Basics PDF* So once you have mastered all the tricks behind CSS you are ready to build your own website using this code. If you haven&#8217;t got a site just yet then you can start off by registering a domain name [...]]]></description>
				<content:encoded><![CDATA[<p>All 18 chapters of CSS Basics in one downloadable, printable PDF file:</p>
<p><a href="http://www.cssbasics.com/full.pdf">Download CSS Basics PDF*</a></p>
<p>So once you have mastered all the tricks behind CSS you are ready to build your own website using this code. If you haven&#8217;t got a site just yet then you can start off by registering a domain name and getting <a href="http://www.webhostingsearch.com/">web hosting</a>. One possible place to find a good host could be for example <a href="http://www.webhostingsearch.com/">WHS</a>.</p>
<p><em>*The file is in PDF format, and you will need <a href="http://get.adobe.com/reader/">Adobe Reader</a> or a similar application (such as Mac OS X&#8217;s Preview) to open it.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/download-all-chapters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome to CSS Basics</title>
		<link>http://www.cssbasics.com/</link>
		<comments>http://www.cssbasics.com/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 17:03:32 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?page_id=59</guid>
		<description><![CDATA[You&#8217;ve heard the buzz about the seperation of style from content, but you are stuck in the world of nested tables and deprecated markup. If so, you have come to the right place! Using CSS to style your (X)HTML files, will benefit you and your visitors in many ways. The following chapters cover all the [...]]]></description>
				<content:encoded><![CDATA[<p>You&#8217;ve heard the buzz about the seperation of style from content, but you are stuck in the world of nested tables and deprecated markup. If so, you have come to the right place! Using CSS to style your (X)HTML files, will benefit you and your visitors in many ways.</p>
<p>The following chapters cover all the basics of CSS design. If you need a host, we recommend you try out <a href="http://www.uswebhosting.com/" target="_blank">US WebHosting</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/welcome-to-css-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chapter 18 : CSS Pseudo Elements</title>
		<link>http://www.cssbasics.com/css-pseudo-elements/</link>
		<comments>http://www.cssbasics.com/css-pseudo-elements/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 18:00:51 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?page_id=56</guid>
		<description><![CDATA[The Syntax The syntax for pseudo elements is a bit different than that of regular CSS, but it&#8217;s real close. If you have already read chapter 11 then you are slightly ahead of the game. selector:pseudo-element {property: value} As you can see the only difference is that you place the pseudo element after the selector, [...]]]></description>
				<content:encoded><![CDATA[<h2>The Syntax</h2>
<p>The syntax for pseudo elements is a bit different than that of regular CSS, but it&#8217;s real close. If you have already read <a href="chapter_11_css_anchors_links_pseudo_classes.html" title="Chapter 11 - CSS Anchors, links and pseudo classes">chapter 11</a> then you are slightly ahead of the game.</p>
<p class="code">selector:<span class="paths">pseudo-element</span> {property: value}</p>
<p>As you can see the only difference is that you place the pseudo element after the selector, and divide the 2 with a (:) colon.</p>
<p>Or you can assign a class to a pseudo element as follows</p>
<p class="code">selector.<span class="paths">p</span>:pseudo-element {property: value}</p>
<p>Using the above code would style all paragraphs within the declared selector with the pseudo element.</p>
<h2>The elements:</h2>
<ul>
<li>first-line</li>
<li>first-letter</li>
</ul>
<h2>First Line</h2>
<p>The first-line pseudo element styles the first line of text in a block level element.</p>
<p class="code">p{font-size: small;}<br />p:<span class="paths">first-line</span> {font-size: medium; color: #ff0000;}</p>
<p>As you can see in the above example paragraphs are set to be a small font size, but the p:first-line is set to be a medium size and a red color. The result is that the first line of all paragraphs will be red in color and a bit larger than the rest of the paragraph.</p>
<p>Though lets say you only want to style a certain paragraph of text with the first-line element. Thats where declaring a class to the pseudo element comes into play.</p>
<h5>first-line with class</h5>
<p class="code">p<span class="paths">.special</span>:first-line {font-size: medium; color: #ff0000;}</p>
<p>I have declared a class of special within my css file.</p>
<p>      <strong>First-Line Example</strong></p>
<p class="special">This is a special sentence I wrote to demonstrate the use and look of the first-line pseudo element. As you can see the first line of this paragraph is styled differently than the rest of the text within it. All of this was done by simply adding class=&#8221;special&#8221; to the opening &lt;p&gt; tag for this paragraph.</p>
<p class="code">&lt;p <span class="paths">class=&#8221;special&#8221;&gt;</span>the content&lt;/p&gt;</p>
<p>Where the first-line ends depends on the width of the browser window or containing element, you can resize this page and see that it adjusts as you change the size of the browser window.</p>
<p>The following properties can be assigned to the first-line pseudo element:</p>
<ul>
<li>background</li>
<li>clear</li>
<li>color</li>
<li>font</li>
<li>letter-spacing</li>
<li>line-height</li>
<li>text-decoration</li>
<li>text-transform</li>
<li>vertical-align</li>
<li>word-spacing</li>
</ul>
<h2>First Letter</h2>
<p>The first-letter pseudo element styles the first letter of text in a block level element.</p>
<p class="code">p{font-size: small;}<br />p:<span class="paths">first-letter</span> {font-size: medium; color: #ff0000;}</p>
<p>As you can see in the above example paragraphs are set to be a small font size, but the p:first-letter is set to be a medium size and a red color. The result is that the first letter of all paragraphs will be red in color and a bit larger than the rest of the paragraph.</p>
<p>Though lets say you only want to style a certain paragraph of text with the first-letter element. Thats where declaring a class to the pseudo element comes into play.</p>
<h5>first-letter with class</h5>
<p class="code">p<span class="paths">.special_letter</span>:first-letter {font-size: x-large; font-weight: bold; color: #ff0000;}</p>
<p>I have declared a class of special_letter within my css file.</p>
<p>      <strong>First-Letter Example</strong></p>
<p class="special_letter">This is a special sentence I wrote to demonstrate the use and look of the first-letter pseudo element. As you can see the first letter of this paragraph is styled differently than the rest of the characters within it. All of this was done by simply adding class=&#8221;special_letter&#8221; to the opening &lt;p&gt; tag for this paragraph.</p>
<p class="code">&lt;p <span class="paths">class=&#8221;special_letter&#8221;&gt;</span>the content&lt;/p&gt;</p>
<p>The following properties can be assigned to the first-letter pseudo element:</p>
<ul>
<li>background</li>
<li>border</li>
<li>clear</li>
<li>color</li>
<li>float</li>
<li>font</li>
<li>line-height</li>
<li>margin</li>
<li>padding</li>
<li>text-decoration</li>
<li>text-transform</li>
<li>word-spacing</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/css-pseudo-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chapter 17 : CSS Positioning</title>
		<link>http://www.cssbasics.com/css-positioning/</link>
		<comments>http://www.cssbasics.com/css-positioning/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 18:00:02 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.cssbasics.com/?page_id=53</guid>
		<description><![CDATA[Inherited: No Position The position property (as you may have guessed) changes how elements are positioned on your webpage. position: value; Values: static relative absolute fixed Now, what does all that mean? Static Static positioning is by default the way an element will appear in the normal flow of your (X)HTML file. It is not [...]]]></description>
				<content:encoded><![CDATA[<h5>Inherited: No</h5>
<h2>Position</h2>
<p>The position property (as you may have guessed) changes how elements are positioned on your webpage.</p>
<p class="code">position: value;</p>
<p>Values:</p>
<ul>
<li>static</li>
<li>relative</li>
<li>absolute</li>
<li>fixed</li>
</ul>
<p><strong>Now, what does all that mean?</strong></p>
<h5>Static</h5>
<p>Static positioning is by default the way an element will appear in the normal flow of your (X)HTML file. It is not necessary to declare a position of static. Doing so, is no different than not declaring it at all.</p>
<p class="code">position: static;</p>
<h5>Relative</h5>
<p>Positioning an element relatively places the element in the normal flow of your (X)HTML file and then offsets it by some amount using the properties left, right, top and bottom. This may cause the element to overlap other elements that are on the page, which of course may be the effect that is required.</p>
<p class="code">position: relative;</p>
<h5>Absolute</h5>
<p>Positioning an element absolutely, removes the element from the normal flow of your (X)HTML file, and positions it to the top left of its nearest parent element that has a position declared other than static. If no parent element with a position other than static exists then it will be positioned from the top left of the browser window.</p>
<p class="code">position: absolute;</p>
<h5>Fixed</h5>
<p>Positioning an element with the fixed value, is the same as absolute except the parent element is always the browser window. It makes no difference if the fixed element is nested inside other positioned elements.</p>
<p>Furthermore, an element that is positioned with a fixed value, will not scroll with the document. It will remain in its position regardless of the scroll position of the page.</p>
<p>At this time IE6 (Internet Explorer 6) does not support the fixed value for the positioning of an element. Thus it will not position fixed elements correctly and will still scroll with the page. To see this effect in action you will need to use a standards compliant browser, such as <a href="http://spreadfirefox.com/" title="Get a real browser">Firefox 1.0</a></p>
<p class="code">position: fixed;</p>
<p>When positioning elements with relative, absolute or fixed values the following properties are used to offset the element:</p>
<ul>
<li>top</li>
<li>left</li>
<li>right</li>
<li>bottom</li>
</ul>
<p class="code">position: absolute; top: 10px; right: 10px;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cssbasics.com/css-positioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
