<?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>nasarik.com - A Lancashire designer&#039;s journey through life, print and web design &#187; code</title>
	<atom:link href="http://nasarik.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://nasarik.com</link>
	<description>I&#039;m just a designer trying to make sense of the web, design and pretty much everything else</description>
	<lastBuildDate>Sun, 22 Jan 2012 21:42:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://nasarik.com</link>
  <url>http://nasarik.com/wp-content/themes/sandbox/images/nasarikfav.jpg</url>
  <title>nasarik.com - A Lancashire designer&#039;s journey through life, print and web design</title>
</image>
		<item>
		<title>Don&#8217;t be afraid of responsive design</title>
		<link>http://nasarik.com/responsive-designs/</link>
		<comments>http://nasarik.com/responsive-designs/#comments</comments>
		<pubDate>Sat, 03 Sep 2011 20:56:19 +0000</pubDate>
		<dc:creator>nasarik</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[bullet]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[dependant]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[dimension]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[hype]]></category>
		<category><![CDATA[img]]></category>
		<category><![CDATA[impact]]></category>
		<category><![CDATA[information]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[journey]]></category>
		<category><![CDATA[Magazine]]></category>
		<category><![CDATA[maximum]]></category>
		<category><![CDATA[nasarik]]></category>
		<category><![CDATA[novice]]></category>
		<category><![CDATA[overview]]></category>
		<category><![CDATA[pixel]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[response]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[Smashing]]></category>
		<category><![CDATA[target]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[value]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[width]]></category>
		<category><![CDATA[window]]></category>

		<guid isPermaLink="false">http://nasarik.com/?p=1281</guid>
		<description><![CDATA[If you use Twitter, read Smashing Magazine or any of the other leading design blogs on the web, then no doubt you will be aware of responsive design and the impact that the industry knows it will have on all web developers and designers. If you don&#8217;t, then here is an overview of what it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://farm7.static.flickr.com/6189/6109968044_50613e24d8.jpg" alt="responsive design" /></p>
<p>If you use Twitter, read Smashing Magazine or any of the other leading design blogs on the web, then no doubt you will be aware of responsive design and the impact that the industry knows it will have on all web developers and designers. If you don&#8217;t, then here is an overview of what it is and why I decided now was the time to get on-board.<span id="more-1281"></span></p>
<h2>So what is response design</h2>
<p>Responsive design is basically adapting a website to appear appropriately dependant on the device being used by the user. This has existed in web design for some time, particularly when a designer has needed to ensure that a site appeared correctly in all web browsers, and more notably IE6. Usual this was achieved by using media queries which detected the browser version and delivered the appropriate style sheet, eliminating the need for crude hacks or work-arounds to create a consistent experience for all.</p>
<p>Today with the introduction of CSS3, we are not simply limited to browser specific queries, we have much more control and can detect a browser screen size and deliver a set of specific styles to that as well. This new ability means that we can choose to build our projects with a set of structured options or alternatively with a fluid response meaning that one site can potentially work comfortably on many devices without a huge amount of work.</p>
<h2>A simple responsive experience, and why?</h2>
<p>With all the hype I simply couldn&#8217;t ignore the seemingly inevitable future for our industry, so I finally bit the bullet and gave it a go. Now, as I have only every really created fixed width designs my first job was to update all my values to percentages so that the design would scale effectively, however, I still wanted to keep a maximum site width, so in addition to the width:100%; value I added the max-width: value as well, specifying my desired pixel dimension (sorry, I know pixel!). So this would give me a desired maximum site look while still giving the overall flexibility of the percentages.</p>
<p>Once the scaling was complete (feel free to test this by resizing the browser window), I then did my research which took me to a great article on <a title="See the article here - Responsive Web Design: What It Is and How To Use It" href="http://coding.smashingmagazine.com/2011/01/12/guidelines-for-responsive-web-design/" target="_blank">Smashing Magazine</a>. Articles like this give invaluable information on all aspects of the responsive design process and I would recommend taking your time to find the most appropriate option before really trying to get to grips with responsive designs. For me however, I explored the <code>'@media </code><code>screen' function</code>, this gave me the control to adapt my design when hitting certain screen dimensions, for example the first thing I tried was to remove content when the screen dimension was that of an iPhone, which looked like this:-</p>
<p>@media screen and (max-width:400px) {<br />
#primary {display:none;}<br />
}</p>
<p>You will see that if you reduce the browser window to below this dimension the sidebar of my site disappears, and the same happens on the iPhone, and that is how the responsive journey of nasarik.com began.</p>
<h2>Stumbling blocks</h2>
<p>I hit a few novice snags along the way which nearly caused me to give up, one of which was the iPhone still scaling my site even though I had included queries. Don&#8217;t panic a simple meta value in your &lt;head&gt; ensures that the iPhone behaves as you would expect and here it is &#8211; &lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width; initial-scale=1.0&#8243;&gt;</p>
<p>Finally, testing can be an issue particularly if you don&#8217;t have an iPhone, so try using <a href="http://iphone4simulator.com/" target="_blank">http://iphone4simulator.com/</a> it seems to render perfectly and is free.</p>
<h2>Conclusion</h2>
<p>Responsive design isn&#8217;t to be feared, play with it, try and break your site and see what happens.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://nasarik.com/responsive-designs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS layout made easy</title>
		<link>http://nasarik.com/easy-css-layout/</link>
		<comments>http://nasarik.com/easy-css-layout/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 22:07:15 +0000</pubDate>
		<dc:creator>nasarik</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://nasarik.com/?p=21</guid>
		<description><![CDATA[  When creating a html or CSS document it is not only important to make sure the page meets as many of today&#8217;s web standards as possible, it is also important as a web page editor to be able to easily find your way around your documents.  Here is a quick guide to help make editing your [...]]]></description>
			<content:encoded><![CDATA[<p> <img class="post_images" src="http://farm4.static.flickr.com/3467/3231647895_5830bed063.jpg?v=0" alt="" /></p>
<p>When creating a html or CSS document it is not only important to make sure the page meets as many of today&#8217;s web standards as possible, it is also important as a web page editor to be able to easily find your way around your documents.  Here is a quick guide to help make editing your css files just a little easier.</p>
<p><span id="more-21"></span></p>
<p>Use shortcuts to streamline your code, for example instead of using the following -</p>
<p><strong>padding-top:10px;<br />
padding-right:15px;<br />
padding-bottom:10px;<br />
padding-left:15px;</strong></p>
<p>Streamline it using the code below -</p>
<p><strong>padding: 10px 15px 10px 15px;</strong></p>
<p>This will not only save you time when writing your code, but also reduce the overall length of the page making it much easier to navigate.</p>
<p><strong>Find a structure that suits you</strong></p>
<p>When first learning CSS it is sometimes easier to use the stacking method, this is where each line of style inherits a new line on the page; but as you get more confident with your code it may be easier to keep each styling class on one line.  This will again help to keep you pages considerably shorter.</p>
<p><strong>Add comments to break up your file in to easily understandable blocks</strong></p>
<p>With many websites that you create you may revisit them quite some time after the build, this can cause problems when familiarising your self with the code again, using comments to break down your code can not only help you when editing a website but could also really help another designer who needs to quickly make some changes to a template they didn&#8217;t create.</p>
<p>I would recommend organising your CSS in to groups such as; divs, styling and navigation, this will give you a quick reference to your page.  At the head of each CSS group add a comment for example:- /*containing divs*/.  You can expand this theory and break the page down even further, but this is a good start.</p>
<p>There is much more to CSS layout than these few tips, but if you give thought to your layout from the beginning you will save yourself time and effort in the long run.</p>
]]></content:encoded>
			<wfw:commentRss>http://nasarik.com/easy-css-layout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Absolute positioning with CSS</title>
		<link>http://nasarik.com/absolute-positioning/</link>
		<comments>http://nasarik.com/absolute-positioning/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 22:03:51 +0000</pubDate>
		<dc:creator>nasarik</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://nasarik.com/?p=20</guid>
		<description><![CDATA[When learning CSS you will no doubt quickly master positioning your divs using floats, margin and padding. There is however another way! Creating your page with floats, margins and padding creates a stacking effect to your pages with absolute positioning you can place the div element anywhere on your page as long as it is within a bounding area. Here [...]]]></description>
			<content:encoded><![CDATA[<p><img class="post_images" src="http://farm4.static.flickr.com/3392/3232497810_06a9d77463.jpg?v=0" alt="" /><br />
When learning CSS you will no doubt quickly master positioning your divs using floats, margin and padding. There is however another way!</p>
<p><span id="more-20"></span></p>
<p>Creating your page with floats, margins and padding creates a stacking effect to your pages with absolute positioning you can place the div element anywhere on your page as long as it is within a bounding area.</p>
<p>Here is a simple example of the CSS code to achieve absolute positioning-</p>
<p>.wrapper {<br />
width:800px;<br />
height:600px;<br />
position:relative;<br />
}<br />
.absolute {<br />
 width:200px;<br />
 height:200px;<br />
 position:absolute;<br />
 left: 33px;<br />
 top: 39px;<br />
}</p>
<p>And here is the body code -</p>
<p>&lt;body&gt;<br />
&lt;div class=&#8221;wrapper&#8221;&gt;</p>
<p> &lt;div class=&#8221;absolute&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;/div&gt;<br />
&lt;/body&gt;</p>
<p>The above CSS shows the wrapper of your webpage with standard height and width values, I have also added the position:relative value this means any absolute elements that we specify will remain relative to the boundary of your webpage.  I have then created our absolute positioned element class, again with standard values but this time the position value is absolute.  Now using left, top, right, bottom values you can move the element anywhere within or outside your page wrapper.</p>
<p>So basically placing the absolute div within your wrapper as shown in the HTML code example you can place elements wherever you want on your page.</p>
<p>Obviously this can have draw backs, if for example you are wanting to use multiple absolute elements you will need to create separate class&#8217; which can be messy if you are planning on creating a large number of element.  But don&#8217;t let this put you off, used carefully this can overcome some obstacles in website design, particularly for anyone who is getting started with CSS.</p>
]]></content:encoded>
			<wfw:commentRss>http://nasarik.com/absolute-positioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

