<?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>CSS tutorials and more &#187; CSS Tutorials</title>
	<atom:link href="http://jamesowers.co.uk/category/css-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesowers.co.uk</link>
	<description>CSS &#38; other web developer stuff</description>
	<lastBuildDate>Fri, 05 Mar 2010 08:00:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Backgrounds: Tiling</title>
		<link>http://jamesowers.co.uk/css-tutorials/371/css-backgrounds-tiling/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/371/css-backgrounds-tiling/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 09:00:28 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[repeat]]></category>
		<category><![CDATA[tile]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/?p=371</guid>
		<description><![CDATA[CSS allows us to do some great things with background images that really can make your layout look excellent. The simplest method of applying a background image is to use tiling.
In this quick guide, I&#8217;ll go through the basics of using CSS to tile background images.

Before I go into tiling I&#8217;ll demonstrate the way I [...]]]></description>
			<content:encoded><![CDATA[<p>CSS allows us to do some great things with background images that really can make your layout look excellent. The simplest method of applying a background image is to use tiling.</p>
<p>In this quick guide, I&#8217;ll go through the basics of using CSS to tile background images.</p>
<p><span id="more-371"></span></p>
<p>Before I go into tiling I&#8217;ll demonstrate the way I use to define a background image and then explain it.</p>
<pre class="brush: css;">
#mypage{
	background: #fff url(background.gif);}
</pre>
<p>This is the very simplest it gets. The &#8216;#fff&#8217; tells the browser to make the background of the div white and the &#8216;url(image.jpg)&#8217; tells it to put that image over the black. The image will be tiled vertically and horizontally. Using this CSS is exactly the same as using:</p>
<pre class="brush: css;">
#mypage{
	background-color: #fff;
	background-image: url(background.gif);}
</pre>
<p>Now, maybe we don&#8217;t want the image to tile vertically and horizontally. We might have a webpage that has a gradient background that fades into a solid colour. CSS makes this simple to do. </p>
<p>In this example I want the background to fade from grey (#ccc) to white. First of all I save my image in photoshop. It&#8217;s simply a 1px wide gif image. To tile the image horizontally I would use the CSS:</p>
<pre class="brush: css;">
#mypage{
	background: #fff url(background.gif) repeat-x;}
</pre>
<div class="demo-link"><a href="http://jamesowers.co.uk/wp-content/uploads/css-tiled-bg/" title="CSS Tiled Background">View a demo of the page</a></div>
<p>If you want to you could tile the image vertically by using:</p>
<pre class="brush: css;">
#mypage{
	background: #fff url(background.gif) repeat-y;}
</pre>
<p>Again, this is shorthand for using the code:</p>
<pre class="brush: css;">
#mypage{
	background-color: #000;
	background-image: url(image.jpg);
	background-repeat: repeat-x;}
</pre>
<p>Finally, you can tell the browser not to repeat the background image at all.</p>
<pre class="brush: css;">
#mypage{
	background: #fff url(background.gif) no-repeat;}
</pre>
<p>Hopefully this quick article will have given you a quick demonstration on how to tile background images using CSS. I&#8217;ll hopefully be writing another quick guide on using fixed background images.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/371/css-backgrounds-tiling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling Forms with CSS</title>
		<link>http://jamesowers.co.uk/css-tutorials/139/styling-forms-with-css/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/139/styling-forms-with-css/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 09:21:42 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/?p=139</guid>
		<description><![CDATA[When you don’t quite get it, styling forms with CSS can be a real pain. But once you get your head around it you will see that there’s nothing really too difficult about it.

In this tutorial you will see how to create this contact form and style it so that it looks like this. In [...]]]></description>
			<content:encoded><![CDATA[<p>When you don’t quite get it, styling forms with CSS can be a real pain. But once you get your head around it you will see that there’s nothing really too difficult about it.</p>
<p><span id="more-139"></span></p>
<p>In this tutorial you will see how to create this contact form and style it so that it looks like this. In the future I am going to make some further guides on how to take the information entered and send it to yourself using PHP or ASP, but that’s for another day.</p>
<p>Right, so first of all we’re going to need our form. I am going to use this one. Your free to use this code if you don’t have a form of your own. Here&#8217;s the code for the form:</p>
<pre class="brush: xml;">
&lt;form action=”” method=”post”&gt;
	&lt;label for=&quot;user_name&quot;&gt;Your Name&lt;/label&gt;
	&lt;input type=&quot;text&quot; name=&quot;user_name&quot; class=&quot;inputbox&quot;/&gt;
	&lt;label for=&quot;user_email&quot;&gt;Your Email&lt;/label&gt;
	&lt;input type=&quot;text&quot; name=&quot;user_email&quot; class=&quot;inputbox&quot;/&gt;
	&lt;label for=&quot;user_message&quot;&gt;Your Message&lt;/label&gt;
	&lt;textarea name=&quot;user_message&quot;&gt;&lt;/textarea&gt;
	&lt;input type=&quot;submit&quot; value=&quot;submit&quot; name=&quot;submit&quot; class=&quot;submit&quot;/&gt;
&lt;/form&gt;
</pre>
<p>Now as you can see the form is very simple and doesn&#8217;t look very good at all just yet. We&#8217;re going to fix that though.</p>
<p>First of all, we&#8217;re going to give the form a css class so that we can style it and all the elements within it. To do this we simply change:</p>
<pre class="brush: xml;">
&lt;form action=”” method=”post”&gt;
</pre>
<p>To:</p>
<pre class="brush: xml;">
&lt;form action=”” method=”post&quot; class=&quot;webform&quot;&gt;
</pre>
<p>You will notice I added a class to our form rather than an id. This is simply because you might want to use more than one form on your page and using a class will keep the page valid whether you have one form or ten.</p>
<p>Simple, eh? Now lets start styling.</p>
<p>In our CSS document, we&#8217;re going to add a style for our form. So we add:</p>
<pre class="brush: css;">
.webform{}
</pre>
<p>All of our styling will go between the { and the }. Now, I dont want my form to be too wide so I&#8217;ll add a width to my CSS.</p>
<pre class="brush: css;">
.webform{
	width:400px;}
</pre>
<p>Next, we&#8217;ll add a font, a font colour and a background colour.</p>
<pre class="brush: css;">
.webform{
	width:400px;
	font:11px Arial, Helvetica, sans-serif;
	color:#777;
	background-color:#fff;}
</pre>
<p>Now that the basic styling for our form is done, we can add some styling to the labels and inputs. First of all we will tackle the labels with the following CSS.</p>
<pre class="brush: css;">
.webform label{
	display:block;
	width:300px;
	font-weight:bold;}
</pre>
<p>All the CSS above is pretty simple, we used the &#8220;display:block;&#8221; so that all the labels will start on a new line. This means we dont have to add any breaks (<br /> tags) after every line. After we added the styling to our labels you can see that the form is starting to look a lot better. Now for the inputs.</p>
<pre class="brush: css;">
.webform .inputbox{
	height:18px;
	width:250px;
	padding:4px 3px 2px 3px;
	margin:2px 0 10px 3px;
	border:1px solid #ccc;}
</pre>
<p>Again, I haven&#8217;t used anything to difficult to style the input boxes but they look a lot better! You might have noticed the submit button is a bit screwed up, dont worry, we&#8217;ll be fixing that later. But first we will make the textarea look better with the following CSS.</p>
<pre class="brush: css;">
.webform textarea{
	height:80px;
	width:250px;
	padding:4px 3px 2px 3px;
	margin:2px 0 10px 3px;
	border:1px solid #ccc;}
</pre>
<p>So now the form is looking fine and dandy, apart from that pesky submit button. Lets add a class to it.</p>
<p>Change:</p>
<pre class="brush: xml;">
&lt;input type=&quot;submit&quot; value=&quot;submit&quot; name=&quot;submit&quot;/&gt;
</pre>
<p>To:</p>
<pre class="brush: xml;">
&lt;input type=&quot;submit&quot; value=&quot;submit&quot; name=&quot;submit&quot; class=&quot;submit&quot;/&gt;
</pre>
<p>Now our submit button has a class of submit. Now for the CSS.</p>
<pre class="brush: css;">
.submit{
	margin:2px 0 0 3px;
	background-color:#eee;
	height:30px;
	width:80px;
	padding:0;
	border:1px solid #ccc;
	display:block;
	color:#666;}
</pre>
<p>Again, we have used the &#8220;display:block;&#8221; style to put the button on a new line without using a break. I have also added a background colour, padding, a border and margin. All of these are pretty simple CSS styles. If you need help with the different CSS styles check out the beginners guide to CSS tutorial.</p>
<p>As you can see, our form is looking very nice now and it has all been done with some simple CSS and minimal extra HTML. You can see the finished CSS form <a href="http://jamesowers.co.uk/pages/form/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/139/styling-forms-with-css/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>CSS Fonts</title>
		<link>http://jamesowers.co.uk/css-tutorials/82/css-fonts/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/82/css-fonts/#comments</comments>
		<pubDate>Tue, 27 May 2008 08:23:14 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[styling]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/?p=82</guid>
		<description><![CDATA[One of the most important but overlooked aspects of a web design is the typography. The fonts you use and how you present those fonts can really make or break your website design. Thankfully you can use CSS to really make your fonts look great! 

The first thing to learn when it comes to CSS [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most important but overlooked aspects of a web design is the typography. The fonts you use and how you present those fonts can really make or break your website design. Thankfully you can use CSS to really make your fonts look great! </p>
<p><span id="more-82"></span></p>
<p>The first thing to learn when it comes to CSS fonts are the selectors and what each of them do. Here are the main font selectors and what they do:</p>
<p><strong>font-family</strong><br />
This selects which font you want to use for your text. You can specify more than one font family, then if the browser cant find the font you use first it will move on to the next one and so on until it finds one it recognises.</p>
<p><strong>font-size</strong><br />
As you might of guessed this defines the size of the font. You can define this as a pixel size (e.g. 12px), as a general size (e.g. large, small etc.). </p>
<p><strong>font-style</strong><br />
The font style attribute defines extra styles to your font such as italic.</p>
<p><strong>font-weight</strong><br />
The font weight sets the weight of the font. To define the weight of your font you can use words (such as normal, bold or bolder) or you can use values (e.g 100, 200, 300 etc.) the higher the values get the bolder the font will get.</p>
<p>These are the main font properties you will use. Now lets have a look at defining a font in CSS. We will add the font to an id called content. Basically this means that everything in the content div will be given the font style we define whilst everything outside the div will have a seperate style. </p>
<pre class="brush: css;">
#content{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	font-style: normal;}
</pre>
<p>In  the example above we first define the font family, you might notice I slected three fonts all seperated by a comma. This is (as described above) so the browser can find another font to use if it cant find arial. Next we define the font size which is pretty self explanitory. Then we define the font weight and font style. As the default for these two values is normal if you didn&#8217;t want to have italic or bold text then you wouldn&#8217;t have to define them so your css style would look like:</p>
<pre class="brush: css;">
#content{
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;}
</pre>
<p>Now we will move on to writing the above style in shorthand. Writing in shorthand has the same effects as writing it the long way, it just saves some space.</p>
<p>The way the style should be layed out is:</p>
<pre class="brush: css;">
#content{
	font: font-style font-weight font-size font-family}
</pre>
<p>So an example of a font style would be:</p>
<pre class="brush: css;">
#content{
	font: italic bold 12px Arial, Helvetica, sans-serif;}
</pre>
<p>And that&#8217;s all you need to know for the basics of text styling with CSS. </p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/82/css-fonts/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cheat Sheets</title>
		<link>http://jamesowers.co.uk/general/66/cheat-sheets/</link>
		<comments>http://jamesowers.co.uk/general/66/cheat-sheets/#comments</comments>
		<pubDate>Wed, 14 May 2008 09:33:49 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[ASP tutorials]]></category>
		<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[asp]]></category>
		<category><![CDATA[cheat]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regular expressions]]></category>
		<category><![CDATA[sheet]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/?p=66</guid>
		<description><![CDATA[Cheat sheets can be very handy from time to time. Although you probably wont learn much from them, I find them excellent for refreshing my memory. For example if I&#8217;ve been working on an ASP project for a while and then have to do some CSS or even worse PHP I often take a while [...]]]></description>
			<content:encoded><![CDATA[<p>Cheat sheets can be very handy from time to time. Although you probably wont learn much from them, I find them excellent for refreshing my memory. For example if I&#8217;ve been working on an ASP project for a while and then have to do some CSS or even worse PHP I often take a while to get my head around the changes in language and format. </p>
<p><span id="more-66"></span></p>
<p>I find cheat sheets are great for helping me aclimatise quicker! So here&#8217;s a collection of my favourites:</p>
<p><strong>CSS Cheat Sheets</strong></p>
<p>Now I code something using CSS at least once a day but I still have the need every once in a while to look up some obscure property, so having this CSS cheat sheet lying around comes in handy.</p>
<p><a href='http://www.addedbytes.com/cheat-sheets/css-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/css.gif" alt="" title="css" width="300" height="195" class="alignnone size-medium wp-image-69" /></a></p>
<p><strong>HTML Cheat Sheets</strong></p>
<p>HTML cheat sheets can always come in handy from time to time, bookmark it or print it out so you know where it is when you need it!<br />
<a href='http://www.addedbytes.com/cheat-sheets/html-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/html.gif" alt="" title="html" width="300" height="195" class="alignnone size-medium wp-image-68" /></a></p>
<p><strong>jQuery cheat sheets</strong></p>
<p>I&#8217;ve been doing a lot of work with jQuery recently and although my javascript isn&#8217;t very good this jQuery cheat sheet (and another one from ColorCharge that I cant find on their website anymore) has helped a lot.<br />
<a href='http://www.gscottolson.com/weblog/2008/01/11/jquery-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/jquery.gif" alt="" title="jquery cheat sheet" width="300" height="195" class="alignnone size-medium wp-image-67" /></a></p>
<p><strong>ASP Cheat Sheet</strong></p>
<p><a href='http://www.addedbytes.com/cheat-sheets/asp-vbscript-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/asp.gif" alt="" title="asp" width="300" height="195" class="alignnone size-medium wp-image-70" /></a></p>
<p><strong>PHP Cheat Sheet</strong></p>
<p><a href='http://www.addedbytes.com/cheat-sheets/php-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/php.gif" alt="" title="php" width="300" height="195" class="alignnone size-medium wp-image-71" /></a></p>
<p><strong>MySQL Cheat Sheet</strong></p>
<p><a href='http://www.addedbytes.com/cheat-sheets/mysql-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/mysql.gif" alt="" title="mysql" width="300" height="195" class="alignnone size-medium wp-image-72" /></a></p>
<p><strong>SQL Cheat Sheet</strong></p>
<p><a href='http://www.addedbytes.com/cheat-sheets/sql-server-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/sql.gif" alt="" title="sql" width="300" height="195" class="alignnone size-medium wp-image-73" /></a></p>
<p><strong>Regular Expressions Cheat Sheet</strong></p>
<p><a href='http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/exp.gif" alt="" title="exp" width="300" height="195" class="alignnone size-medium wp-image-77" /></a></p>
<p><strong>MOD_REWRITE Cheat Sheet</strong></p>
<p><a href='http://www.addedbytes.com/cheat-sheets/mod_rewrite-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/modrewrite.gif" alt="" title="modrewrite" width="300" height="195" class="alignnone size-medium wp-image-74" /></a></p>
<p><strong>HTML Characters Chart</strong></p>
<p><a href='http://www.addedbytes.com/cheat-sheets/html-character-entities-cheat-sheet/'><img src="http://jamesowers.co.uk/wp-content/uploads/2008/05/htmlchar.gif" alt="" title="htmlchar" width="300" height="195" class="alignnone size-medium wp-image-75" /></a></p>
<p>Now I realise a lot of these cheat sheets are from the same website, this is just because they&#8217;re the best ones I&#8217;ve came across. If you know of anoher good cheat sheet that I&#8217;ve missed, let me know and I&#8217;ll get it up.</p>
<p>I&#8217;ll update this post as and when I find new cheat sheets thatI think are worth telling people about.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/general/66/cheat-sheets/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Horizontal CSS List Menu</title>
		<link>http://jamesowers.co.uk/css-tutorials/50/horizontal-css-list-menu/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/50/horizontal-css-list-menu/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 13:00:40 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[horizontal]]></category>
		<category><![CDATA[horizontal css menu tutorial]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/css-tutorials/50/horizontal-css-list-menu/</guid>
		<description><![CDATA[This tutorial will show you how to make a horizontal CSS list menu. No images, no javascript. Just a simple, cross browser compatible CSS list menu! If you want to see the finished product or you just want the code, look here.

First of all we&#8217;ll need the HTML for our list menu, this is just [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to make a horizontal CSS list menu. No images, no javascript. Just a simple, cross browser compatible CSS list menu! If you want to see the finished product or you just want the code, <a href="http://jamesowers.co.uk/pages/css_horizontal_menu/menu.html">look here</a>.</p>
<p><span id="more-50"></span></p>
<p>First of all we&#8217;ll need the HTML for our list menu, this is just a normal unordered list.</p>
<pre class="brush: xml;">
&lt;div class=&quot;menu&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;#&quot;&gt;Link&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br style=&quot;clear:left&quot;/&gt;
&lt;/div&gt;
</pre>
<p>It&#8217;s just a simple html page with an unordered list menu on. You might notice I&#8217;ve added a div called menu around the list, I like to do this as it helps me remember what part of the code does what if I ever have to go back to it.</p>
<p>Next we&#8217;re going to add the CSS code for the div called menu that surrounds the list.</p>
<pre class="brush: css;">
.menu{
	width: 100%;
	background-color: #333; }
</pre>
<p>Again this is nice and simple. The menu div will be the full width of the div it&#8217;s inside and will have a dark grey background.</p>
<p>Next we add the syling for the list and the list items.</p>
<pre class="brush: css;">
.menu ul{
	margin: 0; padding: 0;
	float: left;}

.menu ul li{
	display: inline;}

.menu ul li a{
	float: left; text-decoration: none;
	color: white;
	padding: 10.5px 11px;
	background-color: #333; }

.menu ul li a:visited{
	color: white;}

.menu ul li a:hover, .menu ul li .current{
	color: #fff;
	background-color:#0b75b2;}
</pre>
<p>Again it&#8217;s all pretty simple, you should be able to understand the code with a little bit of CSS knowledge. Have a tinker with the code if you&#8217;re unsure about something.</p>
<p>You might also want to sign up for the <a href="http://jamesowers.co.uk/feed/">RSS Feed</a> or view some of my other <a href="http://jamesowers.co.uk/category/css-tutorials" title="CSS Tutorials">CSS Tutorials</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/50/horizontal-css-list-menu/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Weird margin problem in IE with floating div&#8217;s</title>
		<link>http://jamesowers.co.uk/css-tutorials/27/weird-margin-problem-in-ie-with-floating-divs/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/27/weird-margin-problem-in-ie-with-floating-divs/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 21:23:30 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie margin problem]]></category>
		<category><![CDATA[margin]]></category>
		<category><![CDATA[problem]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/css-tutorials/27/weird-margin-problem-in-ie-with-floating-divs/</guid>
		<description><![CDATA[Here&#8217;s a rather quick css tutorial, but in my opinion, a rather important one. Have you ever noticed when you code a website that uses floating div&#8217;s that IE6 does some really weird things with the margin widths?
I&#8217;ve came across this before, normally you can get away with a few extra pixels without having to [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a rather quick css tutorial, but in my opinion, a rather important one. Have you ever noticed when you code a website that uses floating div&#8217;s that IE6 does some really weird things with the margin widths?</p>
<p>I&#8217;ve came across this before, normally you can get away with a few extra pixels without having to worry, but when you&#8217;re coding sites that have large margins on a floating div it can really get messy. Anyway I decided enough was enough, I wasn&#8217;t going to leave it, I fiddled around for an hour or two with my CSS file and finally I came up with the reason IE6 doubles the margin on a floating div and that reason is&#8230;..(drum roll..)&#8230;.there is no reason, it shouldn&#8217;t do it, it can only be described as a bug!</p>
<p><strong>The Fix </strong></p>
<p>Now to the important part, how to fix the weird margin problem in IE6, and the fix is just as weird as the problem you simply add:</p>
<pre class="brush: css;">display: inline;</pre>
<p>Into the CSS code for the floating element.</p>
<p>Again there&#8217;s no reason why this should happen, it&#8217;s just one of those things!</p>
<p>I find if you use this technique with the <a href="http://jamesowers.co.uk/css-tutorials/5/essential-css-code/" title="Essential CSS Code">essential css code</a> from my other tutorial I can quickly create layouts that are very, very cross browser compatible.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/27/weird-margin-problem-in-ie-with-floating-divs/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Beginners Guide to CSS</title>
		<link>http://jamesowers.co.uk/css-tutorials/14/beginners-guide-to-css/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/14/beginners-guide-to-css/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 21:19:35 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css tutorial for beginners]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[learn css]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/css-tutorials/14/beginners-guide-to-css/</guid>
		<description><![CDATA[In this guide I&#8217;ll be going through how to start out learning CSS. Hopefully by the end of this tutorial you will be much more comfortable using CSS to code websites.

CSS or cascading style sheets are used to style html or xhtml documents. The idea behind CSS is to allow you to dramatically change how [...]]]></description>
			<content:encoded><![CDATA[<p>In this guide I&#8217;ll be going through how to start out learning CSS. Hopefully by the end of this tutorial you will be much more comfortable using CSS to code websites.</p>
<p><span id="more-14"></span></p>
<p>CSS or cascading style sheets are used to style html or xhtml documents. The idea behind CSS is to allow you to dramatically change how a webpage looks without editing any HTML. CSS is normally stored in an external css file, this means that you can change how hundreds of pages look by changing some code in a single CSS file. It is a good idea if you have some experience with html or xhtml before you do this tutorial.</p>
<p><strong>The Syntax </strong></p>
<p>First of all I&#8217;ll demonstrate what the CSS syntax should look like:</p>
<pre class="brush: css;">
selector{property:value;}
</pre>
<p>An example of some working CSS syntax is:</p>
<pre class="brush: css;">
html{color:#333333;}
</pre>
<p>This would make the font colour of everything in the &lt;html&gt; &lt;/html&gt; tags #333333.</p>
<p>You can define multiple properties for one selector as long as you seperate them with a semicolon (;). For example:</p>
<pre class="brush: css;">
html{color:#333333;background-color:#cccccc;}
</pre>
<p>This would give the page a light grey (#cccccc) background with dark grey text (#333333).</p>
<p><strong>The Selectors</strong></p>
<p>There are three main types of selectors, the first type are the selectors that correspond to html elements such as body, p, li etc. Here&#8217;s an example of the p selector at work:</p>
<pre class="brush: css;">
p{color:#333333;}
</pre>
<p>That would change the text colour of everything inside the &lt;p&gt; &lt;/p&gt; tags on your web page.</p>
<p>Next we have classes. A class will allow you to name sets of styles, this means you can have two paragraphs that are styled differently in a single page. A class selector looks like:</p>
<pre class="brush: css;">
.text_one{color:#333333;}
</pre>
<p>In the example I called my class text_one. You must always put the full stop before the name of the class as this tells your browser what you&#8217;re defining. Classes can come in useful when you want to  style a number of elements differently. For example I might have two paragraphs, one that has dark grey text and one that has light grey text. My CSS would look like:</p>
<pre class="brush: css;">
.text_one{color:#333333;}.text_two{color:#cccccc;}
</pre>
<p>I would then apply the classes to my elements by using this code:</p>
<pre class="brush: xml;">
&lt;p class=&quot;text_one&quot;&gt;Text Here&lt;/p&gt;
&lt;p class=&quot;text_two&quot;&gt;Text Here&lt;/p&gt;
</pre>
<p>The great thing about classes is that you can use the same class as many times as you want in an html document. That brings us on to the final selector an ID.</p>
<p>I use ID&#8217;s to define the main parts of a layout, for example if a page has a wrapper div I would make that an ID. The other important thing to remember about an ID is that it should only appear on an html page once. To define an id simply use:</p>
<pre class="brush: css;">
#divname{selector:value;}
</pre>
<p>Then to use it in your html document you would use the code:</p>
<pre class="brush: css;">
#divname{selector:class;}
</pre>
<p>And that&#8217;s it for selectors!</p>
<p><strong>Style Sheets </strong></p>
<p>There are two ways of including a css in your pages. The first way is internally, you would do this by using the code:</p>
<pre class="brush: xml;">
&lt;style type=&quot;text/css&quot;&gt;
CSS Code Goes Here
&lt;/style&gt;
</pre>
<p>The reason I don&#8217;t recommend using internal styles is because the whole point behind style sheets is to keep the styling and the actual html of the page separate and  using internal style sheets would be defeating the object.</p>
<p>The next method of including css into your html is to use external style sheets. This consists of creating a file, which is normally called something like style.css and then including it inbetween the &lt;head&gt;&lt;/head&gt; tags in your html file. The code for including a css file is:</p>
<pre class="brush: xml;">
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
</pre>
<p>Obviously you would replace &#8220;style.css&#8221; for the path and name of your css stylesheet.</p>
<p>That&#8217;s just about everything you need to know when you&#8217;re first starting out with CSS! My advice to you now is to sit down and practice what you&#8217;ve learned here. I&#8217;ll be adding some more tutorials soon so keep checking back!</p>
<p>If you like this site you could always sign up for my <a href="http://feeds.feedburner.com/JamesOwers">rss feed</a> and if you&#8217;re feeling generous you could buy me a pint using that button on the top right of every page :D</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/14/beginners-guide-to-css/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Vertical List Menu</title>
		<link>http://jamesowers.co.uk/css-tutorials/10/vertical-list-menu/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/10/vertical-list-menu/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 13:31:26 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[vertical]]></category>
		<category><![CDATA[vertical css menu]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/general/10/vertical-list-menu/</guid>
		<description><![CDATA[I used to find it hard to find a list menu that was compatible with all the browsers I use without having to use any CSS hacks that&#8217;s why when I created this one I decided to keep it and use it as my standard list menu, that way I only have to change certain [...]]]></description>
			<content:encoded><![CDATA[<p>I used to find it hard to find a list menu that was compatible with all the browsers I use without having to use any CSS hacks that&#8217;s why when I created this one I decided to keep it and use it as my standard list menu, that way I only have to change certain aspects of the styling to make it look how I want it to look.</p>
<p><span id="more-10"></span></p>
<p>First of all we&#8217;ll do the HTML for the list menu, this will simply be:</p>
<pre class="brush: xml;">
&lt;div class=&quot;listmenu&quot;&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item 1&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item  2&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item  3&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item  4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</pre>
<p>And that&#8217;s it as far as the HTML for our list goes, if you&#8217;re confused now you might want to do some more reading on HTML. You can see the list so far <a href="http://jamesowers.co.uk/pages/listmenu/1.html">Here</a>. As you can see, it&#8217;s nothing special yet!<br />
Now we&#8217;ll move onto the CSS. You might have noticed that our listmenu was inside a class called &#8220;listmenu&#8221; that&#8217;s simply so we can reuse the list menu as many times as we want on a single page, while using an ID would only let us use it once.<br />
Here&#8217;s the code for the listmenu class:</p>
<pre class="brush: css;">
.listmenu ul {
margin: 0 0 5px 0;
padding: 0 0 2px 0;
list-style-type: none;width:185px;}
</pre>
<p>All I have done here is added a little bit of padding and margin to space the whole list out from the side of the page, you can change this to whatever you need to make it fit your layout. I also added a width, pretty obvious what that does :p and a &#8220;list-style-type: none;&#8221; that will remove the bullet points from the end of the list. You can see what the whole list looks like now if you go <a href="http://jamesowers.co.uk/pages/listmenu/2.html">Here</a>. As you can see, there&#8217;s still some work to do!<br />
Next we&#8217;re going to add the CSS to style the list item, this will only work on list items that are hyperlinked like the ones in the HTML code posted above. The code for the list item looks like this:</p>
<pre class="brush: css;">
.listmenu li a {
color: #333;
display: block;
border-left:3px solid #666;
border-right:3px solid #666;
height: 16px;
padding: 4px 0 4px 14px;
text-decoration: none;
font-weight:bold;
background-color:#fff;}
</pre>
<p>The display:block; makes your browser put each list item on a new line rather than all on one line. The two borders simply add a 3px #666 border to either side of our list menu, they’re just there to make it look a bit nicer :p. The rest of the CSS is pretty self explanatory.</p>
<p>Here I added some extra CSS code:</p>
<pre class="brush: css;">
html{
font:12px Arial, Helvetica, sans-serif;
color:#333;
padding:0;
margin:0;}
</pre>
<p>All the above code does is sets a font face, size and colour for the page to tidy it up a bit.</p>
<p>As you can see <a href="http://jamesowers.co.uk/pages/listmenu/3.html">here</a> the menu is starting to take shape now, all we need is a nice rollover effect.</p>
<p>To add the rollover we use this CSS:</p>
<pre class="brush: css;">
.listmenu li a:hover {
background-color: #666;
color:#fff;}
</pre>
<p>All this does is change the background colour to #666 and the font colour to #fff when you put your mouse over it. If you take a look <a href="http://jamesowers.co.uk/pages/listmenu/4.html">here</a> you will see our list menu is complete! I&#8217;ll post the full code for the finished menu at the bottom of he page incase you get stuck.</p>
<p>If you liked this tutorial, please consider letting me know by posting a comment, and if you like <a href="http://feeds.feedburner.com/JamesOwers">RSS Feeds</a> and tutorials like this, please sign up for my <a href="http://feeds.feedburner.com/JamesOwers">RSS Feed</a>.</p>
<p><strong>Vertical List Menu: </strong></p>
<pre class="brush: xml;">
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=ISO-8859-1&quot; /&gt;
&lt;style type=&quot;text/css&quot;&gt;
html{
font:12px Arial, Helvetica, sans-serif;
color:#333;
padding:0;
margin:0;}

.listmenu ul {
margin: 0 0 5px 0;
padding: 0 0 2px 0;
list-style-type: none;
width:185px;}

.listmenu li a {
color: #333;
display: block;
border-left:3px solid #666;
border-right:3px solid #666;
height: 16px;
padding: 4px 0 4px 14px;
text-decoration: none;
font-weight:bold;
background-color:#fff;}

.listmenu li a:hover {
background-color: #666;
color:#fff;}
&lt;/style&gt;
&lt;div class=&quot;listmenu&quot;&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item 1&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item  2&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item  3&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;#&quot;&gt;List Item  4&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/10/vertical-list-menu/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Essential CSS Code</title>
		<link>http://jamesowers.co.uk/css-tutorials/5/essential-css-code/</link>
		<comments>http://jamesowers.co.uk/css-tutorials/5/essential-css-code/#comments</comments>
		<pubDate>Wed, 07 Nov 2007 21:03:48 +0000</pubDate>
		<dc:creator>Jmz</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[essential]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://jamesowers.co.uk/general/5/essential-css-code/</guid>
		<description><![CDATA[When I’m coding a layout I like to start with a ready made CSS file that contains some code to make the actual coding of the layout easier. In this guide I’ll go through what I use and explain why. You should at least be familiar with CSS to properly understand this guide...]]></description>
			<content:encoded><![CDATA[<p>When I’m coding a layout I like to start with a ready made CSS file that contains some code to make the actual coding of the layout easier. In this guide I’ll go through what I use and explain why. You should at least be familiar with CSS to properly understand this guide.</p>
<p><span id="more-5"></span></p>
<p>First of all I’m going to talk about how the actual CSS code is laid out. There isn’t really a right or wrong way to do this, its simply personal preference, use what comes easiest to you.</p>
<p>I like to use:</p>
<pre class="brush: css;">
.class{
selector: value;}
</pre>
<p>The first thing you will notice is that on the selector I tabbed in, this is a tip I picked up from a thread on TalkFreelance and it comes in really useful when your searching for a specific class. The other thing you might notice is the closing bracket is on the same line as the last selector, this simply helps save some space, and in my opinion makes the whole thing easier to read.</p>
<p>Next is to group similar selectors on the same line, for example:</p>
<pre class="brush: css;">
.class{
margin:0; padding: 0;}
</pre>
<p>Again this just helps to neaten the stylesheet up and makes it easier to search later on.</p>
<p>When I’m creating complex layouts using lots of CSS I often find it easier to split the CSS into multiple stylesheets, for me its helps keep things organised and makes specific things easier to find later on. For example, I might make a separate stylesheet for my link styles, I then simply import it by adding this code at the top of my main stylesheet:</p>
<pre class="brush: css;">
@import url(linkstyles.css);
</pre>
<p>Next we’ll move onto the code I use as a base point for all of my layouts.</p>
<p>As you probably already know, all browsers like to render things differently, this can prove to be a real pain when it comes to making a layout that looks the same in all browsers. To make this a little bit easier its always a good idea to make sure the browser isn’t adding its own code to parts of the page. To do this I simply use code like:</p>
<pre class="brush: css;">
html{
margin:0; padding:0;}
Body{
margin:0; padding:0;}
</pre>
<p>This code will make sure that there is no padding or margin on the page before you start.</p>
<p>It’s a good idea to do this for virtually everything you add to your page, just to make sure your browser isn’t adding anything itself. So for example you could also use:</p>
<pre class="brush: css;">
p{
margin:0; padding:0;}
</pre>
<p>There’s nothing to stop you adding padding or margins to individual paragraphs by applying a class or ID to them. Similarly if you needed a 10px top margin on your html you could simply change the code to:</p>
<pre class="brush: css;">
html{
margin: 10px 0 0 0; padding:0;}
</pre>
<p>The next thing is images, I don’t know about you but I hate the way browsers put a blue border around any hyperlinked image on my page. Well there’s one easy way to get rid of them all at once, simply add:</p>
<pre class="brush: css;">
img{
border:0;}
</pre>
<p>Into your CSS stylesheet, this will remove all borders from all images on your page, again if you want a border of some sort on any one of your images, there’s nothing to stop you adding a class or ID to it.</p>
<p>The final essential bit of code in my CSS file is to do with floating divs, on some of my layouts I use a lot of them and that can lead to a hell of a lot of clearing divs. To get round this I use a class called clear which looks like:</p>
<pre class="brush: css;">
.clear{
clear: both;}
</pre>
<p>I can then add:</p>
<pre class="brush: css;">
&lt;div class=&quot;clear&quot;&gt;&lt;/div&gt;
</pre>
<p>To my layout whenever I need to clear some floating divs, this often saves a lot of time and code!</p>
<p>If you enjoyed this guide please consider signing up for my <a href="http://feeds.feedburner.com/JamesOwers">RSS Feed</a>. You can sign up for my <a href="http://feeds.feedburner.com/JamesOwers">RSS Feed</a> <a href="http://feeds.feedburner.com/JamesOwers">here</a>!</p>
<p>Thanks for reading!</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesowers.co.uk/css-tutorials/5/essential-css-code/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
