<?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>Poiesis Web Development &#187; CSS</title>
	<atom:link href="http://www.poiesis.co.za/index.php/category/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.poiesis.co.za</link>
	<description>Becasue IT matters</description>
	<lastBuildDate>Mon, 14 Jun 2010 12:33:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Stylesheets</title>
		<link>http://www.poiesis.co.za/index.php/2009/05/css-stylesheets/</link>
		<comments>http://www.poiesis.co.za/index.php/2009/05/css-stylesheets/#comments</comments>
		<pubDate>Wed, 27 May 2009 23:19:23 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[browser support]]></category>
		<category><![CDATA[FireFox]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.poiesis.co.za/?p=49</guid>
		<description><![CDATA[A cascading style sheet or CSS allows you to separate the presentation and content of your web sites, with your content contained in your (X)HTML files and your presentation defined in a CSS. The CSS can be an internal stylesheet defined in the head element of your html file, an external file referenced in the [...]]]></description>
			<content:encoded><![CDATA[<p>A cascading style sheet or CSS allows you to separate the presentation and content of your web sites, with your content contained in your (X)HTML files and your presentation defined in a CSS. The CSS can be an internal stylesheet defined in the <code>head</code> element of your html file, an external file referenced in the <code>head</code> element, or an inline style defined in an html element.</p>
<h3>The Internal Stylesheet</h3>
<p>If you use a CSS style in the <code>header</code> element you need to enclose it in a <code>style</code> element, as in:</p>
<p><code>&lt;head&gt;</code><br />
<code>&lt;title&gt;<em>Your Page Title</em>&lt;title&gt;</code><br />
<code>&lt;style type="text/css"&gt;</code><br />
<code style="margin-left:10px;"><em>CSS Content</em></code><br />
<code>&lt;/style&gt;</code><br />
<code>&lt;/head&gt;</code></p>
<p><span id="more-49"></span>The CSS styles defined in the <code>head</code> element will be applied only to that page, which means you need to define CSS styles for each page, and you need to update each page when you change your design.</p>
<h3>The External Stylesheet</h3>
<p>An external CSS stylesheet exists in a separate <em>.css</em> file and is referenced by a <code>link</code> in the <code>header</code> element, as in:</p>
<p><code>&lt;head&gt;</code><br />
<code>&lt;title&gt;Your Page Title&lt;title&gt;</code><br />
<code>&lt;link rel="stylesheet" type="text/css" href="<em>path to stylesheet.css</em>" &gt;</code><br />
<code>&lt;/head&gt;</code></p>
<p>or it can be imported into the page in the <code>header</code> element, as in:</p>
<p><code>&lt;head&gt;</code><br />
<code>&lt;title&gt;Your Page Title&lt;title&gt;</code><br />
<code>&lt;style type="text/css"&gt;@import url(<em>path to stylesheet.css</em>)&lt;/style&gt;</code><br />
<code>&lt;/head&gt;</code></p>
<p>The external CSS stylesheet can also reference other external stylesheets by simply using <code>@import "<em>path to stylesheet.css</em>"</code>. The styles from the imported stylesheet will be inserted where the <code>@import "<em>path to stylesheet.css</em>"</code> line is located. This is important to remember as subsequent styles that use the same <strong>selector</strong> name or the same <strong>class</strong> name will override previously declared styles.</p>
<p>The major advantage of having an external .<em>css</em> stylesheet lies in the fact that you only need to make changes to the external CSS stylesheet when you change your web site design and those changes will be implemented on all pages that reference the external stylesheet. This improves web site maintenance and flexibility, while reducing <code>html</code> file size and reducing bandwith usage.</p>
<h3>Inline Styles</h3>
<p>Finally, inline styles are placed directly in the element that you want to style using the CSS syntax <code><em>property</em></code>: <code><em>value</em></code>. For example, <code>&lt;div style="background-color: red;"&lt; will give the div a red background color. This defeats the purpose of CSS and makes the maintenance of a web site more complicated.</p>
<h3>Cascading Stylesheets</h3>
<p>It is possible to use all three type of CSS stylesheets on one page, and you can reference more than one stylesheet in your <code>head</code> element. In this event the various CSS styles and stylesheets will cascade into one, with the styles in CSS stylesheet that is loaded last overriding the styles is CSS stylesheet that were loaded first. As the content of an <code>html</code> file, and the content of a .<em>css</em> file, is read and loaded sequentially from top to bottom, inline styles will override CSS stylesheets defined or linked in the <code>head</code> element; and if the reference to the external CSS stylesheet in the <code>head</code> element is placed below the internal stylesheet, the external stylesheet will override the internal style sheet. But this only applies to duplicate styles.</p>
<h3>Browser Support</h3>
<p>One major disadvantage of using CSS stylesheets is the varying support that the different browsers offer. Currently, the major browsers are Internet Explorer 6, Internet Explorer 7, Internet Explorer 8, Mozilla Firefox 2, Mozilla Firefox 3, Safari, Google Chrome, Opera 9.6 and Opera 10. Testing your web site design and layout against all these browsers can become tedious! More on browser quirks later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.poiesis.co.za/index.php/2009/05/css-stylesheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Background Properties</title>
		<link>http://www.poiesis.co.za/index.php/2009/05/css-background-properties/</link>
		<comments>http://www.poiesis.co.za/index.php/2009/05/css-background-properties/#comments</comments>
		<pubDate>Tue, 26 May 2009 19:53:44 +0000</pubDate>
		<dc:creator>Brent</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[background-attachment]]></category>
		<category><![CDATA[background-color]]></category>
		<category><![CDATA[background-image]]></category>
		<category><![CDATA[background-position]]></category>
		<category><![CDATA[background-repeat]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.poiesis.co.za/?p=31</guid>
		<description><![CDATA[Now that our first WordPress Theme is done, we can start discussing designing your own site. When designing your site, the first thing you need to consider your layout and your background. With CSS these can be two separate things with your background being your page and your layout being your divs that you place [...]]]></description>
			<content:encoded><![CDATA[<p>Now that <a href="http://www.poiesis.co.za/index.php/2009/05/simply-smart/">our first WordPress Theme</a> is done, we can start discussing designing your own site. When designing your site, the first thing you need to consider your layout and your background. With <strong>CSS</strong> these can be two separate things with your background being your page and your layout being your <code>div</code>s that you place and position over the page. Background properties can also be applied to your divs, but then they will be restricted to the divs that contain them. In this tutorial we&#8217;ll look at the background properties that can go in the <code>body</code> element of your <em>stylesheet.css</em> file.</p>
<h3>Backgrounds Colors</h3>
<p><span id="more-31"></span>The most common item in the <code>body</code> element is the background, which can be a solid color, an image, or both. Let&#8217;s look a common <code>background</code> property, namely <code>background-color</code>. This sets the color for the entire page and can be either one of 17 standard color names or the <strong>RGB value</strong> of the color in hexadecimal notation.</p>
<p>The 17 standard color names are:</p>
<div style="margin-left:9px;float:left;background-color:transparent;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">transparent</div>
<div style="margin-left:9px;float:left;background-color:aqua;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">aqua</div>
<div style="margin-left:9px;float:left;background-color:black;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">black</div>
<div style="margin-left:9px;float:left;background-color:blue;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">blue</div>
<div style="margin-left:9px;float:left;background-color:fuchsia;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">fuchsia</div>
<div style="margin-left:9px;float:left;background-color:gray;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">gray</div>
<div style="margin-left:9px;float:left;background-color:green;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">green</div>
<div style="margin-left:9px;float:left;background-color:lime;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">lime</div>
<div style="margin-left:9px;float:left;background-color:maroon;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">maroon</div>
<div style="margin-left:9px;float:left;background-color:navy;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">navy</div>
<div style="margin-left:9px;float:left;background-color:olive;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">olive</div>
<div style="margin-left:9px;float:left;background-color:purple;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">purple</div>
<div style="margin-left:9px;float:left;background-color:red;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">red</div>
<div style="margin-left:9px;float:left;background-color:silver;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">silver</div>
<div style="margin-left:9px;float:left;background-color:teal;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">teal</div>
<div style="margin-left:9px;float:left;background-color:white;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">white</div>
<div style="margin-left:9px;float:left;background-color:yellow;height:10px;width:10px;border:solid 1px #ccc;"></div>
<div style="margin-top:-3px;margin-left:30px;">yellow</div>
<p>These colors can be used as in <code> background-color: red;</code> to set the page color to red, or <code> background-color: blue;</code> to set the color to blue. The default color is set to transparent and will show whatever is below the current element, in this case it will show the background color of the browser, which is white by default, but can be set to another color by the user. Therefore, you should always specify a background color for your page.</p>
<p>Alternatively, you could set the page color by using the RGB values in hexadecimal notation preceded by a &#8216;<code>#</code>&#8216; as in <code>background-color: #ffffff;</code> for white or <code>background-color: #000000;</code> for black. These values use the six-digit RGB notation (<code>#rrggbb</code>). If the two-digit values for Red are the same, and the two-digit values for Green are the same, and the two-digit values for Blue are the same, as in <code>background-color: #0066cc;</code> for example, then the six-digit RGB notation can be abbreviated to the three-digit RGB notation (<code>#rgb</code>) as in <code>background-color: #06c;</code>. However, you cannot abbreviate the RGB notation if any of the three RGB color pairings have differing values. Thus, <code>background-color: #0066cf;</code> cannot be abbreviated to <code>background-color: #06cf;</code> as this has four digits. Only three or six digits are permitted.</p>
<h3>Background Image</h3>
<p>Another common background property is <code>background-image</code>, which uses the <code>url()</code> keyword to specify the path to the image as in <code>background-image: url(images/myImage.bmp)</code> for a relative path or <code>background-image: url(http://poiesis.co.za/css/images/myImage.bmp)</code> for a fixed path. But things really become interesting when using <code>background-image</code> with other <code>background </code> elements such as <code>background-position</code>, <code>background-repeat</code>, and <code>background-attachment</code>.</p>
<h4>Background-repeat</h4>
<p>The <code>background-repeat</code> property controls the repetition of the background image. This can be one of four values:</p>
<ul>
<li><code>repeat</code>, which is the default and repeats (tiles) the image both vertically and horizontally</li>
<li><code>no-repeat</code>, which does not repeat (tile) the image and results in a single background image</li>
<li><code>repeat-x</code>, which repeats (tiles) the image horizontally along the x-axis</li>
<li><code>repeat-y</code>, which default and repeats (tiles) the image vertically along the y-axis</li>
</ul>
<h4>Background-position</h4>
<p>The <code>background-position</code> property controls the horizontal and vertical positioning of the background image. This can two values; one for the <strong>horizontal position</strong> and another for the <strong>vertical position</strong>, and can be specified as values keywords, percentages or units, such as pixels or ems.</p>
<p>The keywords values are top, left, center, right and bottom and can be combined as follows:</p>
<ul>
<li><code>top left</code></li>
<li><code>top center</code></li>
<li><code>top right</code></li>
<li><code>center left</code></li>
<li><code>center center</code></li>
<li><code>center right</code></li>
<li><code>bottom left</code></li>
<li><code>bottom center</code></li>
<li><code>bottom right</code></li>
</ul>
<p>
The default values are <code>center center</code>, thus if one or more of the values are not specified, center is used. For example <code>background-position: top;</code> is the same as <code>background-position: top center;</code> and if no <code>background-position</code> is specified, <code>background-position: center center;</code> is used.</p>
<p>When a percentages are specified, they specify the position of the image in relation to the screen resolution or size of the browser window. This is useful for a liquid design. If only one value is provided, as in <code>background-position: 25%;</code> this value is read as the horizontal position and the vertical passion defaults to <code>50%</code>. However, the horizontal and vertical positions are taken from the top left corner so 0% 0% places the top left corner of the image against the top left corner of the browser window, and 100% 100% places the bottom right corner of the image against the bottom right corner of the window.</p>
<p>Units can be used to specify the exact positioning of the image from the left and top margins of the page. Thus, <code>background-position: 20px 25px;</code> places the top left edge corner of the images 20 pixels in from the left margin of the pages and 25 pixels in from the top margin. As with using percentages to specify the horizontal and vertical values; if only one value is provided, as in <code>background-position: 20px;</code> this value is read as the horizontal position and the vertical passion defaults to <code>50%</code>.</p>
<h4>Background-attachment</h4>
<p>Finally, the <code>background-attachment</code> property controls the scrolling behavior of the background images, allowing the background image to either scroll with the page or to remain static with the content scrolling over the background. As you can imagine, this property can be either <code>scroll</code>, which is the default setting and allows the background to scroll with the page content, or <code>fixed</code>, which causes the background to remain static while the page content scrolls over it.</p>
<h4>Putting it all together</h4>
<p>All four background properties can be combined into a single property using the format:</p>
<p><code>background-color background-image background-repeat background-attachment background-position</code></p>
<p>Thus, the <strong>CSS</strong> code:</p>
<p><code>background-color: aqua;<br />
background-image: url(Images/myImage.gif);<br />
background-repeat: no-repeat;<br />
background-attachment: fixed;<br />
background-position: top center;</code></p>
<p>can be replaced with the single <code>background</code> property as follows:</p>
<p><code>background: aqua url(Images/myImage.gif) no-repeat fixed top center;</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.poiesis.co.za/index.php/2009/05/css-background-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
