<?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>East Coast Interactive Ltd &#187; xhtml/css</title>
	<atom:link href="http://www.eastcoastinteractive.co.uk/category/xhtmlcss/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eastcoastinteractive.co.uk</link>
	<description>Web development, design and multimedia</description>
	<lastBuildDate>Thu, 07 May 2009 11:58:33 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flash Online Designers</title>
		<link>http://www.eastcoastinteractive.co.uk/flash/flash-online-designers/</link>
		<comments>http://www.eastcoastinteractive.co.uk/flash/flash-online-designers/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 12:49:05 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Our Work]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[xhtml/css]]></category>

		<guid isPermaLink="false">http://www.eastcoastinteractive.co.uk/?p=88</guid>
		<description><![CDATA[Flash Online Designers is a division of East Coast Interactive set up specifically to deal with the design, development and licensing of online designers for companies around the globe. Browse our current list of online designers  if you are looking to licence one of our existing online design tools, or contact Flash Online Designers [...]]]></description>
			<content:encoded><![CDATA[<p>Flash Online Designers is a division of East Coast Interactive set up specifically to deal with the design, development and licensing of online designers for companies around the globe. Browse <a title="Current Online Designers" href="http://www.flashonlinedesigners.com/products.html">our current list of online designers </a> if you are looking to licence one of our existing online design tools, or <a title="Contact Flash Online Designers" href="http://www.flashonlinedesigners.com/contact-us.html">contact Flash Online Designers</a> if you would like us to create something different for you.</p>
<p>For further information, head on over to <a title="flash online designers" href="http://www.flashonlinedesigners.com">www.flashonlinedesigners.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.eastcoastinteractive.co.uk/flash/flash-online-designers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>css shorthand</title>
		<link>http://www.eastcoastinteractive.co.uk/xhtmlcss/css-shorthand/</link>
		<comments>http://www.eastcoastinteractive.co.uk/xhtmlcss/css-shorthand/#comments</comments>
		<pubDate>Thu, 26 Jul 2007 08:50:54 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[xhtml/css]]></category>

		<guid isPermaLink="false">http://www.ecinteractive.co.uk/blog/?p=23</guid>
		<description><![CDATA[ok, next up in our exciting tips and tricks for css is my personal favourite&#8230;&#8221;css shorthand&#8221;&#8230;why is this my favourite?&#8230;because this reduces the amount of code we have to write and also streamlines our css by making the file smaller and hence load faster.
There are several areas within css where you can use shorthand, I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>ok, next up in our exciting tips and tricks for css is my personal favourite&#8230;&#8221;css shorthand&#8221;&#8230;why is this my favourite?&#8230;because this reduces the amount of code we have to write and also streamlines our css by making the file smaller and hence load faster.</p>
<p>There are several areas within css where you can use shorthand, I&#8217;m not going into them in great depth here but i will mention what they are, give you an example and you can feel free to investigate them further, this is not intended to be a complete and concise reference, merely a guide to help you on your way.</p>
<p><span id="more-23"></span></p>
<p><strong>Background</strong><br />
So to start with, lets have a look at the background properties, there are five of them below which I&#8217;ve given some values for the purpose of this demo.</p>
<pre>
example
{
 background-color:#fff;
 background-image:url(../images/sample.jpg);
 background-repeat:no-repeat;
 background-position:top left;
 background-attachment:fixed;
}</pre>
<p>The good news it that they can be condensed into one line as so:</p>
<pre>
example
{
 background:#fff url(../images/sample.jpg) no-repeat top left fixed;
}</pre>
<p>job done! moving on.</p>
<p><strong>Font</strong></p>
<pre>
example
{
 font-style:normal;
 font-variant:small-caps;
 font-weight:bold;
 font-size:1em;
 line-height:1.4em;
 font-family:Verdana, Arial, Helvetica, sans-serif;
}</pre>
<p>And the shorthand equivalent:</p>
<pre>
example
{
 font:normal small-caps bold 1em/1.4em Verdana, Arial, Helvetica, sans-serif;
}</pre>
<p><strong>Border</strong><br />
there is a potentialy huge time saver here depending on how you currently work with borders.<br />
firstly the full list of properties available:</p>
<pre>
example
{
 border-top-width:1px;
 border-top-style:solid;
 border-top-color:#000;
 border-right-width:1px;
 border-right-style:solid;
 border-right-color:#000;
 border-bottom-width:1px;
 border-bottom-style:solid;
 border-bottom-color:#000;
 border-left-width:1px;
 border-left-style:solid;
 border-left-color:#000;
}</pre>
<p>and the more common way to work:</p>
<pre>
example
{
 border-width:1px;
 border-style:solid;
 border-color:#000;
}</pre>
<p>And the shorthand equivalent:</p>
<pre>
example
{
 border:1px solid #000;
}</pre>
<p><strong>Margin</strong></p>
<pre>
example
{
 margin-top:1px;
 margin-right:2px;
 margin-bottom:3px;
 margin-left:4px;
}</pre>
<p>And the shorthand equivalent:</p>
<pre>
example
{
 margin:1px 2px 3px 4px;
}</pre>
<p>*side note* i think it was Eric Meyer who came up with the &#8220;trouble&#8221; method of remembering this&#8230;that is T(top)R(right)ouB(bottom)L(left)e. another way is to remember it goes clockwise.</p>
<p><strong>Padding</strong><br />
padding is handled exactly the same way as margin to the shorthand would simply be:</p>
<pre>
example
{
 padding:5px 6px 7px 8px;
}</pre>
<p><strong>List</strong></p>
<pre>
example
{
 list-style-type:square;
 list-style-position:outside;
 list-style-image:url(../images/sample.png);
}</pre>
<p>And the shorthand equivalent:</p>
<pre>
example
{
 list-style:square outside url(../images/sample.png);
}</pre>
<p>And one further shorthand method you may have noticed me using throughout this page, the hex colour code. If you are using colours which are matched in pairs of values (that is three pairs of hexadecimal digits) as in the below examples:</p>
<pre>
#ffffff
#ff0000
#ff00cc</pre>
<p>you can shorten them to 3 digits as follows:</p>
<pre>
#fff
#f00
#f0c</pre>
<p>less typing = less code = faster loading<br />
or<br />
less typing = less code = easier to maintain<br />
or<br />
less typing = more time for beer</p>
<p>the benefits are there for everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eastcoastinteractive.co.uk/xhtmlcss/css-shorthand/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>css classes and id&#8217;s</title>
		<link>http://www.eastcoastinteractive.co.uk/xhtmlcss/css-classes-and-ids/</link>
		<comments>http://www.eastcoastinteractive.co.uk/xhtmlcss/css-classes-and-ids/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 09:27:35 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[xhtml/css]]></category>

		<guid isPermaLink="false">http://www.ecinteractive.co.uk/blog/?p=22</guid>
		<description><![CDATA[css classes and id&#8217;s &#8211; which to use?
An id is used to define a unique element in a page, this is a requirement of xhtml and should be observed. In the xhtml we name it by stating the following:
1id=&#34;&#34;
and in the corresponding css we select it with the hash symbol(#item{})
A class may be used as [...]]]></description>
			<content:encoded><![CDATA[<p>css classes and id&#8217;s &#8211; which to use?</p>
<p>An id is used to define a unique element in a page, this is a requirement of xhtml and should be observed. In the xhtml we name it by stating the following:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">id=&quot;&quot;</div></td></tr></tbody></table></div>
<p>and in the corresponding css we select it with the hash symbol(#item{})</p>
<p>A class may be used as many times as desired in a page. In the xhtml we name it by stating the following:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">class=&amp;quot;&amp;quot;</div></td></tr></tbody></table></div>
<p>and in the corresponding css we select it with the full stop symbol(.item{})</p>
<p>here comes the science&#8230;.</p>
<p><span id="more-22"></span></p>
<p>below is a basic well structured xhtml document with a link to an imaginary stylesheet. Have a quick look at where &#8220;id=&#8221; and &#8220;class=&#8221; are being used.</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px;height:300px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">&amp;lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&amp;gt;<br />
&amp;lt;html&amp;gt;<br />
&amp;lt;head&amp;gt;<br />
&amp;lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&amp;gt;<br />
&amp;lt;title&amp;gt;title&amp;lt;/title&amp;gt;<br />
&amp;lt;meta name=&quot;keywords&quot; content=&quot;&quot; /&amp;gt;<br />
&amp;lt;meta name=&quot;description&quot; content=&quot;&quot; /&amp;gt;<br />
&amp;lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot; /&amp;gt;<br />
&amp;lt;/head&amp;gt;<br />
&amp;lt;body&amp;gt;<br />
&amp;lt;div id=&quot;container&quot;&amp;gt;<br />
&amp;lt;div id=&quot;header&quot;&amp;gt;<br />
&amp;lt;h1&amp;gt;Page heading.&amp;lt;/h1&amp;gt;<br />
&amp;lt;p&amp;gt;Brief description.&amp;lt;/p&amp;gt;<br />
&amp;lt;/div&amp;gt;<br />
&amp;lt;div id=&quot;menu&quot;&amp;gt;<br />
&amp;lt;ul&amp;gt;<br />
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#&quot; title=&quot;&quot; class=&quot;active&quot;&amp;gt;menu item&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;<br />
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#&quot; title=&quot;&quot;&amp;gt;menu item&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;<br />
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#&quot; title=&quot;&quot;&amp;gt;menu item&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;<br />
&amp;lt;li&amp;gt;&amp;lt;a href=&quot;#&quot; title=&quot;&quot;&amp;gt;menu item&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;<br />
&amp;lt;/ul&amp;gt;<br />
&amp;lt;/div&amp;gt;<br />
&amp;lt;div id=&quot;pageContent&quot;&amp;gt;<br />
&amp;lt;div class=&quot;content&quot;&amp;gt;<br />
&amp;lt;p&amp;gt;i am some content&amp;lt;/p&amp;gt;<br />
&amp;lt;/div&amp;gt;<br />
&amp;lt;div class=&quot;content&quot;&amp;gt;<br />
&amp;lt;p&amp;gt;i am some more content&amp;lt;/p&amp;gt;<br />
&amp;lt;/div&amp;gt;<br />
&amp;lt;/div&amp;gt;<br />
&amp;lt;div id=&quot;footer&quot;&amp;gt;<br />
&amp;lt;a href=&quot;http://www.eastcoastinteractive.co.uk&quot; title=&quot;Â©2007 east coast interactive&quot;&amp;gt;Â©2007&amp;lt;/a&amp;gt;<br />
&amp;lt;/div&amp;gt;<br />
&amp;lt;/div&amp;gt;<br />
&amp;lt;/body&amp;gt;<br />
&amp;lt;/html&amp;gt;</div></td></tr></tbody></table></div>
<p>Id&#8217;s are being used here to define the parts that will only exist once and which form the structure of the document. As you can see, this includes, in hierarchical order from the opening of the body tag, the &#8220;container&#8221; element which holds everything below it. Firstly the &#8220;header&#8221; element, then a &#8220;menu&#8221; element, a &#8220;pageContent&#8221; item, (am deliberately ignoring the two items with classes and will get to this in a minute) and finaly the &#8220;footer&#8221; element. These items make up the page structure and will never have more than one instance on the page&#8230;perfect candidates for the ID selector. The corresponding CSS for a couple of these elements could look like this:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">#container<br />
{<br />
position:relative;<br />
width:746px;<br />
border:7px solid #fff;<br />
background-color:#fff;<br />
margin:0 auto;<br />
}</div></td></tr></tbody></table></div>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">#header<br />
{<br />
position:relative;<br />
height:109px;<br />
background:#fff url('../images/head.jpg') no-repeat top right;<br />
}</div></td></tr></tbody></table></div>
<p>So&#8230;classes! In the xhtml example above, you can see two items with class=&#8221;content&#8221;. As there are multiple instances of these &#8220;content&#8221; areas, we give them a class definition to deal with them. An example could be:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:435px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">.content<br />
{<br />
border:1px solid #fff;<br />
padding-top:1.3em;<br />
background-color:#ccc;<br />
}</div></td></tr></tbody></table></div>
<p>As we can see, classes have scope for re-use where id&#8217;s are fixed to one element per document and hopefully it&#8217;s now easier to determine which one to use in your own code.</p>
<p>There is much more that can be said about id&#8217;s and classes, including pseudo classes etc but this is just a very brief introduction to answer a specific question we were asked. We will aim to expand on this with further articles.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eastcoastinteractive.co.uk/xhtmlcss/css-classes-and-ids/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

