<?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>Patrick Perron &#187; Programmation</title>
	<atom:link href="http://www.patrickperron.com/tag/programmation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.patrickperron.com</link>
	<description>Webmaster + Webdesigner + Créateur de projets</description>
	<lastBuildDate>Wed, 03 Nov 2010 14:28:48 +0000</lastBuildDate>
	<language>fr</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Organiser son code CSS clairement</title>
		<link>http://www.patrickperron.com/2008/02/08/organiser-son-code-css-clairement/</link>
		<comments>http://www.patrickperron.com/2008/02/08/organiser-son-code-css-clairement/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 13:00:43 +0000</pubDate>
		<dc:creator>Patrick Perron</dc:creator>
				<category><![CDATA[Tutoriels]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Intégration]]></category>
		<category><![CDATA[Programmation]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.patrickperron.com/2008/02/08/8/</guid>
		<description><![CDATA[Voici une méthode de programmation que j’utilise pour organiser mes CSS dans un fichier externes. Cette méthode vous permettra de vous y retrouver très rapidement et vous fera gagner du temps. Je suppose qu’un fichier xhtml à été créé ainsi qu’un fichier CSS et que celui-ci à été attaché de la manière d’un @import ou [...]]]></description>
			<content:encoded><![CDATA[<p>Voici une méthode de programmation que j’utilise pour organiser mes CSS dans un fichier externes. Cette méthode vous permettra de vous y retrouver très rapidement et vous fera gagner du temps.</p>
<p><span id="more-8"></span></p>
<p>Je suppose qu’un fichier xhtml à été créé ainsi qu’un fichier CSS et que celui-ci à été attaché de la manière d’un <strong>@import</strong> ou d’un <strong>link</strong>. <img style="float: left; margin-right: 15px;" src="http://www.patrickperron.com/imgs/webpage.jpg" alt="" /> Commençons d’abord par le « body » de la page XHTML : Premièrement, coder de manière claire et simple. Utilisez une structure en DIV. Voici à votre gauche un aperçu typique d’un site web très simple : Le tout sera dans une <strong>div</strong> général nommé <strong>« container »</strong> et vous remarquerez que je n’utiliserai pas les majuscules pour nommer mes tags. Sur le plan, les majuscules ont été utilisées seulement pour une meilleure visibilité.</p>
<p>Bon maintenant voici le code XHTML de ce petit design :</p>
<pre>&nbsp;
&lt;div id=&quot;myContainer&quot;&gt;
&lt;div id=&quot;header&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;middle&quot;&gt;
&lt;div id=&quot;left&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;content&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;footer&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
&nbsp;</pre>
<p>Bien entendu, ce code se retrouve dans la tag <strong>BODY</strong>. Ensuite commençons le truc que j’utilise pour accélérer votre travail. Copier le code à l’intérieur de votre tag body et collez-le dans votre fichier CSS. Voici ce que ça donne:</p>
<pre class="css">&nbsp;
&lt;div id=<span style="color: #ff0000;">&quot;myContainer&quot;</span>&gt;
&lt;div id=<span style="color: #ff0000;">&quot;header&quot;</span>&gt;&lt;/div&gt;
&lt;div id=<span style="color: #ff0000;">&quot;middle&quot;</span>&gt;
&lt;div id=<span style="color: #ff0000;">&quot;left&quot;</span>&gt;&lt;/div&gt;
&lt;div id=<span style="color: #ff0000;">&quot;content&quot;</span>&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=<span style="color: #ff0000;">&quot;footer&quot;</span>&gt;&lt;/div&gt;
&lt;/div&gt;
&nbsp;</pre>
<p>Maintenant (en utilisant Dreamweaver) utilisez la fonction de recherche (ou CTRL-F). Recherchez les codes suivants</p>
<pre>&nbsp;
&lt;div id=&quot;
&amp;lt;/pre&amp;gt;
&amp;lt;p&amp;gt;Et remplacez-les par les symboles &amp;lt;strong&amp;gt;#&amp;lt;/strong&amp;gt;. Ensuite recherchez les codes suivants :&amp;lt;/p&amp;gt;
&amp;lt;pre lang=&quot;&gt;
/&amp;gt;&lt;/div&gt;
&nbsp;</pre>
<p>Et remplacez-les par les accolades ouvertes et fermé <strong>{ }</strong>. Pour le reste vous pouvez rechercher les tags <strong>div</strong> de fermeture et les remplacer par rien. Cela vous donnera ceci :</p>
<pre class="css"><span style="color: #cc00cc;">#myContainer</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
   <span style="color: #cc00cc;">#header</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
   <span style="color: #cc00cc;">#middle</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
      <span style="color: #cc00cc;">#left</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
      <span style="color: #cc00cc;">#content</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span>
  <span style="color: #cc00cc;">#footer</span> <span style="color: #66cc66;">&#123;</span><span style="color: #66cc66;">&#125;</span></pre>
<p>Finalement, il ne vous reste qu’à mettre vos largeurs et hauteurs et autres propriétés de vos tags <strong>DIV</strong>. Personnellement, j’ajoute une ligne de commentaire au-dessus de chaque ligne concernant mes sections <strong>(header, middle, footer)</strong>. Voici le code que vous obtiendrez :</p>
<pre class="css"><span style="color: #cc00cc;">#myContainer</span> <span style="color: #66cc66;">&#123;</span>
width<span style="color: #3333ff;">:<span style="color: #933;">760px</span></span>;
height<span style="color: #3333ff;">:auto</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* HEADER */</span>
   <span style="color: #cc00cc;">#header</span> <span style="color: #66cc66;">&#123;</span>
   width<span style="color: #3333ff;">:<span style="color: #933;">760px</span></span>;
   height<span style="color: #3333ff;">:<span style="color: #933;">250px</span></span>;
   <span style="color: #000000; font-weight: bold;">background-color</span>:<span style="color: #cc00cc;">#<span style="color: #933;">666</span></span>;
   <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* MIDDLE */</span>
   <span style="color: #cc00cc;">#middle</span> <span style="color: #66cc66;">&#123;</span>
   width<span style="color: #3333ff;">:<span style="color: #933;">760px</span></span>;
   height<span style="color: #3333ff;">:<span style="color: #933;">500px</span></span>;
   <span style="color: #66cc66;">&#125;</span>
      <span style="color: #cc00cc;">#left</span> <span style="color: #66cc66;">&#123;</span>
	  width<span style="color: #3333ff;">:<span style="color: #933;">160px</span></span>;
	  height<span style="color: #3333ff;">:<span style="color: #933;">500px</span></span>;
	  <span style="color: #000000; font-weight: bold;">background-color</span>:<span style="color: #cc00cc;">#ccc</span>;
	  float<span style="color: #3333ff;">:left</span>;
	  <span style="color: #66cc66;">&#125;</span>
      <span style="color: #cc00cc;">#content</span> <span style="color: #66cc66;">&#123;</span>
	  width<span style="color: #3333ff;">:<span style="color: #933;">600px</span></span>;
	  height<span style="color: #3333ff;">:<span style="color: #933;">500px</span></span>;
	  <span style="color: #000000; font-weight: bold;">background-color</span>:<span style="color: #cc00cc;">#fff</span>;
	  float<span style="color: #3333ff;">:left</span>;
	  <span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/* FOOTER */</span>
   <span style="color: #cc00cc;">#footer</span> <span style="color: #66cc66;">&#123;</span>
   width<span style="color: #3333ff;">:<span style="color: #933;">760px</span></span>;
   height<span style="color: #3333ff;">:<span style="color: #933;">70px</span></span>;
   <span style="color: #000000; font-weight: bold;">background-color</span>:<span style="color: #cc00cc;">#<span style="color: #933;">000</span></span>;
   <span style="color: #66cc66;">&#125;</span></pre>
<p>Pour le reste du code, vous l’insérer à l’intérieur de vos tags et <strong>indentez votre code comme celui de votre XHTML</strong>, vous verrez, ce truc accélèrera votre vitesse d’exécution.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.patrickperron.com/2008/02/08/organiser-son-code-css-clairement/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

