<?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>Siam Communications Web Services &#38; Tools &#187; style attributes</title>
	<atom:link href="http://www.siamcomm.com/tag/style-attributes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.siamcomm.com</link>
	<description>Simple Web Sites that Produce Results</description>
	<lastBuildDate>Sun, 29 Aug 2010 13:22:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Getting to Grips with CSS</title>
		<link>http://www.siamcomm.com/how-tos/getting-to-grips-with-css/</link>
		<comments>http://www.siamcomm.com/how-tos/getting-to-grips-with-css/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 07:57:49 +0000</pubDate>
		<dc:creator>Eric</dc:creator>
				<category><![CDATA[How to's]]></category>
		<category><![CDATA[cascading style sheets]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[style attributes]]></category>
		<category><![CDATA[style sheet]]></category>

		<guid isPermaLink="false">http://www.siamcomm.com/blog/?p=14</guid>
		<description><![CDATA[Occasionally, we receive questions from our members about implementing technologies that are still new to them. The following post covers a topic on CSS (Cascading Style Sheets) that we hope you find useful. Martin from WealthyDragon writes &#8220;I know what CSS does and what it allows you to do, but I&#8217;ve never got to grips [...]


Related posts:<ol><li><a href='http://www.siamcomm.com/how-tos/resetting-browser-with-css/' rel='bookmark' title='Permanent Link: Resetting the Browser with CSS'>Resetting the Browser with CSS</a></li>
<li><a href='http://www.siamcomm.com/seo/improving-your-on-page-seo/' rel='bookmark' title='Permanent Link: Improving your On-page SEO'>Improving your On-page SEO</a></li>
<li><a href='http://www.siamcomm.com/website-design/presenting-your-blog-on-an-iphone/' rel='bookmark' title='Permanent Link: Presenting your Blog on an iPhone'>Presenting your Blog on an iPhone</a></li>
</ol>

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.siamcomm.com%2Fhow-tos%2Fgetting-to-grips-with-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.siamcomm.com%2Fhow-tos%2Fgetting-to-grips-with-css%2F&amp;source=siamcomm&amp;style=normal&amp;service=bit.ly&amp;service_api=erbuc%3AR_4b34be0ba7f3518b2ad9e2565167eeae&amp;space=1" height="61" width="50" /><br />
			</a>
		</div>
<p>Occasionally, we receive questions from our members about implementing technologies that are still new to them. The following post covers a topic on CSS (<strong>Cascading Style Sheets</strong>) that we hope you find useful.</p>
<p><a href="http://www.wealthydragon.com/blog/?page_id=24" title="Martin from WealthyDragon" target="_blank">Martin</a> from <a href="http://www.wealthydragon.com/blog/" title="Wealthy Dragon Blog" target="_blank">WealthyDragon</a> writes &#8220;<em>I know <strong>what CSS does</strong> and what it allows you to do, but I&#8217;ve never got to grips with actually using it. There are still murmurings in the forums that getting CSS to work in different browsers still causes headaches. So I don&#8217;t plan on using it until those wrinkles are easier to manage.</em>&#8221;</p>
<p>&#8220;<em>For example:  what are the files that make up a page that uses CSS?<br />
On pages that don&#8217;t use CSS, you have an HTML file, some image files and<br />
whatever other files you need (e.g. audio files, etc.).  What are the<br />
files that make up a page that uses CSS?</em>&#8221;</p>
<p>This is a problem many people have that already have their own websites, but want a better way to <strong>dress up their website</strong>. In the beginning, there were many problems related to cross-browser compatibility. But many of these have been worked out and the ones that remain are usually in the more advanced realm of using CSS. Those issues aside, let&#8217;s start with some basics.</p>
<p>First, CSS can be implemented right inside your HTML files. There is no need for any other files. Style attributes can also be used right inside your HTML tags as well. However, having a separate CSS file for your styles allows the same style sheet to be used for all of the pages on your web site. Have I confused you yet? Let&#8217;s look at each option:</p>
<p><u><strong>Option 1 &#8211; Implementing CSS in your HTML files</strong></u></p>
<p>There is an HTML tag named &lt;STYLE&gt;. By inserting a set of STYLE tags in your HTML file just after the BODY tag, you can define STLYE attributes for your web page. For example:</p>
<p class="code">&lt;STYLE&gt;<br />
body {<br />
font-size: 11px;<br />
font-weight: italic;<br />
color: #FF0000;<br />
}<br />
&lt;/STYLE&gt;</p>
<p>This is the style that will be applied to everything in between the &lt;BODY&gt; tags of the HTML file.  It says that my text will be 11pixels in size, in Italics and the color Red. Every tag in the CSS file starts with the HTML tag (without the brackets) an opening &#8216;{&#8216;, the formatting commands and a closing &#8216;}&#8217;. Each formatting command is structured as &#8216;<strong><font color="#ff00ff">attribute</font></strong>: <strong><font color="#0000ff">setting</font></strong>;&#8217;</p>
<p>Insert a STYLE section at the top of your page just after the BODY tag and change around some of the settings between the brackets (the &#8216;{&#8216; and &#8216;}&#8217; brackets). This is one of the best ways to <strong>learn how CSS works</strong> on your web page.</p>
<p><u><strong>Option 2 &#8211; Style attributes within HTML tags</strong></u></p>
<p>The second way of using STYLE tags is to put them right inside your HTML tags. For instance, we are all familiar with the tag to create a link so let&#8217;s use that one:</p>
<p>&lt;a href=&#8221;myhomepage.html&#8221;&gt;Text that links to my page&lt;/a&gt;</p>
<p>This is the standard use of the tag, now lets add some formatting using the style attribute in the tag and some <strong>style sheet commands</strong>:</p>
<p>&lt;a style=&#8221;font-weight:bold; font-variant:small-caps; font-size:12px;&#8221; href=&#8221;myhomepage.html&#8221;&gt;Text that links to my page&lt;/a&gt;</p>
<p>This should produce the following result:</p>
<p><a href="http://www.scgdomains.com/index.html" style="font-weight: bold; font-variant: small-caps; font-size: 12px">Text that links to my page</a></p>
<p>This is the method I use when designing my websites until I get the desired look, and then I move everything into a style sheet file. Which brings us to option 3 &#8230;</p>
<p><u><strong>Option 3 &#8211;  Integrating CSS as a separate file</strong></u></p>
<p>Having all of your styles in a separate file keeps the look and feel of your web pages standard across your entire website. Once you have all of your formatting done, you can save them into a file with the extension &#8216;.css&#8217;, such as &#8216;style.css&#8217;. You then link to this file from your HTML files with the following command:</p>
<p>&lt;link href=&#8221;style.css&#8221; rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221;&gt;</p>
<p>This line should go just before the &lt;/HEAD&gt; tag in your HTML file.</p>
<p><u><em><strong>Summary</strong></em></u></p>
<p>This is just the beginning, and by no means a comprehensive guide to CSS. But, if you are comfortable with using one or all of the options mentioned above, you are now ready to begin playing around with the different attributes of CSS to get your website looking its best.</p>
<p>There is a <a href="http://www.htmldog.com/reference/cssproperties/" title="CSS Reference Guide" target="_blank">full reference on CSS tags and attributes here</a>.</p>
<p>There is a <a href="http://lesliefranke.com/files/reference/csscheatsheet.html" title="CSS Cheat Sheet" target="_blank">CSS Cheat Sheet for your reference here</a>.</p>
<p>Have fun!</p>


<p>Related posts:<ol><li><a href='http://www.siamcomm.com/how-tos/resetting-browser-with-css/' rel='bookmark' title='Permanent Link: Resetting the Browser with CSS'>Resetting the Browser with CSS</a></li>
<li><a href='http://www.siamcomm.com/seo/improving-your-on-page-seo/' rel='bookmark' title='Permanent Link: Improving your On-page SEO'>Improving your On-page SEO</a></li>
<li><a href='http://www.siamcomm.com/website-design/presenting-your-blog-on-an-iphone/' rel='bookmark' title='Permanent Link: Presenting your Blog on an iPhone'>Presenting your Blog on an iPhone</a></li>
</ol></p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.siamcomm.com/how-tos/getting-to-grips-with-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 23/61 queries in 0.209 seconds using disk

Served from: www.siamcomm.com @ 2010-09-06 21:55:26 -->