<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>FWebDe</title>
	
	<link>http://fwebde.com</link>
	<description>Helping people to make fantastic websites, whether you are a designer, a developer, or someone just who loves websites.</description>
	<lastBuildDate>Wed, 17 Mar 2010 08:04:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Fwebde" /><feedburner:info uri="fwebde" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>Fwebde</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/Fwebde" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsalloy.com/?rss=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.newsalloy.com/subrss3.gif">Subscribe with NewsAlloy</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://download.attensa.com/app/get_attensa.html?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.attensa.com/blogs/attensa/WindowsLiveWriter/BadgeredintoBadges_10C02/attensa_feed_button5.gif">Subscribe with Attensa for Outlook</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.flurry.com/pushRssFeed.do?r=fb&amp;url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.flurry.com/images/flurry_rss_logo2.gif">Subscribe with Flurry</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2FFwebde" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><item>
		<title>10 Tips to Make Your Blog Posts More Readable</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/DSdeMXL9wcg/</link>
		<comments>http://fwebde.com/web-design/10-tips-to-make-your-blog-posts-more-readable/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 08:04:19 +0000</pubDate>
		<dc:creator>Tom Walker</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=2078</guid>
		<description><![CDATA[When surfing the web for the information we want, our attention span is incredibly short. The reason for this is that we know if the site we’re on doesn’t instantly supply us with what we’re looking for, there are plenty of other sites a few clicks away that probably will.]]></description>
			<content:encoded><![CDATA[<p><em>This is a guest post by Tom Walker.</em></p>
<p>When surfing the web for the information we want, our attention span is incredibly short. The reason for this is that we know if the site we’re on doesn’t instantly supply us with what we’re looking for, there are plenty of other sites a few clicks away that probably will. If you are a blogger, it is essential that you compose your posts and format you blog with this reality in mind. It will make your site more effective, by encouraging your readers to stay on it longer, clicking more links. And that’s what you want, isn’t it? Here are 10 tips that will give professional appearance and trackable results to your blog posts. </p>
<p><strong>1. Start with a Short, Concise Overview of the Post:</strong> Reduce the entire direction of your post down to one sentence if possible, that says, “if this is what you’re looking for you will definitely find it here,” and then display it in bold, eye-catching print that is slightly larger than the following text.</p>
<p><strong>2. Embed Video to Capture Attention:</strong> Video is compelling. YouTube, and its incredible stream of traffic on the web, has taught us that. Blog posts with video exude greater credibility, incite interest, and connect better with a generation that is much attuned to visual presentations. Ask yourself if you’d rather watch a demonstration video on hanging a light fixture or work through detailed written instruction on how to do it. You get the point!</p>
<p><strong>3. Write Using Short Bursts and Bold Headlines:</strong> Short paragraphs with dynamic first sentences that clearly express your main points make scanning the blog post easy and enticing. If your readers quickly scan your post and like what they see, they will slow down and take a deeper look at your blog, and that’s the first action step you want them to take.</p>
<p><strong>4. Use Images and Graphics to Illustrate Copy:</strong> Comprehension happens much faster when a reader can scan an image or graph and get your point immediately rather than having to read a lengthy explanation. Online, a picture truly is worth a thousand words.</p>
<p><strong>5. Use an Economy of Words:</strong> Blogs should get right to the point of things and not include a lot of superfluous text. Readers find that a waste of time and will click away if they are not getting what they find quickly. Save lengthy stories for late in the blog, once you’ve captured attention and moved your readers in the direction you desire them to go, or simply save them for telling over dinner with friends.</p>
<p><strong>6. Use Quality Writing and Excellent Grammar:</strong> Readers hit the back button at the first sign of “Engrish” or other spelling or grammatical malfeasance. In short, they simply don’t trust the source! With some many good spelling and grammar checkers available, this is an inexcusable faux pas for bloggers.</p>
<p><strong>7. Use Slideshows to Keep Attention and Call for Action:</strong> Slide shows are great for presenting your case and inviting your readers to take an action step that is to your benefit.</p>
<p><strong>8. Leave White/Open Space on the Page:</strong> If a potential reader lands on your blog page and the immediate impression is that it is densely populated with text – images don’t have quite the same negative effect – chances are they will click away. Few of us go online to read a textbook. We left those behind and have no desire to return to them!</p>
<p><strong>9. Make Effective Use of Lists:</strong> Bullet-point lists are easy to scan and present information quickly and pointedly. </p>
<p><strong>10. Conclude with a Bang:</strong> Just like some readers skip to the end of the book to see how it concludes, some of your readers will want just the “bottom line.” The last paragraph is a great place to deliver that. Sum up what you want the reader to know and what you want them to do, and deliver it concisely, in slightly larger print. Use a juicy, bold first-bite headline that will compel them to consume the whole paragraph.</p>
<p>These simple steps can separate top bloggers from the rest of the pack. They are easy to employ and will enhance the readability of your blog, which in turn will boost your credibility and will keep your readers coming back for more! More visits, more clicks on your advertisers and links, and more success for you. It is just this easy!</p>
<p><em>This is a guest post from Tom Walker, a writer working with an online store offering <a href="http://www.cartridgesave.co.uk/toner-cartridges/Xerox.html">Phaser toner cartridges</a> and other supplies for the creative industry. You can stay up to date with his latest writing about advertising and design on <a href="http://www.cartridgesave.co.uk/news/">CreativeCloud</a>.</em></p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/DSdeMXL9wcg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/web-design/10-tips-to-make-your-blog-posts-more-readable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://fwebde.com/web-design/10-tips-to-make-your-blog-posts-more-readable/</feedburner:origLink></item>
		<item>
		<title>Build Your Site With Dynamic CSS</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/SUvXiflrR6Y/</link>
		<comments>http://fwebde.com/css/php-dynamic-css/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 08:00:38 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=2065</guid>
		<description><![CDATA[Changes to the style of the CSS of a website can be done very easily, with the magic of JavaScript. However, JavaScript can be disabled, so it should be avoided for important things.

The solution would be to use a server-side language, like PHP, to make it possible to create dynamic CSS files without having to resort to using JavaScript. Finally you can use dynamic CSS that works in all browser configurations.]]></description>
			<content:encoded><![CDATA[<p>Changes to the style of the CSS of a website can be done very easily, with the magic of JavaScript. However, JavaScript can be disabled, so it should be avoided for important things.</p>
<p>The solution would be to use a server-side language, like PHP, to make it possible to create dynamic CSS files without having to resort to using JavaScript. Finally you can use dynamic CSS that works in all browser configurations.</p>
<p>First we will take a look at how this will work, and then we will go straight into two examples. We'll put together a simple grid-based generated by certain variables, and then we will create a script to modify the CSS based on the time of day.</p>
<h3>How It Works</h3>
<p>There are two crucial parts to ensuring that your dynamic CSS file works correctly.</p>
<ul>
<li>Make sure that your dynamic CSS filename ends with a .php extension.</li>
<li>Insert the following line at the top of your CSS file, right after <code>&lt;?php</code>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'content-type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This tells the browser to use the output of the script like if it was CSS, instead of the default HTML.
</li>
</ul>
<p>For this example we will call our dynamic CSS file <strong>css.php</strong>. Let's start out with something simple. In the file referencing our dynamic stylesheet, add the following line of HTML in the <code>head</code> section, like you would do with a normal CSS file.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;css.php&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<p>Now let's get started with some simple PHP!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'content-type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$contentWidth</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">500</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$bgColour</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#C0FFEE'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$textColour</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#DECAFF'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Here we've set some variables that will hold the values for the width of our content section, the background colour, and the text colour. That's great, but how do we integrate that with our CSS?</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> &lt;?php echo $bgColor<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> &lt;?php echo $textColour<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> &lt;?php echo $contentWidth<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>As you can see, we simply <code>echo</code> out the values where we need them, appending any units if needed. Let's look at slightly more advanced example.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> &lt;?php echo $contentWidth <span style="color: #00AA00;">*</span> $contentHeight <span style="color: #00AA00;">+</span> <span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> &lt;?php echo $contentHeight<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Here you can see that we can do things such as making the width of the content box the value of $contentWidth times the height of the box plus two.</p>
<p>Now let's take a look at some more examples.</p>
<h3>Your Own Grid Layout</h3>
<p>You can use these techniques for dynamic CSS to make an easy-to-manage grid-based layout, with each column automatically resizing with the change of one value. Let's get started, shall we?</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Tell the browser that this is supposed to be CSS</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'content-type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mainWidth</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1000</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$spacing</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$mainBg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#FF0000'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sidebar1bg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#0000FF'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$contentBg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#00FF00'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sidebar2bg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#C0FFEE'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$sidebar1width</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$mainWidth</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$spacing</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color:#800080;">0.2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sidebar2width</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$mainWidth</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$spacing</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color:#800080;">0.2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$contentWidth</span>  <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$mainWidth</span> <span style="color: #339933;">-</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$spacing</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color:#800080;">0.6</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>These are the variables for a simple three-column layout. The content area takes up 60% of the width, and each sidebar 20%. The spacing in between each column is set and included in each calculation.</p>
<p>And now for the CSS part:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> &lt;?php echo $mainWidth<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> &lt;?php echo $mainBg<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
	<span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#sidebar1</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> &lt;?php echo $sidebar2width<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> &lt;?php echo $spacing<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> &lt;?php echo $sidebar1bg<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> &lt;?php echo $contentWidth<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> &lt;?php echo $spacing<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#000</span> <span style="color: #993333;">inside</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> &lt;?php echo $contentBg<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#sidebar2</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> &lt;?php echo $sidebar2width<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;</span>px<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> &lt;?php echo $sidebar1bg<span style="color: #00AA00;">;</span> ?<span style="color: #00AA00;">&gt;;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>So try that out, and try changing the values of $mainWidth and $spacing, to see what happens, and to make sure that there are no bugs.</p>
<h3>Time-Sensitive CSS</h3>
<p>And now for a completely different example? How about having different styles for different times of day? That is made easy using PHP with CSS, and with PHP's built-in date/time functions.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'content-type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">date_default_timezone_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;America/Vancouver&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$now</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'G'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$now</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$bg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#FFFFFF'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$bg</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#000000'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
body {
    background: <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$bg</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>;
}</pre></div></div>

<p>In this very simple example, we first set the default timezone. And then we use the <code>date()</code> function to return the current hour, in a 24-hour format.</p>
<p>If it is before 12:00, the background colour is set to white. If it is currently 12:00 or later in the day, a black background is displayed.</p>
<p>Couldn't get any simpler than that!</p>
<p><strong>There are so many different possible applications for dynamic CSS. Can you think of any other ways to use this?</strong></p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/SUvXiflrR6Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/css/php-dynamic-css/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://fwebde.com/css/php-dynamic-css/</feedburner:origLink></item>
		<item>
		<title>WordPress Security Guide For Beginners</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/rGBc72G1Wdo/</link>
		<comments>http://fwebde.com/wordpress/wordpress-security-guide/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 08:00:48 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=2044</guid>
		<description><![CDATA[We've all put so much work into our blogs, and I'm sure you'd hate to see all that hard work just disappear. Unfortunately, there are some people who would get rid of all that, either because they think it would be fun, or because they want to spam your site to push some terrible product that they wouldn't be able to advertise any other way.]]></description>
			<content:encoded><![CDATA[<p>We've all put so much work into our blogs, and I'm sure you'd hate to see all that hard work just disappear. Unfortunately, there are some people who would get rid of all that, either because they think it would be fun, or because they want to spam your site to push some terrible product that they wouldn't be able to advertise any other way.</p>
<p>If you're developing your own non-WordPress site, you might want to take a look at an older post here at FWebDe called <a href="http://fwebde.com/programming/hack-your-own-site/">Hack Your Own Site</a>, which will teach you how to test certain exploits on your site, and how to fix them.</p>
<h3>Protect Your Database Login Details</h3>
<p>If an attacker gets the login details to access to your WordPress database, they can add, delete or modify anything they want.</p>
<p>How will they get that information? Probably through the file that contains it, the wp-config.php file. If for any reason PHP fails on your server and someone accesses wp-config.php, the entire contents of the file will be displayed, including your MySQL database login details.</p>
<p>Fortunately, WordPress allows you to move your wp-config.php one directory level above your WordPress install directory. So if you have WordPress installed at the root of your website, you can move your wp-config.php outside of public_html, where it cannot be accessed by anyone.</p>
<h3>Get Your File Permissions Right</h3>
<p>I'm not going to get into a huge explanation of how file permissions work, but it is pretty much to say who is allowed to access certain files, and what they can do with them.</p>
<p>Generally, you want all of your directories' permissions set to 755. Permissions for files should be set to 644. If you want to edit certain files with the WordPress theme editor, set those to 666. You should <strong>avoid using 777</strong> because that gives access to read, write and execute the file, which means that anyone can do whatever they want with them.</p>
<h3>Disable New User Registration</h3>
<p>Unless you are building a large community site, you should make sure that visitors cannot create their own accounts at your WordPress blog. The WordPress user registration system has been exploited before, with an attacker registering at your blog, exploiting a vulnerability to elevate their role to "Administrator", while using some JavaScript in your WordPress administration area to hide the fact that that user even exists.</p>
<p>Preventing this is simple. From your WordPress dashboard, click on "settings". Make sure that "Anyone can register" is left unchecked.</p>
<h3>Prevent the Public From Browsing Your Directories</h3>
<p>You know how if you browse to a directory without an index.html (or similar) file, you'll see a list of all the files contained in that directory? Well, an attacker could browse through your directories, and get a lot of information. For example, they could find out what plugins you have installed, and exploit any vulnerabilities in those plugins.</p>
<p>Fixing this vulnerability is quite simple, actually. Simply insert a blank index.html file into your wp-content/plugins directory, and any other directory you want to protect the public from accessing.</p>
<h3>Do Not Use the Default Admin Account</h3>
<p>You probably know that by default, when you install WordPress, the default administrator's username is "admin". This gives an advantage to attackers because they will already know your username, and will only need to find out your password.</p>
<p>You can fix this vulnerability by going to the "Users" section of your WordPress admin and creating a new user for yourself. Make sure you set your role to "Administrator". Log out of WordPress and log back in with your new username. Now you can simply delete the previous default admin account. If you already have posts written, you can choose to attribute all posts to your new user.</p>
<h3>Update WordPress Regularly</h3>
<p>WordPress developers are working constantly to improve the security of the blogging platform, and the latest security updates will always be in the newest release. Security vulnerabilities are often found in older versions of WordPress, and if you don't upgrade to a newer version of WordPress that has been secured, that vulnerability will probably be exploited on your blog. </p>
<h3>Use a Strong Password</h3>
<p>I'm sure you've heard this many times before, but it is <em>crucial</em> to have a strong password, that cannot simply be guessed by somebody trying to access your site. You may already know this, so I'll keep it short:</p>
<p>Have a long password mixed types of characters (letters, numbers, symbols, etc.), but that is still memorable by you and by you only. Don't make it anything that an attacker could find about you with a quick Google search, such as your phone number or your date of birth.</p>
<p>And finally, if you can't seem to remember your password, do not write it down or store it in a plain text file called passwords.txt. Instead, use an encrypted password manager such as <a href="http://keepass.info/">KeePass</a>, or <a href="http://www.keepassx.org/">KeePassX</a>.</p>
<h3>Make Backups Frequently</h3>
<p>Okay, none of the security tips listed above are 100% foolproof, and someone determined to crack into your site will eventually find a way to get in. So if or when that happens, you need to be prepared for that situation.</p>
<p>If you care about the content on your site, you should make sure that you make backups often. That way if your site is compromised, you can return back to normal with minimal loss of content. Another advantage of keeping backups is that after your site is compromised, you can look over a previous version to determine how they got in, and how you can prevent that from happening again.</p>
<p>Make sure that you backup the files and the database of your WordPress installation, and always keep multiple copies in separate places. An excellent <a href="http://codex.wordpress.org/Backing_Up_Your_Database">guide to backing up your WordPress database</a> can be found at the WordPress Codex.</p>
<p>So do you follow any of these security practices? Do you have any other good WordPress security tips that you'd like to share? And do you feel like you backup your WordPress installation as often as you preobably should?</p>
<p>Be sure to leave your answers in the comments.</p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/rGBc72G1Wdo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/wordpress/wordpress-security-guide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://fwebde.com/wordpress/wordpress-security-guide/</feedburner:origLink></item>
		<item>
		<title>A Look At Ubuntu's Redesign and Rebranding</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/66W-fe3oBgo/</link>
		<comments>http://fwebde.com/uncategorized/ubuntu-redesign/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 08:09:54 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=1995</guid>
		<description><![CDATA[One very common complaint from new users to Ubuntu is the ugly brown default theme. It seems to give them a bad first impression of the operating system, based on how it looks at first. But now they've come up with a completely new design, which makes the brown look like a beautiful photo of autumn foliage.]]></description>
			<content:encoded><![CDATA[<p>If you haven't heard about <a href="http://ubuntu.com">Ubuntu</a>, it is an excellent free and open source operating system based on the Linux kernel. It is a very good alternative to Windows and Mac OS X, and is increasing in popularity. Ubuntu uses the <a href="http://gnome.org/">GNOME</a> desktop environment, and is known for its orange and brown default "Human" theme. </p>
<p>One very common complaint from new users to Ubuntu is the ugly brown default theme. It seems to give them a bad first impression of the operating system, based on how it looks at first. But now they've come up with <a href="https://wiki.ubuntu.com/Brand">a completely new design</a>, which makes the brown look like a beautiful photo of autumn foliage.</p>
<p>Okay, I shouldn't be so harsh, as it is really not bad at all. In fact I think it's quite nice, and might just need a bit of customization and some time to get used to it to have a truly superb theme.</p>
<p>Let's start out with a screenshot, to get an idea of what we're dealing with.</p>
<p><a href="https://wiki.ubuntu.com/Brand#New%20GtkThemes" target="_blank"><img src="http://fwebde.com/wp-content/uploads/2010/03/darktheme-660.png" alt="" title="Screenshot of the Ubuntu rebranding" width="660" height="495" class="alignleft size-full wp-image-2014" /></a></p>
<p>There is also a lighter version of this theme, which you'll find a screenshot for on <a href="https://wiki.ubuntu.com/Brand#New%20GtkThemes">the Ubuntu Wiki page</a>. I personally prefer the darker theme, and will focus on that one for today. Not that it matters, though.</p>
<h3>First Impressions</h3>
<p>At a first glance, the first thing that I notice is how the overall design has some noticeable influence from Mac OS X. The default wallpaper somewhat resembles the Mac Aurora Borealis wallpaper, the icons on the top panel look almost exactly like the OS X ones. And I think you can tell what the placement of the window buttons looks like.</p>
<p>Overall, the look and style of this is not bad. Here are some general things that I noticed when I first saw the theme.</p>
<h4>Colours</h4>
<p>I think that the new colour scheme of Ubuntu is a great improvement of the old one, with the lighter brown and nice purple instead of the old, ugly brown and orange.</p>
<p>I really prefer the lighter brown used in this version over the darker browns used in previous default themes for Ubuntu. It gives sort of a "dust" look for the windows, </p>
<p>If I were to change one thing about the colours of this new design for Ubuntu, it would be to make the purple in the default wallpaper a bit more subtle. Right now the purple is a bit overwhelming, and might take some time to get used to. Of course, I, and most people, would probably change to a different wallpaper soon after installing Ubuntu.</p>
<h4>Position of Window Buttons</h4>
<p><img src="http://fwebde.com/wp-content/uploads/2010/03/windowbuttons.png" alt="" title="Window Buttons" width="250" height="120" class="alignright size-full wp-image-2028" /></p>
<p>Probably the biggest change in the redesign of Ubuntu is the placement of the window buttons. Previously they were on the right side of the window and, as you can see, they have now been moved to the left.</p>
<p>Here's the strange part: The buttons are on the left side of the title bar, but they are still in the same order as the previous default theme. The order of the buttons is the same as in Windows, but they are on the same side of the window as in Mac OS X.</p>
<p>Maybe it's just to be fair, so that new users coming from both operating systems will both have a little surprise.</p>
<h4>Tooltips</h4>
<p><img src="http://fwebde.com/wp-content/uploads/2010/03/tooltip.png" alt="" title="tooltip" width="250" height="120" class="alignright size-full wp-image-2026" /></p>
<p>A truly fantastic little detail that is often overlooked in the design of most operating systems is the way that tooltips are styled. They are often quite boring, mainly because they are only ever seen by the user when they are hovering over an object that has a tooltip. After all, <a href="http://fwebde.com/web-design/add-extra-detail-design/">design is really in the details</a>.</p>
<p>The tooltip in this design shows good use of transparency, rounded corners, and a nice border, to top it all off. It is the little details like these that make a design really stand out from the rest. I just hope that all tooltips will look like this, and not only the ones for the "Places" menu.</p>
<h3>The Idea of "Light"</h3>
<p>One of the aims of the new design is to give the idea of lightness. It is "lightware" which is meant to be the opposite of bloated software, and it is trying to be reflected in the design of the operating system.</p>
<p>From the <cite><a href="https://wiki.ubuntu.com/Brand">Ubuntu Wiki</a></cite>:</p>
<blockquote><p>We're drawn to Light because it denotes both warmth and clarity, and intrigued by the idea that "light" is a good value in software. Good software is "light" in the sense that it uses your resources efficiently, runs quickly, and can easily be reshaped as needed. Ubuntu represents a break with the bloatware of proprietary operating systems and an opportunity to delight to those who use computers for work and play. More and more of our communications are powered by light, and in future, our processing power will depend on our ability to work with light, too.</p></blockquote>
<h3>The New Logo</h3>
<p>Not only is the default theme of Ubuntu updated with a new look, so is the Ubuntu logo. It seems that just about everything related to Ubuntu is being rebranded.</p>
<p><a href="https://wiki.ubuntu.com/Brand#Logos" target="_blank"><img src="http://fwebde.com/wp-content/uploads/2010/03/blackeubuntulogo.png" alt="" title="New Ubuntu logo" width="600" height="158" class="aligncenter size-full wp-image-2035" /></a></p>
<p>The logo redesign is supposed to reflect the precision and engineering of Ubuntu. It is great to see that the "circle of friends" part of the logo hasn't been removed, as I have always thought that it looked very nice, and conveyed the meaning of Ubuntu and open source software very well.</p>
<h3>Is It Really That Important?</h3>
<p>The rebranding of Ubuntu has included many changes in the look of the operating system. Without worrying about whether the changes are good are bad, are they really necessary?</p>
<p>On one hand, the user's first impression of the brand of Ubuntu can be very important. The first thing that the user sees when booting up their system can really be the deciding factor in whether they like it or not, and can have a big effect on the overall experience of Ubuntu.</p>
<p>On the other hand, the effort and resources involved in this change of branding could be better spent in other areas. For example, many users have complained about hardware compatibility issues. The time and effort put into a rebranding might be better placed into improving hardware compatibility, improving performance, fixing bugs, and just generally improving other aspects of Ubuntu.</p>
<p>Also, many users will know that it is not the look of the operating system that matters, but everything that is going on underneath. Most users will also probably change to a custom theme anyway, to personalize the look of their computer.</p>
<h3>Conclusion</h3>
<p>Overall, I think that this redesign is a huge step for Ubuntu, but in the wrong direction. However, people's opinions differ greatly. You'll find that <a href="http://news.slashdot.org/story/10/03/03/2313234/Ubuntu-Gets-a-New-Visual-Identity">the opinion of the people at Slashdot</a> to be very different <a href="http://ubuntuforums.org/showthread.php?t=1420839">from that of the Ubuntu Forums</a>.</p>
<p>What do you think of the new design? Do you love it, or do you hate it? Would this alone put you off of installing Ubuntu? And if not, would you changing the theme be the first thing that you would do?</p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/66W-fe3oBgo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/uncategorized/ubuntu-redesign/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://fwebde.com/uncategorized/ubuntu-redesign/</feedburner:origLink></item>
		<item>
		<title>An Introduction to SVG</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/jWgF0D_sTB4/</link>
		<comments>http://fwebde.com/web-design/an-introduction-to-svg/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 08:00:34 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=1965</guid>
		<description><![CDATA[<strong>Scalable Vector Graphics</strong>, or SVG, is a standard for a type of XML used to describe an image. There is an infinite number of possibilities with this, allowing you to create just about any image with it.

The image you see on the left was created using SVG. It is normally 93x93px in size, but it is scaled up to 150x150px, without the image quality suffering.]]></description>
			<content:encoded><![CDATA[<p><strong>Scalable Vector Graphics</strong>, or SVG, is a standard for a type of XML used to describe an image. Of course, there is an infinite number of possibilities with this, allowing you to create just about any image with it.</p>
<p>SVG is a vector graphics format, which means that instead of images being created with individual pixels as in raster graphics (PNG, JPEG, etc.), the images are made up of individual shapes and lines, put together to make the complete image.</p>
<h3>Why Use SVG?</h3>
<p>Why is SVG so great? Here are a few of the advantages of using Scalable Vector Graphics.</p>
<ul>
<li>SVG images can be resized infinitely without loss of quality.</li>
<li>SVG files can be read (and written) using many different tools, from advanced vector graphics editors to simple text editors.</li>
<li>SVG can be styled with CSS, allowing easy changes to an image.</li>
<li>You can use scripts to modify SVG images in the browser, to create dynamic and interactive applications.</li>
<li>SVG is an open standard. That means that you can create your own application using it, without having to pay any licensing fees.</li>
</ul>
<p>The only disadvantage I see with SVG is the lack of support in Internet Explorer. But we won't worry about that for today, we'll just look at the great things that SVG can do!</p>
<h3>How Can I Use SVG?</h3>
<p>Probably the easiest way to create awesome SVG graphics is using a vector graphics editor. I personally like <a href="http://www.inkscape.org/">Inkscape</a>.</p>
<p>Another way to get started with SVG is to try hand-coding it. The syntax is based on XML, so if you know HTML, it won't be that hard to figure it out. Let's take a look at a very simple example.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE svg PUBLIC &quot;-//W3C//DTD SVG 1.1//EN&quot; &quot;http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd&quot;&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;svg</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;100%&quot;</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.1&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2000/svg&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;rect</span> <span style="color: #000066;">width</span>=<span style="color: #ff0000;">&quot;300&quot;</span> <span style="color: #000066;">height</span>=<span style="color: #ff0000;">&quot;250&quot;</span> <span style="color: #000066;">x</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">y</span>=<span style="color: #ff0000;">&quot;20&quot;</span> <span style="color: #000066;">fill</span>=<span style="color: #ff0000;">&quot;#FF0000&quot;</span> <span style="color: #000066;">stroke-width</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">stroke</span>=<span style="color: #ff0000;">&quot;#000&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/svg<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>At the top, you'll see a document type declaration, like what you would find in an HTML file. This is to tell the browser that this is displaying SVG.</p>
<p>Next there's the <code>svg</code> opening tag. Just like the <code>html</code> tag in HTML files, the <code>svg</code> tag tells the browser where the SVG code starts and ends. You can see that this tag is closed at the end.</p>
<p>In the middle there, you can see an element called <code>rect</code>. This is the element used to draw a rectangle. You can see that it, like elements in HTML, can take various attributes.</p>
<ul>
<li><code>width</code>, <code>height</code>: The size of the rectangle</li>
<li><code>x</code>, <code>y</code>: The position of the rectangle</li>
<li><code>fill</code>: The colour of the rectangle.</li>
<li><code>stroke-width</code>: The width of the rectangle's border, or stroke</li>
<li><code>stroke</code>: The colour of the rectangle's border or stroke</li>
</ul>
<p>The above code, viewed in a <em>good</em> web browser (I used Firefox), should display something like this:</p>
<p><img src="http://fwebde.com/wp-content/uploads/2010/02/red-rect.png" alt="" title="SVG Rectangle" width="312" height="263" class="alignleft size-full wp-image-1991" /></p>
<p>I'm sure that you can image the many possibilities with SVG, and the way that even complex images can be created using only your keyboard. This has endless possibilities, such as using a server side language, such as PHP, to generate images on-the-fly, for viewing by your users!<br />
9<br />
Because SVG is a standard for XML set by the W3C, you can even <a href="http://validator.w3.org/">validate your code</a> to make sure that you did everything right. Just use the <a href="http://validator.w3.org/">W3C Validator</a>, and the SVG document type declaration will let them know how to validate your code.</p>
<div class="clearing"></div>
<p>So you can run the code in the example above in the <a href="http://validator.w3.org/">W3C Validator</a>, and as you can see, it validates with no errors! From that example, you can see, to code in valid SVG, because it is based on XML, you just need to follow similar guidelines for marking up XHTML files.</p>
<h3>Conclusion</h3>
<p>SVG is a truly fantastic XML standard for creating images. You can check out various <a href="http://tutorials.jenkov.com/svg/index.html">SVG tutorials</a> on the internet, and try out different techniques to see what you can come up with!</p>
<p>Do you ever use SVG for creating graphics? Or do you have any ideas of where or how SVG can be implemented? I'd love to hear, so be sure to leave a comment on this post.</p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/jWgF0D_sTB4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/web-design/an-introduction-to-svg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://fwebde.com/web-design/an-introduction-to-svg/</feedburner:origLink></item>
		<item>
		<title>Minimalism or Laziness?</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/RCwodlYBxjM/</link>
		<comments>http://fwebde.com/web-design/minimalism-or-laziness/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 08:03:51 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=1674</guid>
		<description><![CDATA[If you've been around web design for at least a day, you'll notice that there are tons of "minimalist" designs out there. They've been around for years, yet they are still growing in popularity. In fact, minimalism is supposed to be <a href="http://webdesignledger.com/tips/web-design-trends-for-2010">a web design trend for 2010</a>.

What is the reason for the "minimalist" style's popularity? It's easy. Anyone can slap together a quick design and call it "minimalist". It could technically still be called minimalism, but it's worthless if it's not done right.]]></description>
			<content:encoded><![CDATA[<p>If you've been around web design for at least a day, you'll notice that there are tons of "minimalist" designs out there. They've been around for years, yet they are still growing in popularity. In fact, minimalism is supposed to be <a href="http://webdesignledger.com/tips/web-design-trends-for-2010">a web design trend for 2010</a>.</p>
<p>What is the reason for the "minimalist" style's popularity? It's easy. Anyone can slap together a quick design and call it "minimalist". It could technically still be called minimalism, but it's worthless if it's not done right.</p>
<h3>It's Not Memorable</h3>
<p>Let's get this out of the way first. It's almost impossible to brand a minimalist website. Extremely simple user interfaces have already been taken by Apple. They've established themselves as <em>the</em> company with the minimalist designs. And nobody's going to take that from them.</p>
<p>And because minimalism is so simple, there are much fewer possibilities than with other styles. Of course, the <em>good</em> minimalist designs will have some way of standing out from the crowd, but most of them look <em>exactly the same</em>.</p>
<p><strong>Minimalism means removing the unnecessary elements of a design, but it's those unnecessary elements that set one design apart from another.</strong></p>
<p>The best minimalist designs are for websites <a href="http://fwebde.com/web-design/remove-extra-bloat-new-year/">that do one thing and that do it well</a>. Let's use Google as an example. Back when it did only one thing, it was, and still is, a simple search box on the page. The design only worked because searching was the only thing anyone ever used the site for.</p>
<h3>It Won't Work For Everything</h3>
<p>The one place on the internet where you see minimalism the most is in designers' portfolios. Minimalist designs are most appreciated by creative types. They're usually building their own websites for themselves, so they can make it look the way <em>they</em> like it.</p>
<p>That designer probably wouldn't use minimalism in the design for, say a site that sells games for ages 5 to 10. They would always need to consider the audience of the website, and build it around that specific audience. </p>
<h3>Minimalism Applied to Blogs</h3>
<p>Take a look at <a href="http://wordpress.org/extend/themes/">the WordPress themes directory</a>, and notice how many minimalist designs there are. Not only are there tons of them, but they all look about the same. Because they still follow the standard blog layout, there isn't much room for difference. And a blog with an unusual layout is (usually) not too good for usability.</p>
<p>I think we can all agree that readability is an important part of blog design. A common tip to improve readability is to add whitespace to the page. That's when people take it a bit too far. They see the "white" in whitespace, and associate that colour with minimalism. </p>
<h3>Make Minimalism Good Again</h3>
<p>Don't get me wrong, I think that minimalism can look nice, if it's done well. Minimalist websites don't all have to conform to certain standards that end up making every website look exactly the same.</p>
<p>Don't just throw together a bunch of divs with black text on a white background. Try out some different colours and see what you like. Try including a nice image, to draw the reader's attention. The important thing is to <em>be creative</em> with it, and </p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/RCwodlYBxjM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/web-design/minimalism-or-laziness/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://fwebde.com/web-design/minimalism-or-laziness/</feedburner:origLink></item>
		<item>
		<title>Why Apple's Website Design Is So Influential</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/YY3a2i1LkgA/</link>
		<comments>http://fwebde.com/web-design/apple-website-design/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 20:25:16 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=1890</guid>
		<description><![CDATA[Apple has always been recognized for their products' beautiful designs, and even for the design of their website, <a href="http://apple.com/">Apple.com</a>. Take a look around the web, and you'll notice tons of sites that are inspired from Apple's design. In fact, I don't even have to list them, <a href="http://www.webdesignerdepot.com/2009/02/22-website-designs-inspired-by-applecom/">as others have already done that</a>.

But what exactly makes this such a great design? Let's find out!]]></description>
			<content:encoded><![CDATA[<p>Apple has always been recognized for their products' beautiful designs, and even for the design of their website, <a href="http://apple.com/">Apple.com</a>. Take a look around the web, and you'll notice tons of sites that are inspired from Apple's design. In fact, I don't even have to list them, <a href="http://www.webdesignerdepot.com/2009/02/22-website-designs-inspired-by-applecom/">as others have already done that</a>.</p>
<p>But what exactly makes this such a great design? Let's find out!</p>
<h3 class="clearing">It's Simple</h3>
<p>A feature of the design of all of their products is the extreme simplicity. It's part of their branding. Because it's part of their branding, it applies to their website as well.</p>
<p><a href="http://www.apple.com/"><img src="http://fwebde.com/wp-content/uploads/2010/02/apple_home.png" alt="" title="apple_home" width="660" height="527" class="alignnone size-full wp-image-1927" /></a></p>
<p>When you first get to the home page, you see that it really has the bare minimum. There is a main navigation bar, and below that is a giant picture of the iPad. If you scroll down, you'll find a bit of information about some of their other products. But to avoid cluttering up the home page, you'll have to click through to those products' individual sections of the site.</p>
<p>They don't even have a huge logo on their site. The only logo is the little icon in the navigation bar. However, it is still in a consistent location, the top left section of the page <em>and</em> at the beginning of the navigation bar, so users will know that clicking it will take them back to the home page.</p>
<h3>It's Well Organized</h3>
<p>At Apple.com, everything is nice and organized, with everything where you expect it to be. If you're looking for information about a specific product, you'll be able to get to it from their main navigation bar, at the top of the site.</p>
<p>Once you venture one level deeper into the site, you'll find another menu near the top, to narrow down what products you're looking for information on even more. On every page, you'll find the most important information at the top. If you want the less important details, simply scroll down and you'll find them.</p>
<p><a href="http://www.apple.com/mac/"><img src="http://fwebde.com/wp-content/uploads/2010/02/apple_mbp.png" alt="Grid on Apple&#039;s Mac page" title="Grid on Apple&#039;s Mac page" width="660" height="211" class="alignnone size-full wp-image-1929" /></a></p>
<p>One thing I like about how it's organized is the way that a grid is used. Sections that are less important can have up to five narrow columns, while the important stuff that they want you to pay attention to can take up three or even all five columns.</p>
<h3>It's Interactive</h3>
<p>Not only is it interactive, it's actually done well. In my opinion, it is best for all interactivity to be done subtly. For example, having some small change in an element on the page to let the user know that if they click it, something will happen.</p>
<p>The way interactivity is done on this website can really help usability. The navigation menu changes when hovered over, like how most websites do it, and that's what the user can expect.</p>
<p>But Apple has gone a step further, having the background image change again to a special active state when the user click on one of the links. Most website do not do this, and this really a simple thing that most websites could do to add those extra details that really count.</p>
<p>And that leads me on to my next point&#8230;</p>
<h3>Extreme Attention to Detail</h3>
<p><img src="http://fwebde.com/wp-content/uploads/2010/02/apple_button.png" alt="" title="apple_button" width="100" height="100" class="alignleft size-full wp-image-1931" /></p>
<p>The details can make or break a design. In web design, it is important to <a href="http://fwebde.com/web-design/add-extra-detail-design/">pay attention to the little details</a>.</p>
<p>One example of the excellent attention to detail is this little button. At first, it just looks like a little button telling you to buy a MacBook Pro. But upon closer inspection, you can see all of the details that were put into such a simple button.</p>
<p>Most noticeable is the gradient background, giving a sense of depth. Another detail is a thin border around the button, with a subtle drop shadow. Another nice detail is the hover effect, and the active state of the button when clicked.</p>
<h3>It's Consistent</h3>
<p>One thing that I love about Apple.com is the way that every page is consistent with the rest of the site. </p>
<p>Many times I go to some company's website (<em>*cough* <a href="http://asus.com/">Asus</a> *cough*</em>), and I'm greeted with a page with information to get me to buy their latest product. And then I head over to the "store" section of the site to buy it, to find a page that is completely different from the rest of the site, with entirely different colours and layout. Later, when I have a problem with the product I bought, I check out the "support" section of their site, and end up having to learn a new way to navigate through this part of the site.</p>
<p>But not with Apple. If I want to buy a laptop from them, I can simply go to the appropriate section of the site and easily figure out how to navigate it, based on my experience with the rest of the site. And then when I have a question, I can take a look at the "support" section of the site, and quickly figure out how to get support for my laptop.</p>
<h3>What Could Be Improved</h3>
<p>While the design of Apple's website is very well done overall, there are always a few little things that could be improved.</p>
<ul>
<li>
<p>All of the videos on the site are in Apple's QuickTime. That's a problem for me, because it doesn't seem to be officially available for Linux. Maybe it's just a secret plan to make everyone buy their software. But QuickTime <em>is</em> available for Windows, so&#8230;</p>
</li>
<li>
<p>Move the breadcrumb navigation closer to the top of the page. Users looking to go one or more levels up in the site would find this helpful, but right now it's hidden down in the footer. Users looking for a breadcrumb trail will expect it to be in an area that is "above the fold", like it is on just about every other website.</p>
</li>
</ul>
<p>That's really all that I noticed. But I'm sure I could find a couple more, if I was being <em>very</em> picky.</p>
<h3>Conclusion</h3>
<p>Apple really has a near-perfect website design, with just a couple of minor problems that could be improved.</p>
<p>What do you think of the design of Apple's website? Do you love it, or do you think the style is overused? Be sure to leave your answer in the comments section of this post.</p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/YY3a2i1LkgA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/web-design/apple-website-design/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://fwebde.com/web-design/apple-website-design/</feedburner:origLink></item>
		<item>
		<title>5 Ways to Add a Bit of Extra Detail to Your Web Design</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/DJB0SCPaApE/</link>
		<comments>http://fwebde.com/web-design/add-extra-detail-design/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 08:02:47 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=1021</guid>
		<description><![CDATA[Whenever you're designing a website, it's generally a good idea to pay some attention to small details. Details can make the difference to a flat, boring, lifeless website, and a nice, usable, fun website.

Here are a few things to remember when working on the details of your site. If you follow some of these general guidelines, it can really help to improve a website to make it stand out a bit.]]></description>
			<content:encoded><![CDATA[<p>Whenever you're designing a website, it's generally a good idea to pay some attention to small details. Details can make the difference to a flat, boring, lifeless website, and a nice, usable, fun website.</p>
<p>Here are a few things to remember when working on the details of your site. If you follow some of these general guidelines, it can really help to improve a website to make it stand out a bit.</p>
<h3 class="clearing">Whitespace</h3>
<p>Making effective use of whitespace is a great way to improve on a website design. Basically, you can improve your whitespace simply by adding more space around important elements of a page, to give them more "room to breathe".</p>
<p>For more information about using whitespace in web design, you can check out a previous post at FWebDe: <a href="http://fwebde.com/web-design/using-whitespace-for-a-better-design/">Using Whitespace For a Better Design</a>.</p>
<h3>Visual Hierarchy</h3>
<p>Visual hierarchy in web design is something to consider when creating a new website design. The visual hierarchy should give visual cues to the user so that they can tell what is most important.</p>
<p>A common way of applying visual hierarchy in web design is by using the heading tags, <code>&lt;h1&gt;</code> through <code>&lt;h6&gt;</code>. This applies a visual hierarchy by separating sections of content by different font sizes.</p>
<p>Other ways of working with visual hierarchy include:</p>
<ul>
<li>Colour</li>
<li>Whitespace</li>
<li>Position</li>
<li>Shape</li>
</ul>
<h3>Borders</h3>
<p>To ensure a definite separation of completely separate elements on a page, borders can easily help to achieve this. They are very effective, and they usually just work perfectly.</p>
<p>But you don't need a thick border in between everything. It might be best to use subtle borders to separate key sections of a page.</p>
<h3>Dimension</h3>
<p>Adding some dimension to a page can take a flat, boring design and make it "pop out". Adding some 3D elements to a page can be a fun way to add details to a design.</p>
<p>Some examples of uses of dimension can be use of subtle gradients, shadows, layered elements, and much more. Try out everything you can think of, and use what you think looks best.</p>
<h3>Typography</h3>
<p>Typography is a very important aspect of web design, with many little details to focus on. These details greatly affect the readability of the content, and the overall look of the design.</p>
<p>To improve your web site typography:</p>
<ul>
<li>Choose the most readable font for your site.</li>
<li>Add appropriate line spacing (<code>line-height</code>).</li>
<li>Make sure the font size is readable.</li>
<li>Ensure some spacing in between paragraphs.</li>
</ul>
<p>There are many more typography-related details that I could add to that list, but those are four that you need to remember, and if you apply those, you can greatly improve your site's design.</p>
<p><strong>Do you use any of these tips to add more detail to your design? What tips would you recommend to add more detail to your website design?</strong></p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/DJB0SCPaApE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/web-design/add-extra-detail-design/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://fwebde.com/web-design/add-extra-detail-design/</feedburner:origLink></item>
		<item>
		<title>Easily Insert Google Analytics Into WordPress</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/CefWdD8HxX4/</link>
		<comments>http://fwebde.com/wordpress/wordpress-google-analytics/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 08:00:40 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=1860</guid>
		<description><![CDATA[Google Analytics is a great tool for checking and analyzing website traffic. But at times it can be a pain to go through your theme, and find just the right place to put the tracking code. There are plugins that can do this, but they aren't really necessary to do this. Thanks to the magic of WordPress hooks, you don't need to worry!]]></description>
			<content:encoded><![CDATA[<p>Google Analytics is a great tool for checking and analyzing website traffic. But at times it can be a pain to go through your theme, and find just the right place to put the tracking code. There are plugins that can do this, but they aren't really necessary to do this. Thanks to the magic of WordPress hooks, you don't need to worry!</p>
<p>First, in your theme's folder, find a file called <strong>functions.php</strong>. If it's not already there, create it.</p>
<p>Insert the following code into the file. It doesn't really matter where, but around the end is generally a good idea.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_footer'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'analytics'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> analytics<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
Your Google Analytics tracking code
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Be sure to insert your own Google Analytics tracking code in there. This will add your tracking code into the footer of your WordPress blog.</p>
<p>This calls the <code>add_action</code> function, which is used to add a function to a hook. It is used by plugins and themes to easily modify certain parts in WordPress. Here we are using the <strong>wp_footer</strong> hook. The function we are using is called <strong>analytics</strong>.</p>
<p>Next we actually create the analytics function. It basically just displays what is on the line. Since it is called with the wp_footer hook, the text there (your tracking code) will be displayed in the footer of your site.</p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/CefWdD8HxX4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/wordpress/wordpress-google-analytics/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://fwebde.com/wordpress/wordpress-google-analytics/</feedburner:origLink></item>
		<item>
		<title>9 CSS Best Practices You Need to Know</title>
		<link>http://feedproxy.google.com/~r/Fwebde/~3/B8gCkxOQDnw/</link>
		<comments>http://fwebde.com/css/css-best-practices/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 08:01:57 +0000</pubDate>
		<dc:creator>Eric Bannatyne</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://fwebde.com/?p=1221</guid>
		<description><![CDATA[With just about everything, there are certain best practices that everyone should follow. With CSS, these are some rules that both beginners and experts need to consider, to style your website designs the right way.]]></description>
			<content:encoded><![CDATA[<p>With just about everything, there are certain best practices that everyone should follow. With CSS, these are some rules that both beginners and experts need to consider, to style your website designs the right way.</p>
<p>So whether you're a beginner or an expert, these are some tips that everyone will find useful.</p>
<h3 class="clearing">Structure and Content First, Then Presentation</h3>
<p>The first thing that everyone should know when learning about web development is to separate content from presentation. This means that you should create your HTML first, with the structure and content, and then worry about the CSS later.</p>
<h4>Why?</h4>
<p>The structure of the HTML is the main foundation under the CSS. It should contain all of the information about the content and the underlying structure of the page. That is in contrast to CSS, which should only be used to describe how things should <em>look</em>.</p>
<p>This is important for users that can't see CSS. For example, non-CSS browsers (Dillo), text-based browsers, screen readers, search engine spiders, and much, <em>much</em> more.</p>
<h3>Use an External Stylesheet</h3>
<p>Using an external stylesheet is when you have all of your CSS in an external file, and have it included in your HTML. This is probably the best way to be sure to keep content and presentation separate.</p>
<h4>Advantages to using an external stylesheet</h4>
<ul>
<li>It helps to separate content from presentation.</li>
<li>External stylesheets can be cached, allowing faster page loading times.</li>
<li>A single stylesheet can be applied to every page of a site, allowing quick style changes to a single file.</li>
<li>It makes organization much easier.</li>
</ul>
<h4>To use an external stylesheet</h4>
<p>To use an external stylesheet, simply place the following code in between your <code>head</code> tags. Be sure to replace style.css with your CSS file.</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">link</span> <span style="color: #000066;">rel</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;stylesheet&quot;</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;style.css&quot;</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/css&quot;</span> <span style="color: #000066;">media</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;screen&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></pre></div></div>

<h3>Avoid Using Inline Styles</h3>
<p>By inline styles, I mean the <code>style</code> attribute in the HTML tags. You should avoid using it because it mixes up content and presentation, which can lead to more trouble.</p>
<p>Using inline styles is really almost as bad as using purely presentation HTML elements such as <code>font</code>. It leads to messy code where each HTML file will need to be updated in the event of a style change, instead of a global change in a single external stylesheet.</p>
<h4>Bad:</h4>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;background:red;&quot;</span>&gt;</span>
Ipsum schmipsum
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<h4>Good:</h4>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.infobox</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">red</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;infobox&quot;</span>&gt;</span>
Ipsum schmipsum
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<h3>Organize Your CSS Files</h3>
<p>If you spend a couple of extra minutes <a href="http://fwebde.com/css/tips-for-organizing-css-files/">keeping your code organized</a> now, I guarantee you'll save a lot more time later, when you have to edit your <a href="http://fwebde.com/programming/write-unreadable-code/">completely unreadable code</a>.</p>
<p>It's not that hard either. A couple of quick steps to keep your selectors and properties organized will bring in tons of benefits.</p>
<h4>Bad:</h4>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.test</span> <span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFCCCC</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#7C2DFF</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#FFF42D</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span></pre></div></div>

<h4>Good:</h4>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.test</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFCCCC</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span> <span style="color: #993333;">dotted</span> <span style="color: #cc00cc;">#7C2DFF</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#FFF42D</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>For more information about organizing CSS files, check out this post: <a href="http://fwebde.com/css/tips-for-organizing-css-files/">Tips For Organizing Your CSS Files</a>.</p>
<h3>Use a Reset Stylesheet</h3>
<p>For some reason, the developers of various web browsers just can't seem to agree on a standard way to render each element by default. How can web developers solve this problem? By use a <strong>reset stylesheet</strong>!</p>
<p>A reset stylesheet is basically just added to the top of your CSS, to start out by setting every element to have certain styles. And then you just set your own styles individually as you go through the rest of your CSS.</p>
<p>There are many different pre-made CSS reset stylesheets ready for you to use. I prefer the <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">Eric Meyer Reset</a>.</p>
<h3>Compress When You're Finished</h3>
<p>Once you're finished writing your CSS code, and everything works perfectly, then you need to minify your CSS by removing all the extra whitespace, such as tabs, spaces and newlines. This can greatly reduce your CSS file size, helping to speed up page loading times.</p>
<p>During this process, you should also merge all of your CSS files into a single stylesheet file. This helps to speed up page loading time by reducing the number of HTTP requests needed to load a page.</p>
<p>There are also some tools, such as the <a href="http://www.cssdrive.com/index.php/main/csscompressor/">CSS Drive CSS Compressor</a>, which can help to strip out the unnecessary whitespace for you. It also has several options to determine how much whitespace to remove, whether to remove comments, etc.</p>
<h3>Use Shorthand CSS</h3>
<p>Imagine having to write the following code, if you want to have a different margin for each side of a <code>div</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">24px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>That would take a lot of time every time you want to have something like that applied to a box, right? Thanks to the magic of <strong>shorthand CSS</strong>, that code can be condensed into a single line.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">10px</span> <span style="color: #933;">24px</span> <span style="color: #933;">12px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span></pre></div></div>

<p>Now, that's much quicker to right! Just remember: The order of the sides goes clockwise, from the top. So it's top, right, bottom, left.</p>
<p>For more on using shorthand CSS, check out <a href="http://webtint.net/tutorials/everything-you-need-to-know-about-shorthand-css/">this awesome article at <cite>Webtint</cite></a>.</p>
<h3>Keep a Colour Reference</h3>
<p>I bet this has happened to you many times, when you're working on a website design and you can't exactly remember the hexadecimal colour code for each element of the design.</p>
<p>A way to fix that is to include a colour reference at the top of your CSS file. That way, if you forget the code for a specific colour, you can simply check the top of the file, then simply copy and paste it into another section of your file.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/* Colour reference
&nbsp;
background: #FFCCCC
normal text: #FFF46D
links: #38FF0E
headings: #77F6FF
main content bg: #DCAFFF
&nbsp;
Note: Do not use this colour scheme in a real design. It will look horrible.
*/</pre></div></div>

<h3>Become Familiar With Every Property</h3>
<p>While you don't need to use <em>every</em> property that exists in CSS, it is a good idea to at least know what most of them do. For this, you can take a look at the <a href="http://htmldog.com/reference/cssproperties/">CSS property reference</a>, from <cite>HTML Dog</cite>.</p>
<p>What other CSS best practices would you recommend using? Be sure to leave a comment with your response.</p>
<img src="http://feeds.feedburner.com/~r/Fwebde/~4/B8gCkxOQDnw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://fwebde.com/css/css-best-practices/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://fwebde.com/css/css-best-practices/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.963 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-17 16:59:53 --><!-- Compression = gzip -->
