<?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>NPSites.com &#187; CSS</title>
	<atom:link href="http://www.npsites.com/category/lessons/css/feed" rel="self" type="application/rss+xml" />
	<link>http://www.npsites.com</link>
	<description>NPSites.com</description>
	<lastBuildDate>Mon, 06 Sep 2010 05:38:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Lesson 1 &#8211; Introduction To CSS For Webdesign</title>
		<link>http://www.npsites.com/2009/04/12/css-lesson-1-introduction-to-css-for-webdesign.html</link>
		<comments>http://www.npsites.com/2009/04/12/css-lesson-1-introduction-to-css-for-webdesign.html#comments</comments>
		<pubDate>Sun, 12 Apr 2009 22:35:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=225</guid>
		<description><![CDATA[Introduction to CSS
CSS is a set of page markup definitions that can be applied to  HTML documents to define how pages are rendered.  This addition to the HTML tag set can be applied by Authors  internally in each HTML document or they can reside in a separate  server side file that [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction to CSS</h2>
<p>CSS is a set of page markup definitions that can be applied to  HTML documents to define how pages are rendered.  This addition to the HTML tag set can be applied by Authors  internally in each HTML document or they can reside in a separate  server side file that is referenced and applied to the document.  The enduser may also define their own Style Sheet that resides on  their local system to be applied to all of the documents that  they browse.</p>
<p>So, what are the advantages of CSS and HTML over plain HTML?  For web site managers the use of an external file containing style  sheet definitions means that they can control the formatting  of their pages across their site without the need to edit each  individual file. This is also very important when pages are  generated by databases and CGI scripts.</p>
<p>The use of CSS commands inside a document can provide authors  extended formatting features to allow specific information to be  presented to the viewer in an exacting method.</p>
<p>For the enduser the use of a client side Style Sheet to modify  how all documents are displayed can offer the ability to view  information with a consistent style. For users with disabilities  CSS can offer readable Font sizes, colors and face choice and in the  future it will also add formatting that will instruct how pages  are converted to synthesized speech.</p>
<p><strong>What are the drawbacks of CSS?</strong><br />
Browser compatibility must be the most common difficulty. Anyone that has had problems trying to keep their  JavaScript compatible across browsers and even within different versions of the same manufacture&#8217;s browser knows that making working  documents that are consistent often means not using such features. If a Browser is incapable of implementing CSS it should be able to ignore the CSS style selectors and revert to standard HTML. However if you are creating documents for a closed audience,  as would be the case in a Corporate Intranet environment, the  probability of successful implementation is much greater.</p>
<p>Another factor that Webmasters should be aware of concerning the use of  an external file to define CSS Declarations is that the Enduser will  have to access 2 files to view their pages. This possible initial lag  should be weighted against the overall load that would be placed on the  server if every HTML file required additional data to be added to define the CSS information internally.  Analysis of Initial lag vs.  overall server load would be dependent upon the amount of CSS use  across the site.</p>
<p>When designing a large full featured website with many different offerings such as a CMS / Blog, Shopping Cart and User Forms you will want to keep continuity throughout. This is possible by referencing standard styles in a main style sheet file and importing it into all of your different applications. Use a second style sheet to extend and meet the the requirements for specific software applications.</p>
<h3>CSS Basics</h3>
<p>The application of Styles through CSS is made possible by adding  additional formatting controls to the current HTML TAG Elements. When the author wants to take advantage of the additional formatting a Style Selector is made and applied to the HTML element.</p>
<p><strong>Example:</strong></p>
<pre>&lt;style type="text/css" &gt;
P { color:#ff0000 }
&lt;/style &gt;</pre>
<p>In the example above the HTML element &lt;P&gt; has a color declaration  and the value is a rrggbb color of  #ff0000 . The result would be that all  paragraphs would be formatted to be displayed with a font color of red.  However the Author could override this Style Declaration Value by using a  child element like &lt; font color=&#8221;blue&#8221; &gt; inside of the paragraph.</p>
<p>Another important note is that where it was once common to leave the &lt;P&gt; tag  open Authors should now take care to close it with a &lt;/P&gt; to make sure  that Style Declarations are properly controlled.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/12/css-lesson-1-introduction-to-css-for-webdesign.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 2 &#8211; Understanding The Cascading Part Of CSS Cascading Style Sheets</title>
		<link>http://www.npsites.com/2009/04/13/css-lesson-2-understanding-the-cascading-part-of-css-cascading-style-sheets.html</link>
		<comments>http://www.npsites.com/2009/04/13/css-lesson-2-understanding-the-cascading-part-of-css-cascading-style-sheets.html#comments</comments>
		<pubDate>Mon, 13 Apr 2009 17:54:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=227</guid>
		<description><![CDATA[What is Cascading?
When applying styles to the elements &#60;tags&#62; of your website it is important to understand the hierarchy of how Cascading Styles are applied to elements that are inside of elements.
In standard HTML all pages will start and end with a &#60;html&#62; element tag and the content of the page will be placed inside [...]]]></description>
			<content:encoded><![CDATA[<h2>What is Cascading?</h2>
<p>When applying styles to the elements &lt;tags&gt; of your website it is important to understand the hierarchy of how Cascading Styles are applied to elements that are inside of elements.</p>
<p>In standard HTML all pages will start and end with a &lt;html&gt; element tag and the content of the page will be placed inside of the &lt;body&gt; element tag.</p>
<p>When you apply your CSS Styles to a higher element it will be applied to all elements within it.</p>
<p>For example if you were to apply a font style to your &lt;body&gt; tag the whole page would use those settings unless you override them individually.</p>
<p>.body {color:#33ff33}</p>
<p>&lt;body&gt;<br />
&lt;p&gt;<span style="color: #33ff33;">This is some text</span>&lt;/p&gt;<br />
&lt;p style=&#8221;color:#ff33ff&#8221;&gt;<span style="color: #ff33ff;">This Text has an override</span>&lt;p&gt;<br />
&lt;/body&gt;</p>
<p>The styles will be applied from the outer most container to the inside container.</p>
<h2>What about Enduser Browser CSS Files</h2>
<p>Because both the Author and the Enduser have the ability to use and apply their own style sheets, Cascading is used to control which Style Selector will be used and which Style Selectors will be overridden.</p>
<p>Endusers often make changes to a Browser CSS file so they can read your pages better. For low Vision Visitors of your site they may increase the font size or they may apply font colors that allow them to read your pages easier.</p>
<p>Normally if the Author and Enduser apply different values to the same element the author&#8217;s settings will override the enduser&#8217;s. However because there are situations where the enduser&#8217;s settings should have a higher priority the cascading value <strong>!important</strong> can be used to set a higher weight to a certain Declaration Value.<br />
The Author&#8217;s style</p>
<p><strong>&lt;style type=&#8221;text/css&#8221;&gt;<br />
P { color:#ff0000 }<br />
&lt;/style&gt;</strong></p>
<p>The Enduser&#8217;s Style</p>
<p><strong>&lt;style type=&#8221;text/css&#8221;&gt;<br />
P { color:#000000 !important }<br />
&lt;/style&gt;</strong></p>
<p>In the example above we see that the use of !important in the enduser&#8217;s style sheet is used to override the author&#8217;s setting.</p>
<p>The Author can also take advantage of this value to override a previously defined element by applying the !important value directly to the HTML tag.</p>
<p>The Author&#8217;s style defined in the head area:</p>
<p><strong>&lt;style type=&#8221;text/css&#8221;&gt;<br />
P { color:#ff0000 }<br />
&lt;/style&gt;</strong></p>
<p><strong>Author&#8217;s local override in the HTML tag:</strong></p>
<p>&lt;p style=&#8221;color: green !important&#8221; &gt;this paragraph is green &lt;/p&gt;</p>
<p>Using the !important declaration feature in your CSS can be used to work out bugs in your formatting.  This declaration shown Inline above can also be used in your styles.css file.</p>
<h2>Cascading and the Document Tree</h2>
<p>When a page is rendered there is a hierarchical method applied to the formatting. When the browser retrieves the page it first collects the all of the style information and sorts the selectors using the cascading order to see which rule will take priority. Then the Document Tree is used to add additional weighted order.</p>
<p>When elements are added to a page parent elements influence the child elements so if formatting is applied to the parent element it will be inherited by the child unless the child element overrides the formatting of the parent element.</p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt; CSS Document Tree &lt;/title&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
P { color: #ff0000 ; font-size: 18px }<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body text=&#8221;808080&#8243;&gt;<br />
If someone asks your over for dinner.<br />
&lt;p &gt;Don&#8217;t eat the &lt;font size=3&gt;chicken&lt;/font&gt;.&lt;/p&gt;<br />
&lt;p &gt;&lt;font color=orange&gt;Chicken &lt;/font&gt; are people too.&lt;/p&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>What it looks like:</p>
<div style="padding:15px;border: 5px solid #dddddd; margin: 15px; width: 300px;height:200px">
<p style="color:#808080">If someone asks your over for dinner.</p>
<p style="color: #ff0000 ; font-size: 18px">Don&#8217;t eat the <span style="font-size: small;">chicken</span>.</p>
<p style="color: #ff0000 ; font-size: 18px"><span style="color: orange;">Chicken </span> are people too.</p>
</div>
<p>In the example above you can see that the first line is inheriting its color properties from the BODY element. Then in the first paragraph the P element overrides the BODY TEXT color and finally inside the paragraph the Font element overrides the P element applying its own font size setting.</p>
<p>When you compare the first and second paragraphs you can see that the Font Element is used to partially override parent elements but where the Child element &lt;font&gt; does not override the parent element it will accept the parents formatting characteristics.</p>
<p>The Font element in the first Paragraph accepts the color attribute but changes the size. The Font element in the second paragraph keeps the size and changes the color.<br />
<strong> The Document Tree for this file would be:</strong></p>
<pre>         HTML
          |
         BODY
         /  \
 Body Text   Paragraph
                 |
               FONT</pre>
<h2>Final Note</h2>
<p>It is important to remember and map out what parent elements and styles effect lower or internal tag elements. You will find when you first start that applying font information, borders, margins and other settings to parent elements they can throw you off in your design.</p>
<p>To find where to fix the problem work your way from the inside out until you find the style you need to change or override.</p>
<p>Cascading is also effected by the line number of your CSS style.css file.</p>
<p>Elements that appear closer to the top of the CSS file will effect elements below it. This is where the use of the !important declaration will often be used. We will go over this in more detail in a lesson about setting up your CSS style.css file.</p>
<p>Finally if the element is not defined by a CSS Selector the default settings of the enduser&#8217;s client are used to render the element.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/13/css-lesson-2-understanding-the-cascading-part-of-css-cascading-style-sheets.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 3 &#8211; Linking CSS Files To Your Documents</title>
		<link>http://www.npsites.com/2009/04/14/css-lesson-3-linking-css-files-to-your-documents.html</link>
		<comments>http://www.npsites.com/2009/04/14/css-lesson-3-linking-css-files-to-your-documents.html#comments</comments>
		<pubDate>Tue, 14 Apr 2009 16:57:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=228</guid>
		<description><![CDATA[Style Sheets in External Files
Link
To define an external Style Sheet to be used to format your HTML  you use place a Link element in the Head area of the HTML file.
The basic tag would be:
&#60;LINK REL=stylesheet HREF="mystyle.css"&#62;
Where HREF tells the location and file name and REL indicates the  file is a Style Sheet.

Additional [...]]]></description>
			<content:encoded><![CDATA[<h2>Style Sheets in External Files</h2>
<h3>Link</h3>
<p>To define an external Style Sheet to be used to format your HTML  you use place a Link element in the Head area of the HTML file.</p>
<p><strong>The basic tag would be:</strong></p>
<pre>&lt;LINK REL=stylesheet HREF="mystyle.css"&gt;</pre>
<p>Where HREF tells the location and file name and REL indicates the  file is a Style Sheet.</p>
<hr />
<h2><strong>Additional Declarations include:</strong></h2>
<h3>Media</h3>
<p>Media is used to define the application of the CSS to its end use. If more than one external style sheet is defined with the link element  the Media type would set the proper file to be used for the proper  use of the page. The Media definition is not implemented in IE4 or NS4.</p>
<p>&lt;LINK REL=stylesheet MEDIA=&#8221;screen&#8221; HREF=&#8221;mystyle.css&#8221; TYPE=&#8221;text/css&#8221;&gt;</p>
<p>You can also define more than one profile with comas between the values.</p>
<p>Media=Print,Screen,Aural</p>
<p><strong>PRINT</strong> &#8211; For documents viewed on screen in print preview mode.<br />
<strong>SCREEN</strong> &#8211; a continuous presentation for computer screens.<br />
<strong>PROJECTION</strong> &#8211; paged presentation for projected presentations.<br />
<strong>BRAILLE</strong> &#8211; for braille tactile feedback devices.<br />
<strong>AURAL</strong> &#8211; aural presentation, e.g. for a speech synthesizer.<br />
<strong>ALL</strong> &#8211; the default value, the style sheet applies to all output devices.</p>
<hr />
<h2>Title</h2>
<p>The Title Attribute can be used to define the type of style sheet. Not using the TITLE tag makes your file persistent meaning the Selectors  in a file without a title will always be applied to the document.</p>
<p>TITLE=&#8221;default&#8221;</p>
<p>If you define more than one Style Sheet to be applied to your document  you can use the title attribute to group them.<br />
&lt;LINK REL=&#8221;alternate stylesheet&#8221; TITLE=&#8221;bluepage&#8221; HREF=&#8221;b-paragraph.css&#8221;&gt;<br />
&lt;LINK REL=&#8221;alternate stylesheet&#8221; TITLE=&#8221;bluepage&#8221; HREF=&#8221;b-tables.css&#8221;&gt;<br />
&lt;LINK HREF=&#8221;largefont.css&#8221;&gt;</p>
<p>TYPE can be used to describe the file type of the Style Sheet.<br />
&lt;LINK HREF=&#8221;mystyle.css&#8221; TYPE=&#8221;text/css&#8221;&gt;</p>
<hr />
<h2>Meta Tag</h2>
<p>The Meta element can be used on your page to identify to the  Enduser&#8217;s client that your page includes CSS information.<br />
&lt;META HTTP-EQUIV=&#8221;Content-Style-Type&#8221; CONTENT=&#8221;text/css&#8221;&gt;</p>
<hr />
<h2>Style Sheet use by the Enduser</h2>
<p>If the Enduser would like to construct their own style sheet they would  follow the same method as an author that is constructing an external style  sheet. However because the enduser will not be able to prepare style selectors  that will override all the possible ID and Class Element Declarations the  enduser&#8217;s User Agent should be able to ignore server side Style Sheets.</p>
<p>Internet Explorer agents define the client side Style Sheet in the  Internet Options &#8211; General Tab Under the Accessibility area.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/14/css-lesson-3-linking-css-files-to-your-documents.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 4 &#8211; Using Selectors To Define CSS Styles</title>
		<link>http://www.npsites.com/2009/04/16/css-lesson-4-using-selectors-to-define-css-styles.html</link>
		<comments>http://www.npsites.com/2009/04/16/css-lesson-4-using-selectors-to-define-css-styles.html#comments</comments>
		<pubDate>Thu, 16 Apr 2009 20:04:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=229</guid>
		<description><![CDATA[Selectors
A Selector is the definition of a formatting Style that  can be applied to a HTML Element.
The Selector has three basic parts:
Element {Declaration:  Value}
The Declaration and Value are surrounded by {} braces and the
Declaration is separated from the value by a colon : and a space.
The Selectors relation to common HTML would be [...]]]></description>
			<content:encoded><![CDATA[<h2>Selectors</h2>
<p>A Selector is the definition of a formatting Style that  can be applied to a HTML Element.<br />
The Selector has three basic parts:</p>
<p><span style="color: orange;">Element</span> {<span style="color: red;">Declaration</span>:  <span style="color: green;">Value</span>}</p>
<p>The <span style="color: red;">Declaration</span> and <span style="color: green;">Value</span> are surrounded by {} braces and the<br />
<span style="color: red;">Declaration</span> is separated from the <span style="color: green;">value</span> by a colon : and a space.</p>
<p>The Selectors relation to common HTML would be similar to this tag  structure that is used to define the color of a font:</p>
<p>&lt; <span style="color: orange;">font</span> <span style="color: red;">color</span>=<span style="color: green;">orange</span> &gt;</p>
<p>Where<span style="color: orange;"> Font</span> is the<span style="color: orange;"> Element</span>,<br />
<span style="color: red;">Color</span> is the <span style="color: red;">Declaration</span> and<br />
<span style="color: green;">Orange</span> is the <span style="color: green;">Value</span> of the Declaration.</p>
<hr />
<h2>Type Selectors</h2>
<p>Type selectors are used set the definition of a certain type of element. If you wanted to assign a property to all of the &lt;H1&gt; elements in your  document you would use the following.</p>
<pre>&lt;style&gt;
H1 {color: 000fff}
&lt;/style&gt;</pre>
<p><strong>The syntax is:</strong><br />
Element {declaration: value }</p>
<hr />
<h2>Multiple Declarations</h2>
<p>If you would like to define more than property for your Element  you can use a semicolon ; to separate Declarations.</p>
<pre>&lt;style&gt;
H1 {color: 000fff ;
    font-weight: bold;
    font-size: 12pt
}
&lt;/style&gt;</pre>
<p><strong>The syntax is:</strong><br />
Element {declaration: value ; declaration: value}</p>
<hr />
<h2>Grouping Elements</h2>
<p>If you would like to apply the same properties to different elements you can use a coma , between the elements and use the same Declarations  and Values.</p>
<pre>&lt;style&gt;
H1, TD, P {color: 000fff }
&lt;/style&gt;</pre>
<p><strong>The syntax is:</strong><br />
Element, Element, Element {declaration: value }</p>
<hr />
<h2>Parent Child Elements</h2>
<p>Contextual elements can be combined to for a selector that will be  applied only if a certain element pattern is used in the HTML.</p>
<p>Only works in IE4.</p>
<p>If you wanted all Italic characters to be Blue but only  if they were contained inside a H1 headline.  You could define the selector like this:</p>
<pre>&lt;style&gt;
B ~ I {color: 000fff }
&lt;/style&gt;</pre>
<p><strong>The syntax is:</strong><br />
ParentElement ~ ChildElement {declaration: value}</p>
<p>The following text would be bold but the Italic (e) would  be rendered both Italic and Blue. However Italic text that is not  contained inside a Parent B Element will be rendered just plain  Italic and not blue.</p>
<p>&lt;B&gt;<strong>T&lt;i&gt;<em><span style="color: #000fff;">e</span></em>&lt;/i&gt;xt</strong>&lt;/B&gt;</p>
<p>The Result would look like</p>
<p><strong>T<em><span style="color: #000fff;">e</span></em>xt</strong></p>
<hr />
<h2>Sequential Selectors</h2>
<p>When you want to define a selector that would be applied only if  one element directly follows another element you can use the following  format.<br />
Only works in IE4.</p>
<pre>&lt;style&gt;
/P ~ I/ {color: 000fff }
&lt;/style&gt;</pre>
<p><strong>The syntax is:</strong><br />
/FirstElement ~ SecondElement/ {declaration: value}</p>
<p>And would be applied as follows:</p>
<p>&lt;P&gt;Chickens&lt;/P&gt;<br />
&lt;I&gt;<span style="color: #000fff;"><em>happy chickens</em></span>&lt;/I&gt;</p>
<hr />
<h2>ID Elements</h2>
<p>If you would like to define a declaration and value that you can apply  to elements in your document but you do not want to apply this declaration to all tags of one type you can use an ID element and then apply that ID  to your tags as you wish.</p>
<pre>&lt;style&gt;
#abc123 {color: 000fff }
&lt;/style&gt;</pre>
<p>&lt;P id=abc123&gt; text &lt;/p&gt;</p>
<p><strong>The syntax is:</strong><br />
ID {declaration: value }</p>
<p><strong>The HTML Tag referenced:</strong><br />
&lt;tag id=ID&gt;</p>
<p>If you would like to set up optional declarations for a single element  you can apply an ID to an element. This will allow you to use varying  styles within the same element.</p>
<pre>&lt;style&gt;
H1 #abc123 {color: 000fff }
&lt;/style&gt;</pre>
<p>&lt;H1 id=abc123&gt; text &lt;/H1&gt;</p>
<p><strong>The syntax is:</strong><br />
Element ID {declaration: value }</p>
<p><strong>The HTML Tag referenced:</strong><br />
&lt;tag id=ID&gt;</p>
<hr />
<h2>Class Elements</h2>
<p>Class Elements are defined in a similar method to ID Elements. They can be applied various to HTML elements in a per element  method or they can define a subset class of an element.</p>
<pre>&lt;style&gt;
.chicken {color: 000fff }
&lt;/style&gt;</pre>
<p>&lt;H1 class=&#8221;chicken&#8221;&gt; text &lt;/H1&gt;</p>
<p><strong>The syntax is:</strong><br />
.class {declaration: value }</p>
<p><strong>The HTML Tag referenced:</strong><br />
&lt;tag class=&#8221;classname&#8221;&gt;</p>
<hr />
<h2>Pseudo-Classes</h2>
<p>The ability to change the properties of a element based on  the state of the element can be accomplished by using a  Pseudo Class Element.</p>
<p>The Anchor &lt; A &gt; element can have different rendering  properties applied to it based upon the current state.</p>
<p><strong>The possible variations include:</strong></p>
<p><strong>link</strong> &#8211; unvisited links<br />
<strong>visited</strong> &#8211; visited links<br />
<strong>hover</strong> &#8211; user hovers<br />
<strong>active</strong> &#8211; active links</p>
<pre>&lt;style&gt;
A:hover {color: orange }
&lt;/style&gt;</pre>
<p>&lt;A href=&#8221;file.html&gt; click here &lt;/A&gt;</p>
<p><strong>The syntax is:</strong><br />
element:pseudo_class {declaration: value }</p>
<h2>Final Note</h2>
<p>When defining your Selectors in your CSS file it is good practice to group your selectors based on their use. If you are defining for example your sidebar where ads or other blocks of information will go then group those selectors so you can find and modify them easily.</p>
<p>Defining your Selectors in a CSS File will allow site wide modification from one file but do not dismiss the use of inline CSS within specific elements to localize and limit formatting for specific reasons.</p>
<p>Your CSS File should include General and Non Changing or Specific information about how you want your pages to render. You should not try to load it with every formatting attribute that you need to apply.</p>
<p>A <strong>secret</strong> may be setting up basic shells that you can apply quickly in your documents.</p>
<p>You may want a variety of font sizes try setting up a list of selectors in your css file that can be used across your site.</p>
<p>#font18px {font-size:18px}<br />
#font18pxBlue {font-size:18px;color#2784b0}</p>
<p>then apply them as such</p>
<p>&lt;span id=&#8221;font18pxBlue&#8221;&gt;<span style="font-size:18px;color: #2784b0;">this is 18px blue font</span>&lt;/span&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/16/css-lesson-4-using-selectors-to-define-css-styles.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 5 &#8211; Fonts Setting Atributes</title>
		<link>http://www.npsites.com/2009/04/26/css-lesson-5-fonts-setting-atributes.html</link>
		<comments>http://www.npsites.com/2009/04/26/css-lesson-5-fonts-setting-atributes.html#comments</comments>
		<pubDate>Mon, 27 Apr 2009 01:35:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=241</guid>
		<description><![CDATA[Font Specifications
Font family
A font family  is a group of fonts that resemble each other.  When you are defining your selector to set the font family  your text will be rendered in you can use Exact Names that refer to fonts  that are installed on the enduser&#8217;s system (Ariel, Verdana) or you [...]]]></description>
			<content:encoded><![CDATA[<h2>Font Specifications</h2>
<h3>Font family</h3>
<p>A font family  is a group of fonts that resemble each other.  When you are defining your selector to set the font family  your text will be rendered in you can use Exact Names that refer to fonts  that are installed on the enduser&#8217;s system (Ariel, Verdana) or you can  define Generic names as a last resort.</p>
<p><strong>Possible Generic Font Family names include:</strong><br />
cursive, fantasy, mono-space, serif and sans-serif.</p>
<p>When you are defining Generic families do not use quotes.</p>
<p>When you define a selector with more than one font  you must use quotes to enclose Family names that include spaces  and you should use capital letters where necessary.<br />
Example:</p>
<pre>BODY { font-family: "Times New Roman", Verdana, serif }</pre>
<hr />
<h3>Font Style</h3>
<p>The font style variations of <strong>normal, italic,</strong> or <strong>oblique</strong> can be defined  Normal is the default style if no font style is set.</p>
<pre>P { font-style: italic}</pre>
<hr />
<h3>Font Variant</h3>
<p>The font variant can be used to choose a variation of a font. In the example below the small-caps  value is defined.</p>
<pre>H3 { font-variant: small-caps }</pre>
<hr />
<h3>Font Weight</h3>
<p>The font weight refers to the boldness or lightness of a font.  Keywords can be used to set the value or you can use a numeric  set of values from 100 to 900 in increments of 100 as:  100, 200, 300, 400, 500, 600, 700, 800, 900 .</p>
<p>The keywords bolder and lighter are used to set values that are  relative to the parent element&#8217;s font weight.</p>
<p>The keyword bold is equal to the numeric value 700.</p>
<p><strong>An example would be:</strong></p>
<pre>&lt;style&gt;
  P { font-weight: normal }
  P #12 { font-weight: 900 }
&lt;/style&gt;

this is normal

this is very bold</pre>
<p><span style="font-family: Arial,Helvetica; font-size: x-small;"></p>
<hr /></span></p>
<h3>Font Size</h3>
<p>The font size refers to the size of the font.</p>
<p><strong>The following types of values can be set:</strong><br />
absolute-size, relative-size, length, percentage .</p>
<p>The absolute-size keywords are a series of font sizes that are  set by the enduser&#8217;s viewing agent.</p>
<p><strong>The values you can choose from are:</strong><br />
xx-small, x-small, small, medium, large, x-large, xx-large</p>
<p>Relative Sizes are dependent on the parent element.  When defining a relative size the resulting font size is  chosen from the Font table of the enduser&#8217;s agent.</p>
<p><strong>The values you can choose from are:</strong><br />
larger, smaller</p>
<p><strong>Leghth</strong><br />
When you apply a length the value can be either relative to the parent or  it can be an absolute value.</p>
<p><strong>Relative values are:</strong></p>
<p><strong>em</strong> Elements Mheight<br />
<strong>ex</strong> Elements Xheight<br />
<strong>px</strong> pixels</p>
<p><strong>Absolute values are:</strong></p>
<p><strong>pt</strong> points<br />
<strong>in</strong> inches<br />
<strong>cm</strong> centimeters<br />
<strong>mm</strong> millimeters<br />
<strong>pc</strong> picas</p>
<p><strong>Percentage</strong><br />
The percentage value is also relative to the parent element.<br />
<strong>The selector would be defined as follows:</strong></p>
<pre>&lt;style&gt;
  P #120 { font-size: 120% }
&lt;style&gt;</pre>
<p>Here is a simulation of what it would look like:</p>
<p>&lt;P&gt;this is normal&lt;P ID=120&gt;<span style="font-size: xx-small;">this is text is 20% larger</span>&lt;/P&gt; &lt;/P&gt;</p>
<h2><strong>Helpful Tip</strong></h2>
<p>To make your life easier you should begin by setting up a font definition list that you can include in all of your CSS files.</p>
<p>Using IDs you can set up a list of font specs that you can apply in your documents.</p>
<p>#font12px  {font-size:12px}<br />
#font14px  {font-size:14px}<br />
#font16px  {font-size:16px}<br />
#font20px  {font-size:20px}<br />
#font24px  {font-size:24px}</p>
<p>#font12pxRed  {font-size:12px;color:#FF0600}<br />
#font14pxRed  {font-size:14px;color:#FF0600}<br />
#font16pxRed  {font-size:16px;color:#FF0600}<br />
#font20pxRed  {font-size:20px;color:#FF0600}<br />
#font24pxRed  {font-size:24px;color:#FF0600}</p>
<p>Apply the fonts in a &lt;div id=&#8221;font16pxRed&#8221;&gt; or where ever they are needed.</p>
<p>Setting up a basic list of fonts will allow you to apply site wide colors that match your theme or company colors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/26/css-lesson-5-fonts-setting-atributes.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 6 &#8211; Text Formatting</title>
		<link>http://www.npsites.com/2009/04/27/css-lesson-6-text-formatting.html</link>
		<comments>http://www.npsites.com/2009/04/27/css-lesson-6-text-formatting.html#comments</comments>
		<pubDate>Mon, 27 Apr 2009 18:12:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=242</guid>
		<description><![CDATA[Text Formatting
Where Font attributes apply to the character level Text Formatting  applies to how the characters are manipulated to makeup words and  how words are used to make sentences.

Indenting
The text-indent property will allow you to indent the first line of a  block of text.
Values include: length, percentage
 P { text-indent: 3em }

Text [...]]]></description>
			<content:encoded><![CDATA[<h3>Text Formatting</h3>
<p>Where Font attributes apply to the character level Text Formatting  applies to how the characters are manipulated to makeup words and  how words are used to make sentences.</p>
<hr />
<h3>Indenting</h3>
<p>The text-indent property will allow you to indent the first line of a  block of text.</p>
<p><strong>Values include:</strong> length, percentage</p>
<pre> P { text-indent: 3em }</pre>
<hr />
<h3>Text Alignment</h3>
<p>Defines how a block of text will be aligned within a containing element.</p>
<p><strong>Values include:</strong> left, right, center, justify</p>
<pre>P { text-align: center }</pre>
<p>The text-align attribute can also be used to center a page or container.</p>
<hr />
<h3>Decoration</h3>
<p>This property can be applied to text to add additional decorative features.</p>
<p><strong>Values include:</strong> none, underline, overline, line-through, blink</p>
<p>Note: Blink does not work with IE and Overline does not work with NS4.</p>
<p>You can also use this declaration to override the default settings of the users agent. The following example will allow you to create links that are not underlined.</p>
<p>Also see Pseudo Class Elements.</p>
<pre>&lt;style&gt;
  A:link, A:visited, A:active { text-decoration: none }
&lt;/style&gt;

&lt;a href="file.html"&gt;Click Here&lt;/a&gt;</pre>
<hr />
<h3>Text shadows</h3>
<p>Allows you to define a shadow effect to your text.<br />
Note: This Text Formatting feature does not work in IE4 or NS4.</p>
<pre>&lt;style&gt;
  P { text-shadow: black }
&lt;/style&gt;

&lt;P&gt;This is some text&lt;/P&gt;</pre>
<p>text-shadow has been deprecated in new CSS browsers.</p>
<hr />
<h3>Word Spacing</h3>
<p>Word Spacing allows you to define the amount of space between words.<br />
Note: This Text Formatting feature does not work in IE4 or NS4.</p>
<p><strong>Values include:</strong> normal, length, auto</p>
<pre>  H1 { word-spacing: 1em }</pre>
<hr />
<h3>Letter Spacing</h3>
<p>Letter Spacing allows you to define the amount of space between  letters in each word.</p>
<p>Note: This Text Formatting feature does not work in NS4.</p>
<p><strong>Values include:</strong> normal, length, auto</p>
<pre>&lt;style&gt;
P { letter-spacing: 0.1cm }
&lt;/style&gt;

&lt;P&gt;This is some text&lt;/P&gt;</pre>
<hr />
<h3>Text Transform Case</h3>
<p>Case allows you to change how a block of text will appear. This is an easy way to override the formatting of a block  of text that has already been typed and placed in the document.</p>
<p><strong>Values include:</strong> capitalize, uppercase, lowercase, none</p>
<p>The values of this property have the following meanings:</p>
<p><strong>capitalize:</strong> first character of each word is uppercase<br />
<strong>uppercase:</strong> all characters are uppercase<br />
<strong>lowercase:</strong> all characters are lowercase<br />
<strong>none:</strong> element ignores parent element value</p>
<pre>&lt;style&gt;
P { text-transform: uppercase }
&lt;/style&gt;

&lt;P&gt;This is some text&lt;/P&gt;</pre>
<hr />
<h3>White Space</h3>
<p>White space is used to define how a block of text will be controlled  within an element. White space refers to the spaces between the words.</p>
<p>Note: This Text Formatting feature does not work in IE4  and has only partial support in NS4.</p>
<p><strong>Values include:</strong> normal, pre, nowrap</p>
<p>In the example below the H1 element has been given the white-space  value of pre or preformatted text. This means that additional  spaces between words will be preserved as if the block was preformatted text.</p>
<pre>&lt;HTML&gt;
 &lt;HEAD&gt;
  &lt;STYLE type="text/css"&gt;
  H1   { white-space: pre }
&lt;/STYLE&gt;
&lt;BODY&gt;

&lt;H1&gt;This is     some text &lt;/H1&gt;

&lt;/BODY&gt;
&lt;/HTML&gt;</pre>
<h2><strong>Note</strong></h2>
<p>Proper spacing of characters and words will allow the reader to visually understand the content of your pages.</p>
<p>Too much space can be as bad as not enough and anyone who has had to enter a comment limit word on youtube or to submit a form understands that it is not only size, color and font choice but also how the characters are presented that allows you to read and understand the words quickly.</p>
<p>No one wants to struggle when they are reading a few pages of text so use these style attributes conservatively not creatively.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/27/css-lesson-6-text-formatting.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 7 &#8211; Formatting Lists</title>
		<link>http://www.npsites.com/2009/04/28/css-lesson-7-formatting-lists.html</link>
		<comments>http://www.npsites.com/2009/04/28/css-lesson-7-formatting-lists.html#comments</comments>
		<pubDate>Tue, 28 Apr 2009 20:15:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=243</guid>
		<description><![CDATA[Lists
CSS Selectors can provide the Author extended control over how their Lists  are formatted.
Properties can be applied to the markers that appear  before the list items to provide order to the information.
In addition to the regular list styles that are available in HTML  the author can also define their own marker item [...]]]></description>
			<content:encoded><![CDATA[<h2>Lists</h2>
<p>CSS Selectors can provide the Author extended control over how their Lists  are formatted.</p>
<p>Properties can be applied to the markers that appear  before the list items to provide order to the information.</p>
<p>In addition to the regular list styles that are available in HTML  the author can also define their own marker item by using an image.</p>
<p>Other proposed CSS declaration values would control how the list  item markers are applied and indented in relation to the line items.</p>
<p>The possible values have the following meanings:</p>
<p><strong>disc:</strong> A disc (exact presentation is UA-dependent)<br />
<strong>circle:</strong> A circle (exact presentation is UA-dependent)<br />
<strong>square:</strong> A square (exact presentation is UA-dependent)<br />
<strong>decimal:</strong> Decimal numbers, beginning with 0.<br />
<strong>lower-roman:</strong> Lower case roman numerals (i, ii, iii, iv, v, etc.)<br />
<strong>upper-roman:</strong> Upper case roman numerals (I, II, III, IV, V, etc.)<br />
<strong>lower-alpha:</strong> Lower case ascii letters (a, b, c, &#8230; z)<br />
<strong>upper-alpha:</strong> Upper case ascii letters (A, B, C, &#8230; Z)<br />
<strong>none:</strong> No marker</p>
<pre>&lt;STYLE&gt;
  OL { list-style-type: lower-roman }
&lt;/STYLE&gt;

&lt;BODY&gt;

&lt;OL&gt;
&lt;LI&gt; This is the first item.
&lt;LI&gt; This is the second item.
&lt;LI&gt; This is the third item.
&lt;/OL&gt;

&lt;/BODY&gt;</pre>
<h3>list-style-image</h3>
<p>When you would like to us an image to represent the  bullet of your list items you can use the URL value you can also  define a list-style-type to be used if the enduser has disabled  the loading of images.<br />
Works only with IE4</p>
<p>The following example sets the marker at the beginning of each  list item to be the image &#8220;icon.jpg&#8221;.</p>
<pre>&lt;style&gt;
  UL { list-style-image: url(http://www.server.com/icon.jpg) }
&lt;/style&gt;</pre>
<h3>list-style-position</h3>
<p>CSS2 has also defined a selector declaration that would allow you  to position the List marker either away from the Line Item or it could  have the value compact that would make the Marker move to the position  of the first character in the Line Item.<br />
This is not implemented in either IE4 or NS4</p>
<p>Possible values include: inside, outside</p>
<pre>&lt;style&gt;
  UL { list-style-position:inside }
&lt;/style&gt;</pre>
<h2><strong>NOTE</strong></h2>
<p>Lists are often used for Menu Systems in CMS or Blog Software like WordPress or Drupal.</p>
<p>There are a variety of ways of setting up your menus by taking advantage of list formatting and using a small amount of javascript.</p>
<p>Suckerfish is a great starting place for Menu Systems made with Li elements.  The code is easy to setup and the CSS formatting is only about 20 lines of attribute setup.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/28/css-lesson-7-formatting-lists.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Lesson 8 &#8211; Formatting Tables</title>
		<link>http://www.npsites.com/2009/04/29/css-lesson-8-formatting-tables.html</link>
		<comments>http://www.npsites.com/2009/04/29/css-lesson-8-formatting-tables.html#comments</comments>
		<pubDate>Wed, 29 Apr 2009 16:50:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=245</guid>
		<description><![CDATA[Tables
The use of tables after divs were introduced to html will either be accepted or not.
The fact is tables have their place and that place should not be restricted to display of spreadsheet information or XML dumps.
On the other hand because many browsers display tables and their formatting differently you should check your work for [...]]]></description>
			<content:encoded><![CDATA[<h2>Tables</h2>
<p>The use of tables after divs were introduced to html will either be accepted or not.</p>
<p>The fact is tables have their place and that place should not be restricted to display of spreadsheet information or XML dumps.</p>
<p>On the other hand because many browsers display tables and their formatting differently you should check your work for cross browser compatibility.</p>
<p>Caution should be used when defining selectors that alter the  proportions and layout of your tables. If selectors are used  to set widths or row and column spanning there is the possibility  that your documents could become unreadable by browsers that  can not correctly parse the selectors.</p>
<p><strong>Tables</strong> are often used by Authors to organize their page content into  readable and visually appealing documents. Tables are defined by using  a layered grid.</p>
<p>The &lt;TABLE&gt; element being on the bottom defines:  the overall width and height of the table and how the cells of the table  will be separated with margins.</p>
<p>The &lt;ROW&gt; element is then used to separate the table into a number  of horizontal rows but can not contain the actual page content.</p>
<p>Finally the top layer the &lt;TD&gt; element is used to define columns  that are placed inside the rows to hold the actual information to be displayed.</p>
<p>Table Headers &lt;TH&gt; are also used to provide comment lines between the row / column contents. They can not contain column elements  and are considered row elements.</p>
<p>The &lt;CAPTION&gt; element can be used to contain a description of the table. Although the code is placed inside the &lt;TABLE&gt; element it is displayed  outside the boundaries of the table border.</p>
<p>Because all of these elements are containers many formatting Declaration Values can be  applied to them to define: width, color, border,&#8230; and styles can be inherited  by their child elements to define: text color, size, and family and so on.</p>
<p><strong>An example would be:</strong></p>
<pre>&lt;HTML&gt;
 &lt;HEAD&gt;
&lt;style&gt;
 TABLE {background:00C9FF }
 CAPTION {background:blue; color:yellow; font-size:20pt; caption-side:bottom }
 TR.whitetext {color:FFFFFF ; font-size:18pt}
 TD.redtext {border: thick solid red; color:red ; font-size:24pt}
 TD.ltgreenbackground {background:lightgreen}
 #width30 {width=30}

&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;  

&lt;table border=0&gt;
&lt;th colspan=3&gt;This is the header&lt;/th&gt;
&lt;tr class="whitetext"&gt;
&lt;td&gt;This is the first row first column &lt;/td&gt;
&lt;td class="ltgreenbackground" width=30&gt;
&lt;font color="green"&gt;second row second col&lt;/font&gt;
&lt;/td&gt; &lt;td&gt;Row 1 Col3&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt;
&lt;td ID="width30" class="redtext"&gt;This text should be red &lt;/td&gt;
&lt;td bgcolor="yellow"&gt;Row2 col2
&lt;/td&gt; &lt;td class="image"&gt;
&lt;font size="2"&gt;can you see this?&lt;/font&gt; &lt;/td&gt; &lt;/tr&gt;
&lt;caption bgcolor="green"&gt;This is a caption&lt;/caption&gt;
&lt;/table&gt;

&lt;/BODY&gt;
&lt;/HTML&gt;</pre>
<table style="background:#00C9FF" border="0">
<tbody>
<tr style="color:#FFFFFF ; font-size:18pt">
<th colspan="3">This is the header</th>
</tr>
<tr style="color:#FFFFFF ; font-size:18pt">
<td>This is the first row first column</td>
<td style="background:lightgreen" width="30"><span style="color: green;">second row second col</span></td>
<td>Row 1 Col3</td>
</tr>
<tr>
<td style="border: thick solid red; color: red; font-size: 24pt; width: 30px;">This text should be red</td>
<td bgcolor="yellow">Row2 col2</td>
<td><span style="font-size: x-small;">can you see the this?</span></td>
</tr>
</tbody>
<caption style="background:blue; color:yellow; font-size:20pt; caption-side:bottom ">This is a caption</caption>
</table>
<hr /><strong>With this in mind here are the declarations that may be used for your  table elements.</strong></p>
<h3>column-span</h3>
<p>Sets the number of Columns that a will be spanned by a column  that is above two or more columns.</p>
<h3>row-span</h3>
<p>Sets the number rows a Cell will span.</p>
<h3>width</h3>
<p>Sets the width of the Cell Not implemented in all browsers.</p>
<h3>border</h3>
<p>The border Declaration can be used for shorthand to define  the color, style, width of your border.<br />
Example you define a border of a cell with the following selector:</p>
<p>TD.red {border: red thick}<br />
The cell will be red and thick.<br />
You can also use the following declarations to define these  properties individually.</p>
<h3>border-width</h3>
<p>Sets the width of the border of the Cell.<br />
Not implemented in all browsers.</p>
<h3>border-color</h3>
<p>Sets the color of the border.<br />
Not implemented in all browsers.</p>
<h3>border-style</h3>
<p>Sets the type of line used for the border.<br />
Not implemented in all browsers</p>
<p><strong>Values that can be used:</strong></p>
<p>blank, double, solid, ridge, groove, none, dashed, dotted</p>
<h3>vertical-align</h3>
<p>When you align contents in the sell you are shifting the baseline  of the cells contents. The first Line of text or the bottom of the  first image is used to set the baseline of a Table Cell. If the  Cell is empty the bottom of the cell is considered the baseline.</p>
<p><strong>Values include:</strong> baseline, top, bottom, middle<br />
<strong>Not Supported in all browsers:</strong> <strong></strong> text-top, text-bottom, sub, super</p>
<pre>&lt;Style&gt;
TD {vertical-align:bottom}
&lt;/Style&gt;</pre>
<h3>Alignment</h3>
<p>Used to align text horizontally within a cell</p>
<h3>caption-side</h3>
<p>Used to position Table Captions<br />
Not implemented in IE4 or NS4.</p>
<h3>speak-header-cell</h3>
<p>Used to tell Text to Speech Synthesizers how they should  interpret and read the table.<br />
Aural Styles are not implemented in most browsers.</p>
<p><strong>Note</strong><br />
Formatting Tables with CSS is a very reasonable way to control your content&#8217;s layout but only if you double check your work in both IE and FireFox.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/04/29/css-lesson-8-formatting-tables.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS &#8211; Applying Transparency To Your Backgrounds</title>
		<link>http://www.npsites.com/2009/05/04/css-applying-transparency-to-your-backgrounds.html</link>
		<comments>http://www.npsites.com/2009/05/04/css-applying-transparency-to-your-backgrounds.html#comments</comments>
		<pubDate>Tue, 05 May 2009 03:15:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=257</guid>
		<description><![CDATA[There are a variety of reasons that you may want to use Transparency in your designs and often you will find a png file set to transparent will meet your needs but you can also set transparency of your containers.
Unfortunately the CSS attribute of transparency is not cross browser compliant so you will need to [...]]]></description>
			<content:encoded><![CDATA[<p>There are a variety of reasons that you may want to use Transparency in your designs and often you will find a png file set to transparent will meet your needs but you can also set transparency of your containers.</p>
<p>Unfortunately the CSS attribute of transparency is not cross browser compliant so you will need to add methods for IE and Firefox within the same selector.</p>
<p>Below you can see a range of transparency set on the background of a div that contains the number representing the transparency level of the div.<br />
As you will notice this method is not perfect and unfortunately every thing within the container div will take on the transparency without the ability to override it locally on child containers.<br />
<br clear="all"><br />
<br clear="all"></p>
<div>
<div style="background: #000000 none repeat scroll 0% 0%; width: 20px; height: 20px; color: #ff0000; float: left; opacity: 0.1;filter:alpha(opacity=10);">10</div>
<div style="background: #000000 none repeat scroll 0% 0%; width: 20px; height: 20px; color: #ff0000; float: left; opacity: 0.3;filter:alpha(opacity=30);">30</div>
<div style="background: #000000 none repeat scroll 0% 0%; width: 20px; height: 20px; color: #ff0000; float: left; opacity: 0.5;filter:alpha(opacity=50);">50</div>
<div style="background: #000000 none repeat scroll 0% 0%; width: 20px; height: 20px; color: #ff0000; float: left; opacity: 0.7;filter:alpha(opacity=70);">70</div>
<div style="background: #000000 none repeat scroll 0% 0%; width: 20px; height: 20px; color: #ff0000; float: left; opacity: 0.9;filter:alpha(opacity=90);">90</div>
</div>
<p><br clear="all"><br />
<br clear="all"></p>
<p>To apply transparency you must include at least 2 property declarations.</p>
<p>	<strong>filter:alpha(opacity=30); # this will cover IE<br />
	opacity: 0.3; # this will cover the rest</strong></p>
<p>In other demonstrations we will cover the use of PNG image files for use as transparent backgrounds and also implement css transparency on images that have no transparency level set.</p>
<p>CSS transparency will work on any container with a background set and it will also work on images including JPEG images that do not allow transparency values.</p>
<p>When in doubt of your visitors browser level and ability always use conservative methods in your css declarations.</p>
<p>Never obscure your menus, links or other important features.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/05/04/css-applying-transparency-to-your-backgrounds.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS HowTo &#8211; Using Image Backgrounds In Your Designs</title>
		<link>http://www.npsites.com/2009/05/04/css-howto-using-image-backgrounds-in-your-designs.html</link>
		<comments>http://www.npsites.com/2009/05/04/css-howto-using-image-backgrounds-in-your-designs.html#comments</comments>
		<pubDate>Tue, 05 May 2009 04:44:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.npsites.com/?p=258</guid>
		<description><![CDATA[In this HowTo we will cover some of the methods of using CSS and images for your container backgrounds.
Almost any container can be styled with CSS this means you can apply images to your page backgrounds, Table and individual Table Cell Backgrounds, Divs and even your forms.
Most of the common declarations will apply to all [...]]]></description>
			<content:encoded><![CDATA[<p><img src="/guides/images/200TPgreenleaf.png" alt="" align="right" />In this HowTo we will cover some of the methods of using CSS and images for your container backgrounds.</p>
<p>Almost any container can be styled with CSS this means you can apply images to your page backgrounds, Table and individual Table Cell Backgrounds, Divs and even your forms.</p>
<p>Most of the common declarations will apply to all elements.</p>
<p>Ok so lets start off easy and apply a leaf background to our page.<br />
(the examples are representations and may not look exactly the same in all browsers.)</p>
<h2><strong>Applying The Image</strong></h2>
<p>ok so we have a leaf.png file we want to add to our body element by using css.</p>
<p>body {background-image: url(&#8217;/leaf.png&#8217;)}</p>
<p>and the result would look something like this</p>
<div style="border: 1px solid #333333; background-image: url(/guides/images/200TPgreenleaf.png); width: 200px; height: 275px;"></div>
<h2><strong>Limit Repeat to One Time</strong></h2>
<p>In our leaf example you can see that the image will repeat for the length and width of the page. We want just one image to show on the page so we can use no-repeat.</p>
<p>background-image:url(/leaf.png);</p>
<p>background-repeat:no-repeat&#8221;</p>
<div style="border: 1px solid #333333; background-image: url(/guides/images/200TPgreenleaf.png); width: 200px; height: 275px; background-repeat: no-repeat;"></div>
<h2><strong>Controlling the repeat direction</strong></h2>
<p>Often you will use special fade images that need to be applied only in one direction<br />
Ok lets say we want to limit the repeat pattern in the x or y direction.</p>
<p>In this case we would control the repeat property.</p>
<p><strong>background-repeat: repeat-x</strong><br />
<strong>background-repeat: repeat-y</strong></p>
<div>
<div style="border: 1px solid #333333; float: left; background-image: url(/guides/images/5050Wht-greenleaf.png); width: 200px; height: 275px; background-repeat: repeat-x;"></div>
<div style="border: 1px solid #333333; float: left; background-image: url(/guides/images/5050Wht-greenleaf.png); width: 200px; height: 275px; background-repeat: repeat-y;"></div>
</div>
<p><strong><br />
</strong></p>
<p><br  clear="all"/></p>
<h2 clear="all"><strong>Positioning the Background Image</strong></h2>
<p>Now something a little more tricky lets say we want to use our leaf but we need it placed in a specific place on the container or page.</p>
<p>We can set the no-repeat , fixed and its position in pixels.<br />
background-repeat: no-repeat;<br />
background-attachment:fixed;<br />
background-position: 50px 75px;</p>
<p>And it should look something like this:</p>
<div style="border: 1px solid #333333; background-image: url(/guides/images/5050Wht-greenleaf.png); width: 200px; height: 275px; background-repeat: no-repeat;"></div>
<p><strong><br />
</strong></p>
<h2><strong>Setting The Transparency of the Background Image</strong></h2>
<p>Now this is a tricky thing to do but it can be applied on containers.</p>
<p>If you notice the image on the right is lighter because the white background is showing through. This will work with any image but browser compatibility can be an issue. Use this technique sparingly.</p>
<p>opacity: 0.4;<br />
filter:alpha(opacity=40)</p>
<div>
<div style="border: 1px solid #333333; float: left; background-image: url(/guides/images/200TPgreenleaf.png); width: 200px; height: 275px; background-repeat: no-repeat;"></div>
<div style="border: 1px solid #333333; background: transparent url(/guides/images/200TPgreenleaf.png) no-repeat scroll 0% 0%; float: left; width: 200px; height: 275px; opacity: 0.4;"></div>
</div>
<p><br  clear="all"/></p>
<h2>Final Note</h2>
<p>CSS is a great tool and it should be used along with other methods to create your final design.</p>
<p>When possible you should always revert and rely on the simplest ways to create your projects.</p>
<p>When you visit many large high volume sites you may notice that they do make use of larger images to show content instead of relying on formatting that could change across browsers or because of different settings within the same browser.</p>
<p>You should never use css to fix things on the fly or add special tricks&#8230;. you should use it to contribute to your design because it is the best way to do something.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.npsites.com/2009/05/04/css-howto-using-image-backgrounds-in-your-designs.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
