<?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>DivitoDesign &#187; HTML</title> <atom:link href="http://divitodesign.com/category/html/feed/" rel="self" type="application/rss+xml" /><link>http://divitodesign.com</link> <description>Articles, Tutorials and Resources for the Webdesigner</description> <lastBuildDate>Fri, 07 Oct 2011 18:47:18 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>HTML 5: Structuring</title><link>http://divitodesign.com/html/html-5-structuring/</link> <comments>http://divitodesign.com/html/html-5-structuring/#comments</comments> <pubDate>Wed, 10 Nov 2010 20:40:14 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[HTML]]></category><guid isPermaLink="false">http://divitodesign.com/?p=2197</guid> <description><![CDATA[The web has been constantly involving since its invention back in 1969. Webdesigners keep pushing the limits of web pages and their languages to get more functionality in to their web sites. For years we have been working with HTML 4 and XHTML 1.0 to build our web pages, but these languages do not have [...]]]></description> <content:encoded><![CDATA[<p>The web has been constantly involving since its invention back in 1969. Webdesigners keep pushing the limits of web pages and their languages to get more functionality in to their web sites.</p><p>For years we have been working with HTML 4 and XHTML 1.0 to build our web pages, but these languages do not have the functionality the current generation of web professionals ask for. Now there is HTML 5, the upcoming web standard.</p><h2>Background</h2><p>The new version of HTML is under development since 2004 and is a collaboration between the W3C HTML WG and the WHATWG. They work closely together with representatives from the four major browsers creators Apple, Mozilla, Opera and Microsoft.</p><p>On top of these close collaborations everyone can get their input in. There are mailing lists and forums to keep updated and get your own ideas into the process of developing the new web standard.</p><h2>Doctype</h2><p>The idea of HTML 5 is to make things work smarter, faster and more organized on the web. I’ve told you about Doctypes before and they were version specific with earlier versions of HTML. However with HTML5, things have been made easy.</p><p>Add this line above the &lsaquo;html> tag and you are ready to write HTML 5 in your webpage.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html&gt;</span></span></pre></div><h2>Document Structuring</h2><p>Every web designer uses a different way to structure their HTML codes. Usually it comes down to a few sections to develop the framework of the web pages.</p><ul><li>Header section (#header)</li><li>Navigation section (#nav)</li><li>Content area (#content)</li><li>Footer section (#footer)</li></ul><p>These different areas on the site are called for by for example &lsaquo;div id=”header”>. With HTML 5 these sections can be added in a more structured way. The new structure of the webpage can be build like this. Explanation follows below.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre><pre><span class="html"><span class="html-other-element">&lt;header&gt;</span>Document Header<span class="html-other-element">&lt;/header&gt;</span>
<span class="html-other-element">&lt;nav&gt;</span>Navigation<span class="html-other-element">&lt;/nav&gt;</span>
<span class="html-anchor-element">&lt;article&gt;</span>
   <span class="html-other-element">&lt;header&gt;</span>Title<span class="html-other-element">&lt;/header&gt;</span>
   <span class="html-other-element">&lt;section&gt;</span>
      Section #1
    <span class="html-other-element">&lt;/section&gt;</span>
   <span class="html-other-element">&lt;section&gt;</span>
      Section #2
    <span class="html-other-element">&lt;/section&gt;</span>
<span class="html-anchor-element">&lt;/article&gt;</span>
<span class="html-anchor-element">&lt;aside&gt;</span>Sidebar<span class="html-anchor-element">&lt;/aside&gt;</span>
<span class="html-other-element">&lt;footer&gt;</span>Footer<span class="html-other-element">&lt;/footer&gt;</span></span></pre></div><p><img src="http://divitodesign.com/wp-content/uploads/2010/11/structure-435x384.jpg" alt="" title="HTML 5 structure" width="435" height="384" /><br /> <small>The HTML5 structure put in work.</small></p><h3> Headers</h3><p>The new &lsaquo;header> tag can be used to specify the top section of an section of your website. For example, your webpage has a header section and you can use the &lsaquo;header> tag there to define that. But there are more uses for this tag. It can also be used as header of a specific section like the main content:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
</pre><pre><span class="html"><span class="html-anchor-element">&lt;article&gt;</span>
<span class="html-other-element">&lt;header&gt;</span><span class="html-other-element">&lt;h1&gt;</span>The article’s title<span class="html-other-element">&lt;/h1&gt;</span><span class="html-other-element">&lt;/header&gt;</span>
<span class="html-other-element">&lt;section&gt;</span>Paragraph #1<span class="html-other-element">&lt;/section&gt;</span>
<span class="html-other-element">&lt;section&gt;</span>Paragraph #2<span class="html-other-element">&lt;/section&gt;</span>
<span class="html-anchor-element">&lt;/article&gt;</span></span></pre></div><h3>Navigation</h3><p>Many websites have a section on their website to display some general navigation links for users to browse to the website. In HTML5 you can do that via the new &lsaquo;nav> tag. For general usage here is an example:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre><pre><span class="html"><span class="html-other-element">&lt;nav&gt;</span>
<span class="html-other-element">&lt;ul&gt;</span>
	<span class="html-other-element">&lt;li&gt;</span><span class="html-anchor-element">&lt;a href=””&gt;</span>Homepage<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-other-element">&lt;/li&gt;</span>
	<span class="html-other-element">&lt;li&gt;</span><span class="html-anchor-element">&lt;a href=””&gt;</span>About<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-other-element">&lt;/li&gt;</span>
	<span class="html-other-element">&lt;li&gt;</span><span class="html-anchor-element">&lt;a href=””&gt;</span>Contact<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-other-element">&lt;/li&gt;</span>
<span class="html-other-element">&lt;/ul&gt;</span>
<span class="html-other-element">&lt;/nav&gt;</span></span></pre></div><p>When using a navigation structure like Previous and Next (for example with blog posts), you can use the &lsaquo;nav> tag as well.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre><pre><span class="html"><span class="html-other-element">&lt;nav&gt;</span>
<span class="html-anchor-element">&lt;a href=”” class=”previous”&gt;</span>Previous Post<span class="html-anchor-element">&lt;/a&gt;</span>
<span class="html-anchor-element">&lt;a href=”” class=”next”&gt;</span>Next Post<span class="html-anchor-element">&lt;/a&gt;</span>
<span class="html-other-element">&lt;/nav&gt;</span></span></pre></div><h3>Article &#038; Sections</h3><p>The &lsaquo;article> is to define the main content section, just like &lsaquo;div id=”content”> does in HTML4. Inside, place your article, your blog post: the main information you want to show your visitors, but also the search engines.</p><p>Different sections in your content are structured by the &lsaquo;section> tag. Like this:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre><pre><span class="html"><span class="html-anchor-element">&lt;article&gt;</span>
<span class="html-other-element">&lt;header&gt;</span><span class="html-other-element">&lt;h1&gt;</span>The article’s title<span class="html-other-element">&lt;/h1&gt;</span><span class="html-other-element">&lt;/header&gt;</span>

<span class="html-other-element">&lt;section&gt;</span>
	<span class="html-other-element">&lt;h2&gt;</span>Section’s Title<span class="html-other-element">&lt;/h2&gt;</span>
	<span class="html-other-element">&lt;p&gt;</span>Paragraph #1<span class="html-other-element">&lt;/p&gt;</span>
<span class="html-other-element">&lt;/section&gt;</span>

<span class="html-other-element">&lt;section&gt;</span>
	<span class="html-other-element">&lt;h2&gt;</span>Section’s Title #2<span class="html-other-element">&lt;/h2&gt;</span>
	<span class="html-other-element">&lt;p&gt;</span>Paragraph #2<span class="html-other-element">&lt;/p&gt;</span>
<span class="html-other-element">&lt;/section&gt;</span>
<span class="html-anchor-element">&lt;/article&gt;</span></span></pre></div><h3>Aside</h3><p>We can also call this sidebars. Sidebars are there to add additional information to support the main content. It’s pretty easy to use:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
</pre><pre><span class="html"><span class="html-anchor-element">&lt;aside&gt;</span>
	<span class="html-other-element">&lt;h3&gt;</span>Archives<span class="html-other-element">&lt;/h3&gt;</span>
	<span class="html-other-element">&lt;ul&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>2010<span class="html-other-element">&lt;/li&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span>2009<span class="html-other-element">&lt;/li&gt;</span>
	<span class="html-other-element">&lt;/ul&gt;</span>

	<span class="html-other-element">&lt;h3&gt;</span>Resources<span class="html-other-element">&lt;/h3&gt;</span>
	<span class="html-other-element">&lt;ul&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span><span class="html-anchor-element">&lt;a href=””&gt;</span>HTML 5<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-other-element">&lt;/li&gt;</span>
		<span class="html-other-element">&lt;li&gt;</span><span class="html-anchor-element">&lt;a href=””&gt;</span>Semantics in HTML5<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-other-element">&lt;/li&gt;</span>
	<span class="html-other-element">&lt;/ul&gt;</span>
<span class="html-anchor-element">&lt;/aside&gt;</span></span></pre></div><h3>Footer</h3><p>The footer element is suited for the copyright notices applying to the content the website has published. It’s very easy to use.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;footer&gt;</span><span class="html-special-char">&amp;copy;</span> Copyrighted by DivitoDesign. All rights reserved.<span class="html-other-element">&lt;/footer&gt;</span></span></pre></div><p>Please get your thoughts in about structuring Web pages in this manner using HTML5.</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/html/html-5-structuring/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Case Study: Revamping an Existing Site</title><link>http://divitodesign.com/css/case-study-revamping-existing-site/</link> <comments>http://divitodesign.com/css/case-study-revamping-existing-site/#comments</comments> <pubDate>Tue, 27 Apr 2010 21:39:00 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[case study]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[guestpost]]></category><guid isPermaLink="false">http://divitodesign.com/?p=2023</guid> <description><![CDATA[Jacques Soudan, a client and friend I met through DivitoDesign, sent me an email with a guest post about a case study on revamping his outdated site. Enjoy reading about his revamping project. Below is a case-study on how I used the Blueprint CSS Framework and jQuery JavaScript library to rebuild an outdated site &#8211; [...]]]></description> <content:encoded><![CDATA[<p><a href="http://troisj.com/">Jacques Soudan</a>, a client and friend I met through DivitoDesign, sent me an email with a guest post about a case study on revamping his outdated site. Enjoy reading about his revamping project.</p><div class="box">Below is a <strong>case-study</strong> on how I used the <a href="http://www.blueprintcss.org/">Blueprint CSS Framework</a> and <a href="http://jquery.com">jQuery JavaScript library</a> to rebuild an outdated site &#8211; somehow you helped me with it, so in return I share my work, hoping it can be of future use. Thank you!</div><p>The website we are talking about was build back in 2001. As you would understand we are talking about a heavily-aged website that had the following &#8216;problems&#8217; or difficulties:</p><ul><li>using some CSS, but mainly tables</li><li>the menu is a separate JS file: easy to maintain, but it doesn&#8217;t look too good</li><li>a few years ago I added the rounded corners (using JavaScript) and the red backdrop/border, but that doesn&#8217;t look too flashy either</li><li>the source is not W3C compliant (outdated code like &lt;br&gt; &#8211; instead of the current &lt;br/&nsbp;&gt;)</li><li>the footer is embedded in each page (hard to update for about 100 pages)</li><li>in general, look &amp; feel is not &#8216;up to date&#8217;</li><li>the enquiry form uses a JavaScript file that is no longer supported</li><li>in Firefox, the banner is not centered (in IE it is&#8230;..) and looks like this (also in a table &#8211; probably easy to fix, but never got to it):</li></ul><p><a href="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot003.jpg"><img class="alignnone size-large wp-image-2024" title="ScreenShot003" src="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot003-434x192.jpg" alt="" width="434" height="192" /></a></p><p>For a website in the modern internet world, that is not acceptable. For this reason, I compiled a list of features I would like to have on the modern, good looking website.</p><h2>Site Features we Need</h2><ul><li>W3C compliant code</li><li>CSS and HTML in separated files</li><li>browser compatibility</li><li>rounded corners &amp; drop shadow</li><li>1 central menu file</li><li>JavaScript support (instead of using several separate scripts that (might) interfere)</li><li>structured design (layout without tables)</li></ul><h2>Where to Start?</h2><p>Last year I read this very useful article about <a href="http://divitodesign.com/css/building-html-css-sites-use-a-template/">building HTML/CSS sites using a template</a>. This template has a grid CSS layout and the jQuery framework build in. I had seen those before, but was not yet using them in combination with <a href="http://wordpress.org">WordPress</a>.</p><p>I also found this site for <a href="http://www.schillmania.com/projects/dialog2/">dropshadow &amp; rounded corners</a>. As I wanted to avoid too many jQuery plugins, I didn&#8217;t use jQuery for the <a href="http://docs.jquery.com/Tutorials:Rounded_Corners">round corners</a>. So far my experience is that jQuery rounded corners can interfere with other plugins, needing too much work to fix (and warrant) it.</p><p>For this reason, the no-Java-script solution seemed preferable. Provided, it had worked &#8211; it did not &#8211; as it uses several &lt;divs&gt;, it messed up the Blueprint classes, it didn&#8217;t display properly &#8216;underneath&#8217; the header images etc. The typical pain when it comes to CSS and different techniques in different browsers.</p><p>So&#8230;. dropping Blueprint? Or dropping the very sleek (and easy!) rounded corners? Dilemma there&#8230;.. Until playing around with Blueprint a bit more&#8230;. as it comes with grid.png, to display the columns for design purposes, which you can switch off when you go live. But then, if you can remove that backdrop, why not adding your own???? Using my own image I had created for the initial technique, but thought useless now, it worked flawlessly!</p><p>Here is what I did &#8211; in the Blueprint folder, there is a screen.css &#8211; just add one line and comment the grid-line &#8211; that&#8217;s all!</p><p><img class="alignnone size-full wp-image-2025" title="ScreenShot004" src="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot004.jpg" alt="" width="456" height="112" /></p><p>In your container-DIV, just add the &#8216;showgrid&#8217;-class: (you need that anyway, if you want to display the Blueprint-columns):</p><p><img class="alignnone size-full wp-image-2026" title="ScreenShot005" src="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot005.jpg" alt="" width="353" height="162" /></p><p>The grid.png is repeated both horizontally &amp; vertically, but my one large image is not, so it fits perfectly &#8211; I stretched it to 1600px, as the backdrop is hardly &#8216;repeatable&#8217;: it is a scanned letterhead-paper with a unique texture &#8211; using only a small slice/strip and repeating that would make it look unnatural. And I use a footer-image &#8211; including it in php, it neatly fits underneath the length of the actual content &#8211; not the full background image of 1600px &#8211; it &#8216;stretches&#8217; to the maximum height, but resizes to the needed height.</p><p>I wanted to use <a href="http://apycom.com/menus/4-red.html">this menu</a> for this website. One problem though: it has no single menu file (eg. menu.php) you can add to your website. After building that menu.php file myself, the jQuery menu worked perfectly.</p><p>When I created the header.php and footer.php files and included in the website using PHP, they are easily updated in those 100 different pages. Depending on the page of the website, I can now include different images via one page. Pretty efficient.</p><h2>The Template</h2><p>With all this now in place, this is how the code looks like (this is what I will use as the &#8216;page-template&#8217; (there is some test copy in, to show in Blueprint columns &#8211; all the &#8216;body-text&#8217; for an individual page is placed within the &lt;content-div&gt; (both &lt;span&gt;-classes, in blue) &#8211; everything remains in place, no fluid/stretched text (in different browsers).</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre><pre><span class="html"><span class="html-comment">&lt;!-- blueprint --&gt;</span>

<span class="html-comment">&lt;!--[if IE]&gt;
	&lt;link rel=&quot;stylesheet&quot; href=&quot;supportfiles/css/ie.css&quot; mce_href=&quot;supportfiles/css/ie.css&quot; type=&quot;text/css&quot; media=&quot;screen, projection&quot; /&gt;&lt;![endif]--&gt;</span>

<span class="html-script-element">&lt;script src=<span class="html-attribute">&quot;supportfiles/js/jquery.js&quot;</span> type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
 <span class="html-script-element">&lt;script src=<span class="html-attribute">&quot;supportfiles/menu/menu.js&quot;</span> type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;container&quot;</span> class=<span class="html-attribute">&quot;container showgrid&quot;</span>&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;header&quot;</span> class=<span class="html-attribute">&quot;span-24 prepend-top&quot;</span>&gt;</span>
<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;prepend-1 span-22 append-1&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-comment">&lt;!-- end header --&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;CONTENT&quot;</span> class=<span class="html-attribute">&quot;prepend-1 span-22 append-1 prepend-top&quot;</span>&gt;</span>
<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;span-17&quot;</span>&gt;</span>
<span class="html-other-element">&lt;h1&gt;</span>Main content<span class="html-other-element">&lt;/h1&gt;</span>
Put your main text here (17 columns wide).

<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;span-5 last&quot;</span>&gt;</span>
<span class="html-other-element">&lt;h3&gt;</span>Sidebar<span class="html-other-element">&lt;/h3&gt;</span>
Some sidebar on the right (5 columns wide).

<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-comment">&lt;!-- END CONTENT --&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;footer&quot;</span> class=<span class="html-attribute">&quot;span-24&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
<span class="html-comment">&lt;!-- end footer --&gt;</span>

<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-comment">&lt;!-- end container --&gt;</span></span></pre></div><p>Blueprint-grid enabled:</p><p><a href="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot010.jpg"><img class="alignnone size-large wp-image-2028" title="ScreenShot010" src="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot010-435x248.jpg" alt="" width="435" height="248" /></a></p><p>And this is how it looks like (pictures not optimized yet):</p><p><a href="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot008.jpg"><img class="alignnone size-large wp-image-2027" title="ScreenShot008" src="http://divitodesign.com/wp-content/uploads/2010/04/ScreenShot008-435x306.jpg" alt="" width="435" height="306" /></a></p><p>I need to finalize the CSS and do some tweaks here and there, but the very flexible yet sturdy framework is there. You can visit <a href="http://www.troisj.com/bm.com/newindex.php">the live version of the website right here</a> to check how it works.</p><p>Thank you &#8211; I hope this is of help to you &#8211; let me know if you have any questions or feedback by adding a comment.</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/css/case-study-revamping-existing-site/feed/</wfw:commentRss> <slash:comments>35</slash:comments> </item> <item><title>HTML/CSS Template Version 1.0 &#8211; Build Sites Faster &amp; Better</title><link>http://divitodesign.com/css/html-css-template-version-1-0-build-sites-faster-better/</link> <comments>http://divitodesign.com/css/html-css-template-version-1-0-build-sites-faster-better/#comments</comments> <pubDate>Sun, 03 Jan 2010 02:37:22 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[HTML]]></category><guid isPermaLink="false">http://divitodesign.com/?p=1935</guid> <description><![CDATA[Currently, I am up to my ears in the PSD to HTML/CSS conversion work. The client supplies a design that needs to be converted to a valid and cross browser friendly website. The HTML/CSS template that I have been using has been a success for me; my conversion time is faster than before and the [...]]]></description> <content:encoded><![CDATA[<p>Currently, I am up to my ears in the PSD to HTML/CSS conversion work. The client supplies a design that needs to be converted to a valid and cross browser friendly website.</p><p><img class="alignleft" title="HTML/CSS Template" src="http://divitodesign.com/wp-content/uploads/2010/01/template.jpg" alt="HTML/CSS Template" width="121" height="86" /> The <a href="http://divitodesign.com/css/building-html-css-sites-use-a-template/">HTML/CSS template</a> that I have been using has been a success for me; my conversion time is faster than before and the code quality is higher. I’ve released the resource on DivitoDesign for free as well, but that version was a little bit outdated.</p><p>All the new and better coding practices I have been experimenting with to create a HTML/CSS template that works properly for any kind of website, have been build in. Time to release the updated version to the crowd.</p><p>You can find all the information and explanation regarding the <a href="http://divitodesign.com/css/building-html-css-sites-use-a-template/">HTML/CSS template by clicking here</a>. To give you a summery:</p><ul><li>Copy the map and use that as your root-folder of your website.</li><li>The CSS, Images and JavaScript folder are already there,</li><li>Open the index and build your website.</li><li>Template uses <a href="http://www.blueprintcss.org/">Blueprint CSS,</a> <a href="http://jquery.com">jQuery</a>, <a href="http://code.google.com/p/ie7-js/">IE7 JS</a>.</li></ul><p>Try customizing the template layout, CSS and images to your likings and save a couple backups. When you are used to this system, your HTML/CSS skills will increase and be a lot faster and better.</p><p>Version 1.0 has improvements in the following area&#8217;s:</p><ul><li><em>Better CSS commenting</em></li><li><em>Added a Favicon</em></li><li><em>More basic CSS tags</em></li><li><em>Other footer structure</em></li></ul><p>You can download version 1.0 of the HTML/CSS Template by DivitoDesign for free by clicking on the following link.</p><p><a href="http://www.divitodesign.com/wp-content/uploads/html-css-template[divitodesign][1.0].zip">HTML/CSS Template by DivitoDesign.</a></p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/css/html-css-template-version-1-0-build-sites-faster-better/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>Building HTML/CSS Sites: Use a Template</title><link>http://divitodesign.com/css/building-html-css-sites-use-a-template/</link> <comments>http://divitodesign.com/css/building-html-css-sites-use-a-template/#comments</comments> <pubDate>Fri, 27 Feb 2009 13:04:51 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[Featured]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[CSS Frameworks]]></category><guid isPermaLink="false">http://www.divitodesign.com/?p=1494</guid> <description><![CDATA[If you are developing HTML/CSS websites with occasionally a little bit of JavaScript (just like myself), it can be very un-productive to write your basic codes over and over again. For example, if you want to include a JS file for your dropdowns, a CSS framework file and print CSS files every time you start [...]]]></description> <content:encoded><![CDATA[<p>If you are developing HTML/CSS websites with occasionally a little bit of JavaScript (just like myself), it can be very un-productive to write your basic codes over and over again.</p><p>For example, if you want to include a JS file for your dropdowns, a CSS framework file and print CSS files <strong>every time you start working on a new project</strong>, you better read this article for some time-solving solutions.</p><h2>Create a Template for Starting From Scratch</h2><p>We are going to make a <strong>Template Folder</strong> we use every time on a new project. This includes a basic index page, the JS files, the CSS files and our basic images. In my projects, I use these files almost every time:</p><h3>JavaScript (folder /js/)</h3><ul><li>pngFix.js (<a href="http://24ways.org/2007/supersleight-transparent-png-in-ie6">to have transparant PNG files in IE6</a>)</li><li>custom.js (with a search form fix + the <a href="http://htmldog.com/articles/suckerfish/dropdowns/">suckerfish JS</a> to make dropdowns work)</li><li>jQuery.js (to have a good <a href="http://jquery.com/">JS library</a> to start with)</li></ul><h3>CSS (folder /css/)</h3><ul><li><a href="http://www.blueprintcss.org/">Blueprint CSS Framework </a><ul><li>screen.css</li><li>print.css</li><li>ie.css</li></ul></li><li>custom.css (for all my custom styles)</li></ul><h3>Images (folder /images/)</h3><ul><li><a href="http://feedicons.com/">RSS icon</a></li></ul><p>I suggest you take a look at some of these links I provided in the list and check out what you need yourself in a regular project. If you need other JavaScript fixes or basic CSS code, be sure to use them instead and add them in the same way I will describe below.</p><h2 class="tag">Let&#8217;s build our Template&#8217;s Index page</h2><p>I hope you have placed all the files you need in an appropriated folder. For example, I have placed my images in /images/, my CSS files in /css/ and my JavaScript files in /js/.  This will make things look pretty structured.</p><p>Alright, Let&#8217;s start with a standard HTML page:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span>
<span class="html-other-element">&lt;html xmlns=<span class="html-attribute">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
<span class="html-other-element">&lt;head&gt;</span>
<span class="html-other-element">&lt;meta http-equiv=<span class="html-attribute">&quot;Content-Type&quot;</span> content=<span class="html-attribute">&quot;text/html; charset=utf-8&quot;</span> /&gt;</span>
<span class="html-other-element">&lt;title&gt;</span>Untitled Document<span class="html-other-element">&lt;/title&gt;</span>
<span class="html-other-element">&lt;/head&gt;</span>

<span class="html-other-element">&lt;body&gt;</span>
<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre></div><h3>Description + Keywords + Robots</h3><p>Any site needs a <a href="http://www.divitodesign.com/2008/08/seo-keywords-guide/">proper description</a> and maybe some keywords. They won&#8217;t do much to your SEO rankings, but they will help you displaying your search engine results in a proper way. It could also be a good idea to add a meta tag for robots, so your search engine knows they can index your site.<br /> <span id="more-1494"></span><br /> Here is what I have added to my standard META tags. You should add all the following codes + inclusions between the &lt;head&gt;&lt;/head&gt; tags in your HTML page.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
</pre><pre><span class="html"><span class="html-other-element">&lt;meta name=<span class="html-attribute">&quot;description&quot;</span> content=<span class="html-attribute">&quot;&quot;</span> /&gt;</span>
    <span class="html-other-element">&lt;meta name=<span class="html-attribute">&quot;keywords&quot;</span> content=<span class="html-attribute">&quot;&quot;</span> /&gt;</span>
    <span class="html-other-element">&lt;meta name=<span class="html-attribute">&quot;robots&quot;</span> content=<span class="html-attribute">&quot;index,follow&quot;</span> /&gt;</span></span></pre></div><h3>CSS Framework</h3><p>We have to add our CSS Framework first. Depending on the way your framework needs inclusion, here is the <a href="http://www.blueprintcss.org/">Blueprint</a> way:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre><pre><span class="html"><span class="html-comment">&lt;!-- blueprint --&gt;</span>
    <span class="html-other-element">&lt;link rel=<span class="html-attribute">&quot;stylesheet&quot;</span> href=<span class="html-attribute">&quot;css/screen.css&quot;</span> type=<span class="html-attribute">&quot;text/css&quot;</span> media=<span class="html-attribute">&quot;screen, projection&quot;</span> /&gt;</span>
    <span class="html-other-element">&lt;link rel=<span class="html-attribute">&quot;stylesheet&quot;</span> href=<span class="html-attribute">&quot;css/print.css&quot;</span> type=<span class="html-attribute">&quot;text/css&quot;</span> media=<span class="html-attribute">&quot;print&quot;</span> /&gt;</span>
    <span class="html-comment">&lt;!--[if IE]&gt;&lt;link rel=&quot;stylesheet&quot; href=&quot;css/ie.css&quot; type=&quot;text/css&quot; media=&quot;screen, projection&quot; /&gt;&lt;![endif]--&gt;</span></span></pre></div><h3>Custom Styles</h3><p>Next, I think it&#8217;s important to have a custom stylesheet at hand, so let&#8217;s add our <em>custom.css</em> stylesheet.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
</pre><pre><span class="html"><span class="html-comment">&lt;!-- custom stylesheet --&gt;</span>
    <span class="html-other-element">&lt;link rel=<span class="html-attribute">&quot;stylesheet&quot;</span> type=<span class="html-attribute">&quot;text/css&quot;</span> media=<span class="html-attribute">&quot;all&quot;</span> href=<span class="html-attribute">&quot;css/custom.css&quot;</span> /&gt;</span></span></pre></div><h3>JavaScript files</h3><p>Now we have added style to our template, let&#8217;s add some JavaScript. I suggest you include <a href="http://www.jquery.com">jQuery</a> first, because if you include jQuery plugins before the original library, they won&#8217;t work. So, here&#8217;s how I include my JavaScript files:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre><pre><span class="html"><span class="html-comment">&lt;!-- JavaScript --&gt;</span>
    <span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;js/jquery.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
    <span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;js/custom.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
    <span class="html-comment">&lt;!--[if lte IE 6]&gt;&lt;script type=&quot;text/javascript&quot; src=&quot;js/transparant-png.js&quot;&gt;&lt;/script&gt;&lt;![endif]--&gt;</span></span></pre></div><p>Everything we needed to include is done right now. We can now start adding some more code to our template&#8217;s Index file.</p><h2>Structuring codes</h2><p>Depending on your framework, you could add a basic structure between your &lt;body&gt;&lt;/body&gt; tags. Most sites I developed have this structure:</p><ul><li>Container</p><ul><li>Header</li><li>Content<ul><li>Content</li><li>Sidebar 1</li><li>Sidebar 2</li></ul></li><li>Footer</li></ul></li></ul><p>That&#8217;s why I have already created the structure so I can start right away.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre><pre><span class="html"><span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;container&quot;</span> id=<span class="html-attribute">&quot;container&quot;</span>&gt;</span>

    <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;span-24&quot;</span> id=<span class="html-attribute">&quot;header&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span><span class="html-comment">&lt;!-- end header --&gt;</span>

    <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;span-24&quot;</span> id=<span class="html-attribute">&quot;content&quot;</span>&gt;</span>

       <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
       <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
<span class="html-comment">&lt;!--	&lt;div class=&quot;&quot;&gt;&lt;/div&gt; --&gt;</span>

    <span class="html-other-element">&lt;/div&gt;</span><span class="html-comment">&lt;!-- end #content --&gt;</span>

    <span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;span-24&quot;</span> id=<span class="html-attribute">&quot;footer&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span><span class="html-comment">&lt;!-- end #footer --&gt;</span>

<span class="html-other-element">&lt;/div&gt;</span><span class="html-comment">&lt;!-- end container --&gt;</span></span></pre></div><p>As you can see, I haven&#8217;t given my DIV&#8217;s inside my Content DIV any ID and I even commented one of them. This is for the simple reason I don&#8217;t know what I will be adding to the content area yet. Every project is different, however, I usually choose two or three DIV&#8217;s inside the content.</p><h2 class="tag">Our Custom CSS Files</h2><p>Next thing we will do is creating some basic CSS styles.</p><p>For example, it is important to structure your codes pretty well. When you need to work fast, you often work less structured and nice. With the use of a template, the structure is already there. You only need to fill it up.</p><h3>Comments</h3><p>I am not going to teach you how to write structured code as <a href="http://woork.blogspot.com">Woork</a> has some <a href="http://woork.blogspot.com/2008/01/optimize-your-css-files-to-improve-code.html">great</a> <a href="http://woork.blogspot.com/2008/03/write-well-structured-css-file-without.html">tutorials</a> on them. You should always start with the basics details on your project. You can add more or less details in here, that&#8217;s up to you.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre><pre><span class="css"><span class="css-comment">/*
Author:           Stefan Vervoort
Author URI:       http://www.divitomedia.com/
Version:	   0.9

Project:
Description:
*/</span></span></pre></div><p>I think next, a table of contents is appropriated:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre><pre><span class="css"><span class="css-comment">/*
---------------------------------------------------------------------------------------
TABLE OF CONTENTS
	-- RESETS
	-- BASICS
	-- CUSTOM
---------------------------------------------------------------------------------------
*/</span></span></pre></div><p>You should add a heading above each section of your stylesheet. For example, when styling basic stylesheet attributes, you can do it like this:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre><pre><span class="css"><span class="css-comment">/*---------------------------------------------------------------------------------------
--- BASICS
---------------------------------------------------------------------------------------*/</span>
body { }
a { }
a:visited{ }
...</span></pre></div><p>And, next, you add this section to your table of contents. I suggest you only place only your larger sections in your table of contents. This is just a basic lesson in structuring your CSS file.</p><h3>CSS Resets</h3><p>First, I have added a <strong><a href="http://www.divitodesign.com/2008/03/css-resets-to-improve-website-its-browser-compability/">Reset</a></strong>. My personal favorite is the <a href="http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/">Eric Meijers&#8217; Reset Reloaded</a>.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
</pre><pre><span class="css"><span class="css-comment">/*---------------------------------------------------------------------------------------
--- RESETS
---------------------------------------------------------------------------------------*/</span>
html, body, div, span, applet, object, iframe,
	p, blockquote, pre,
	a, abbr, acronym, address, big, cite, code,
	del, dfn, em, <span class="css-property">font, img, ins, kbd, q, s, samp,
	small, strike, strong, sub, sup, tt, var,
	b, u, i, center,
	dl, dt, dd, ol, ul, li,
	fieldset, form, label, legend,
	table, caption, tbody, tfoot, thead, tr, th, td {
		margin<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
		<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
		<span class="css-property">border<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
		<span class="css-property">outline<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
		<span class="css-property">font-size<span class="css-selector">:</span><span class="css-value"> 100%</span></span>;
		<span class="css-property">vertical-align<span class="css-selector">:</span><span class="css-value"> baseline</span></span>;
		<span class="css-property">background<span class="css-selector">:</span><span class="css-value"> transparent</span></span>;
	}
	body {
		<span class="css-property">line-height<span class="css-selector">:</span><span class="css-value"> 1</span></span>;
	}
	ol, ul {
		<span class="css-property">list-style<span class="css-selector">:</span><span class="css-value"> none</span></span>;
	}
	blockquote, q {
		<span class="css-property">quotes<span class="css-selector">:</span><span class="css-value"> none</span></span>;
	}
	blockquote:before, blockquote:after,
	q:before, q:after {
		<span class="css-property">content<span class="css-selector">:</span><span class="css-value"> <span class="css-string">''</span></span></span>;
		<span class="css-property">content<span class="css-selector">:</span><span class="css-value"> none</span></span>;
	}

	:focus {
		<span class="css-property">outline<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
	}

	ins {
		<span class="css-property">text-decoration<span class="css-selector">:</span><span class="css-value"> none</span></span>;
	}
	del {
		<span class="css-property">text-decoration<span class="css-selector">:</span><span class="css-value"> line-through</span></span>;
	}

	table {
		<span class="css-property">border-collapse<span class="css-selector">:</span><span class="css-value"> collapse</span></span>;
		<span class="css-property">border-spacing<span class="css-selector">:</span><span class="css-value"> 0</span></span>;
	}</span></pre></div><h3>The basics</h3><p>The next thing I have added are a couple basic styles, without adding to much behavior. I have added default font sizes, some classes I always use (like .left, .right, .clear, .padding) and some image styles. Be sure to include your own preference in there too.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre><pre><span class="css"><span class="css-comment">/*---------------------------------------------------------------------------------------
--- BASICS
---------------------------------------------------------------------------------------*/</span>
html{		<span class="css-property">font-size<span class="css-selector">:</span><span class="css-value">100%</span></span>;	<span class="css-property">min-height<span class="css-selector">:</span><span class="css-value">101%</span></span>;}
body{		<span class="css-property">font-size<span class="css-selector">:</span><span class="css-value">62.5%</span></span>; <span class="css-property">color<span class="css-selector">:</span><span class="css-value">#666</span></span>;}

a{		}
a:hover{	}
a:active{	}
a:visited{	}

.<span class="css-property">left{		float<span class="css-selector">:</span><span class="css-value">left</span></span>; }
.<span class="css-property">right{	float<span class="css-selector">:</span><span class="css-value">right</span></span>; }
.<span class="css-property">clear{	clear<span class="css-selector">:</span><span class="css-value">both</span></span>; }

img.<span class="css-property">left{	margin<span class="css-selector">:</span><span class="css-value">0 1em 1em 0</span></span>; }
img.<span class="css-property">right{	margin<span class="css-selector">:</span><span class="css-value">0 0 1em 1em</span></span>; }

.<span class="css-property">padding{	padding<span class="css-selector">:</span><span class="css-value">10px</span></span>; }
#<span class="css-property">content p{	margin<span class="css-selector">:</span><span class="css-value">1.1em 0</span></span>; }</span></pre></div><h3>Dropdown Menu</h3><p>Because I tend to use a dropdown menu in all my latest projects, I have all the styles added to my stylesheet to make the dropdown menu work proper, just without color styles. This makes it easy for me to style these menu&#8217;s easily.</p><p>If you want to use the <a href="http://htmldog.com/articles/suckerfish/">suckerfish dropdown menu</a> and want to add some basic behavior to your stylesheet, here are my codes. I always place my navigation menu inside a DIV with ID <em>navigation</em>.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre><pre><span class="css"><span class="css-comment">/* ------------------------------------------------------------------------------------
NAVIGATION MENU				 */</span>
#navigation, #navigation ul {		<span class="css-property">padding<span class="css-selector">:</span><span class="css-value">0</span></span>;	<span class="css-property">margin<span class="css-selector">:</span><span class="css-value">0</span></span>; <span class="css-property">list-style<span class="css-selector">:</span><span class="css-value">none</span></span>; <span class="css-property">line-height<span class="css-selector">:</span><span class="css-value">1</span></span>; <span class="css-property">float<span class="css-selector">:</span><span class="css-value">left</span></span>;	}
#navigation a {			<span class="css-property">display<span class="css-selector">:</span><span class="css-value">block</span></span>; <span class="css-property">padding<span class="css-selector">:</span><span class="css-value">6px 10px</span></span>; <span class="css-property">text-decoration<span class="css-selector">:</span><span class="css-value">none</span></span>;	}
#navigation a:hover{			<span class="css-property">text-decoration<span class="css-selector">:</span><span class="css-value">underline</span></span>; <span class="css-property">padding<span class="css-selector">:</span><span class="css-value">6px 10px</span></span>; }
#navigation li { 			<span class="css-property">float<span class="css-selector">:</span><span class="css-value">left</span></span>; <span class="css-property">width<span class="css-selector">:</span><span class="css-value">auto</span></span>;	}
#navigation li{			<span class="css-property">padding<span class="css-selector">:</span><span class="css-value">0</span></span>; <span class="css-property">margin<span class="css-selector">:</span><span class="css-value">0</span></span>; }
#navigation li ul li{			<span class="css-property">padding<span class="css-selector">:</span><span class="css-value">1px 0px</span></span>;}
#navigation li ul li a{		<span class="css-property">padding<span class="css-selector">:</span><span class="css-value">6px 10px</span></span>; <span class="css-property">width<span class="css-selector">:</span><span class="css-value">110px</span></span>; }
#navigation li ul { 			<span class="css-property">position<span class="css-selector">:</span><span class="css-value">absolute</span></span>; <span class="css-property">padding-top<span class="css-selector">:</span><span class="css-value">1px</span></span>; <span class="css-property">width<span class="css-selector">:</span><span class="css-value">130px</span></span>; <span class="css-property">left<span class="css-selector">:</span><span class="css-value">-999em</span></span>; }
#navigation li ul ul {			<span class="css-property">margin<span class="css-selector">:</span><span class="css-value"> -1.5em 0 0 130px</span></span>;	}

#navigation li:hover ul ul, #navigation li:hover ul ul ul, #navigation li.sfhover ul ul, #navigation li.sfhover ul ul ul {	<span class="css-property">left<span class="css-selector">:</span><span class="css-value"> -999em</span></span>;	}
#navigation li:hover ul, #navigation li li:hover ul, #navigation li li li:hover ul,
#navigation li.sfhover ul, #navigation li li.sfhover ul, #navigation li li li.sfhover ul { <span class="css-property">left<span class="css-selector">:</span><span class="css-value"> auto</span></span>;	}</span></pre></div><h3>Site Structure</h3><p>It&#8217;s easy to gather all your structure DIV&#8217;s and put their ID&#8217;s under each other. This way you always know where to look when something isn&#8217;t right in your structure.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre><pre><span class="css"><span class="css-comment">/* ------------------------------------------------------------------------------------
STRUCTURE					 */</span>
#container{	<span class="css-property">overflow<span class="css-selector">:</span><span class="css-value">hidden</span></span>; <span class="css-property">border<span class="css-selector">:</span><span class="css-value">solid #000</span></span>; <span class="css-property">border-width<span class="css-selector">:</span><span class="css-value">0 2px</span></span>; <span class="css-property">font-size<span class="css-selector">:</span><span class="css-value">1.5em</span></span>; }
#header{}
#footer{	<span class="css-property">clear<span class="css-selector">:</span><span class="css-value">both</span></span>; }
#<span class="css-property">content{</span>}
#<span class="css-property">right{</span>}
#<span class="css-property">left{		</span>}</span></pre></div><h3>Time for the custom code</h3><p>My default styles I use in any project are in my stylesheet now. One thing I do next is adding this comment:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
</pre><pre><span class="css"><span class="css-comment">/* ------------------------------------------------------------------------------------
CUSTOM				 */</span></span></pre></div><p>Which means, we are ready to start.</p><h2>Template Done</h2><p>We are ready to start developing with our new template system. Remember to always make a copy of your template before you start editing there. If you don&#8217;t do that you will loose your basic template, because you&#8217;ll save custom files over your original.</p><p>One tip I can give you is to email your template to your own email address. Once you, accidentally, lost your original template, you will be able to retrieve your original one! <a href="http://www.divitodesign.com/2008/05/back-up-your-wordpress-installation/">A backup is a live saver</a>.</p><h2>Download my Template</h2><p>I can give you my template to use on your own projects and you will have everything all together. I hope you see the advantages of this way of starting on a project and I hope it&#8217;ll save you some time.</p><p><a href="http://www.divitodesign.com/wp-content/uploads/css-html-template{divitodesign}.zip">Download HTML-CSS-Template.</a></p><h2>Any Tips?</h2><p>If you spot any faults in the code, or if you think some code can be optimized, or if you have some tips to add to the template, <a href="http://www.divitodesign.com/2009/02/building-html-css-sites-use-a-template/">don&#8217;t hesitate to leave a comment</a>!</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/css/building-html-css-sites-use-a-template/feed/</wfw:commentRss> <slash:comments>59</slash:comments> </item> <item><title>66 Links To Learn The Webdesign Basics</title><link>http://divitodesign.com/css/66-links-to-learn-the-webdesign-basics/</link> <comments>http://divitodesign.com/css/66-links-to-learn-the-webdesign-basics/#comments</comments> <pubDate>Mon, 25 Aug 2008 20:11:54 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[Guide]]></category> <category><![CDATA[Resources]]></category><guid isPermaLink="false">http://www.divitodesign.com/?p=437</guid> <description><![CDATA[In the past, DivitoDesign has learned you how to start blogging and many people have learned from that. So I thought, why not give beginners some articles that help you to start with webdesign in general.I remember the time I started out and it wasn&#8217;t easy, simply because I didn&#8217;t know where to begin. It&#8217;s [...]]]></description> <content:encoded><![CDATA[<p>In the past, DivitoDesign has learned you <a href="http://www.divitodesign.com/start-blogging-how-to-start-blogging-guide/">how to start blogging</a> and many people have learned from that. So I thought, why not give beginners some articles that help you to start with webdesign in general.I remember the time I started out and it wasn&#8217;t easy, simply because I didn&#8217;t know where to begin. It&#8217;s time to change that. Here are some of the best articles and sites from around the internet that will learn you all the basics you need.</p><p><strong>General</strong></p><ul><li><a href="http://www.advancedwebdesign.com/web-design-guide">&#8220;What is Webdesign&#8221; guide</a></li><li><a href="http://www.alistapart.com/articles/understandingwebdesign">Understanding Webdesign</a></li><li>Validate <a href="http://validator.w3.org/">HTML</a> / <a href="http://jigsaw.w3.org/css-validator/">CSS</a> (Very important!)</li><li><a href="http://validator.w3.org/docs/why.html">Why validate?</a></li></ul><p><strong>Programs</strong></p><ul><li><a href="http://www.adobe.com/products/photoshop/index.html">Adobe Photoshop CS3</a> (Design)<a href="http://www.good-tutorials.com/tutorials/photoshop"><br /> </a></li><li><a href="http://www.gimp.org/">GIMP</a> (Design)</li><li><a href="http://www.adobe.com/products/dreamweaver/">Adobe DreamWeaver</a> (HTML/CSS/PHP editing)<a href="http://www.tutorialized.com/tutorials/Dreamweaver/1"></a></li><li><a href="http://www.nvu.com/">NVU</a> (HTML/CSS editing)</li></ul><p><strong>HTML</strong></p><ul><li><a href="http://www.htmlgoodies.com/primers/html/article.php/3478131">HTML Basics</a></li><li><a href="http://www.w3schools.com/html/DEFAULT.asp">W3Schools &#8211; HTML reference</a></li><li><a href="http://www.ncsu.edu/cc/edu/html_trng/html_basics.html">HTML Tutorial</a></li></ul><p><span id="more-437"></span></p><p><strong>CSS</strong></p><ul><li><a href="http://www.cssbasics.com/">CSS Basics</a></li><li><a href="http://www.westciv.com/style_master/academy/css_tutorial/">Complete CSS Guide + Reference list</a></li><li><a href="http://www.w3schools.com/css/">W3Schools &#8211; CSS reference</a></li><li><a href="http://bucarotechelp.com/download/design/basicss.asp">Free CSS Ebook &#8211; Need to subscribe to the RSS feed to download the Ebook!</a></li></ul><p><strong>Design</strong></p><ul><li><a href="http://www.good-tutorials.com/tutorials/photoshop">Photoshop tutorials</a></li><li><a href="http://www.gimp-tutorials.com/">GIMP tutorials</a></li><li><a href="http://www.photoshopessentials.com/basics/">Photoshop Basics</a></li><li><a href="http://morris-photographics.com/photoshop/shortcuts/index.html">Photoshop Shortcuts</a></li><li><a href="http://www.entheosweb.com/photoshop/layout.asp">Create a weblayout in Photoshop + Dreamweaver</a></li><li><a href="http://dzineblog.com/2008/07/best-photoshop-layout-design-tutorials.html">27 &#8220;how to design a website&#8221; tutorials in one place</a></li></ul><p><strong>Site Structure</strong></p><ul><li><a href="http://webstyleguide.com/site/basic_structures.html">Basic Site Structures</a></li><li><a href="http://nettuts.com/site-builds/from-psd-to-html-building-a-set-of-website-designs-step-by-step/">From Design to HTML &#8211; Step by Step</a></li><li><a href="http://www.partdigital.com/tutorials/convert-web/">From PSD to HTML</a></li></ul><p><strong>Tutorial Sites</strong></p><ul><li><a href="http://www.pixel2life.com/">Pixel2Life</a></li><li><a href="http://www.good-tutorials.com/">Good-Tutorials</a></li><li><a href="http://nettuts.com/">Nettuts</a> / <a href="http://www.psdtuts.com/">PSDtuts</a></li><li><a href="http://www.tutorialsphere.com/">TutorialSphere</a></li></ul><p><strong>Colors<br /> </strong></p><ul><li><a href="http://www.colourlovers.com/">ColourLovers</a></li><li><a href="http://webdesign.about.com/cs/color/a/aacolortheory.htm">Colors In Webdesign</a></li><li><a href="http://www.webdesign.org/web/web-design-basics/color-theory/">Color Theory</a></li><li><a href="http://websitetips.com/color/">Color Tips</a></li></ul><p><strong>Resources</strong></p><ul><li><a href="http://www.brusheezy.com/">Photoshop Brushes</a></li><li><a href="http://www.brushking.eu">Photoshop Brushes II</a></li><li><a href="http://browse.deviantart.com/resources/applications/patterns/#order=9">Photoshop Patterns</a></li><li><a href="http://www.dezinerfolio.com/2007/03/14/ultimate-web-20-gradients-free-download/">Photoshop Layer Styles</a></li><li><a href="http://wordpress.org/extend/plugins/">WordPress Plugins</a></li><li><a href="http://wordpress.org/extend/themes/">WordPress Themes</a></li></ul><p><strong>Stock Images</strong></p><ul><li><a href="http://www.deviantart.com/#catpath=resources/stockart&amp;order=9">DeviantArt&#8217;s Stock images collection</a></li><li><a href="http://www.sxc.hu/">Stock Xchng</a> (Free!)</li><li><a href="http://www.istockphoto.com/">iStockPhoto</a> (paid)<a href="http://www.istockphoto.com/"><br /> </a></li><li><a href="http://www.freestockimages.net/">Free Stock Images</a></li></ul><p><strong>Search Engines</strong></p><ul><li><a href="http://searchenginewatch.com/showPage.html?page=2168031">How Search Engines Work</a></li><li><a href="http://www.googlerankings.com/basic.php">Search Engine Optimizing Basics</a></li><li><a href="http://www.nowsell.com/internet-marketing-basics/off-site-seo.html">Off-Site Search Engine Optimizing</a></li><li><a href="http://www.searchenginejournal.com/12-basic-on-site-seo-tactics-for-optimized-results/5966/">On-Site SEO</a></li><li><a href="http://www.xml-sitemaps.com/">Add a Sitemap to your website</a></li></ul><p><strong>Inspiration</strong></p><ul><li><a href="http://bestwebgallery.com/">BestWebGallery</a></li><li><a href="http://www.stylegala.com/">StyleGala</a></li><li><a href="http://www.cssdrive.com/">CSS Drive</a></li><li><a href="http://cssvault.com/">CSS Vault</a></li><li><a href="http://webcreme.com/">Web Creme</a></li><li><a href="http://www.cssleak.com/">CSSLeak</a></li></ul><p><strong>Fonts / Typography</strong></p><ul><li><a href="http://en.wikipedia.org/wiki/Typography">Wikipedia &#8211; Typography</a></li><li><a href="http://ilovetypography.com/">I love Typography</a></li><li><a href="http://freelancefolder.com/typography-essentials-a-getting-started-guide/" target="_blank">Typography Essentials &#8211; A Getting Started Guide</a></li><li><a href="http://www.divitodesign.com/2008/08/fonts-on-the-internet-what-are-our-options/">Fonts On the Internet</a></li><li><a href="http://www.dafont.com/">DaFont</a></li></ul><p><strong>Usability and Accessibility</strong></p><ul><li><a href="http://www.usability.gov/basics/">Usability basics</a></li><li><a href="http://www.webcredible.co.uk/user-friendly-resources/web-accessibility/basics.shtml">Accessibility basics</a></li><li><a href="http://www.webdevlounge.com/articles/accessibility-top-ten-tips/">Accessibility top 10 tips</a></li><li><a href="http://www.smashingmagazine.com/2007/10/09/30-usability-issues-to-be-aware-of/" target="_blank">30 Usability Issues to Be Aware Of</a></li></ul><p><strong>Blogging</strong></p><ul><li><a href="http://www.divitodesign.com/start-blogging-how-to-start-blogging-guide/">Start Blogging Guide</a></li><li><a href="http://elearningtech.blogspot.com/2006/10/top-ten-reasons-to-blog-and-top-ten.html">Reasons Why / Why Not To blog</a></li><li><a href="http://www.wordpress.org/">WordPress</a></li><li><a href="http://www.blogger.com">Blogger</a></li></ul><h2>Suggestions?</h2><p>If you think a beginner would benefit from an article you have wrote or which you have found, feel free to <a href="#respond">leave a comment</a> with the link, or send me an <a href="/contact/">email</a>!</p><p>For more articles on webdesign, blogging, CSS or Seach engine optimizing, consider subscribing to the <a href="http://feeds.feedburner.com/DivitoDesign">RSS feed</a>.</li> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/css/66-links-to-learn-the-webdesign-basics/feed/</wfw:commentRss> <slash:comments>62</slash:comments> </item> <item><title>HTML &#8211; ABBR Property to Explain Abbreviations</title><link>http://divitodesign.com/html/html-abbr-property-to-explain-abbreviations/</link> <comments>http://divitodesign.com/html/html-abbr-property-to-explain-abbreviations/#comments</comments> <pubDate>Sun, 01 Jun 2008 16:42:44 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[HTML]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Search Engine Optimizing]]></category> <category><![CDATA[Web Accesibility]]></category><guid isPermaLink="false">http://www.divitodesign.com/?p=106</guid> <description><![CDATA[HTML has many properties. There are a couple of them we don&#8217;t use that often and we will discuss one today. It is called the ABBR property and is used to explain and mark-up abbreviations. We bloggers write for the web and we shouldn&#8217;t forget the text should be understandable for everyone. You might have [...]]]></description> <content:encoded><![CDATA[<p>HTML has many properties. There are a couple of them we don&#8217;t use that often and we will discuss one today. It is called the ABBR property and is used to explain and mark-up abbreviations. We bloggers write for the web and we shouldn&#8217;t forget the text should be understandable for everyone.</p><p>You might have seen news sites and information websites use this property. In the text, an abbreviation is underlined with a little gray and dashed line. When your mouse rolls over that link-look-alike, you come to the conclusion it is something else. An explanation about the abbreviation shows up. You might have seen this property more than you think.</p><p>Ok. But what is the point of using ABBR in your website? These arguments should convince you:</p><p><strong>1. Better for Accessibility</strong> &#8211; Using ABBR properties in your website will only optimize the accessibility of your website. Some visitors might don’t know terms like &#8220;SQL&#8221;, &#8220;AI&#8221; or &#8220;NASA&#8221;. Look at yourself, do you know them all? You should try as hard as possible to make your content as accessible as possible.</p><p><strong>2. Educate your visitors</strong> &#8211; Many websites and blogs are here to teach people with their knowledge. Those have different subjects and different visitors. When they are reading an article, everything should be clear about the topic. When acronyms or abbreviations aren&#8217;t clear enough, the visitor might do not understand the whole article.<br /> <span id="more-106"></span><br /> <strong>3. Multiple purposes</strong> &#8211; Not only are you educating your visitors, you will make it easier for spell checkers, translators and speech synthesizers to understand the meaning of an abbreviation and therefore the meaning of a sentence.</p><p><strong>4. Search engine optimizing</strong> &#8211; Another advantage is the search engine (yes, they are everywhere!). When you are using an abbreviation instead of a couple keywords, the <abbr title="Search Engine">SE</abbr> isn&#8217;t totally clear what you mean and therefore they couldn&#8217;t display the most accurate data to their users.</p><p>When you are using the ABBR function in HTML, it will explain the abbreviation to the search engine as well and you have yourself an extra keyword. Always great, right?</p><h2>How to use ABBR?</h2><p>ABBR is not hard to use. It only uses the &#8220;title&#8221; tag to explain the abbreviation. As always, CSS is around the corner to style your ABBR tag in a way you prefer.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-anchor-element">&lt;abbr title=<span class="html-attribute">&quot;Structured Query Language&quot;</span>&gt;</span>SQL<span class="html-anchor-element">&lt;/abbr&gt;</span></span></pre></div><p>When you add ABBR to an other &#8220;SQL&#8221; abbreviation elsewhere in the page, <abbr></abbr> around it is everything you need to do.</p><h2>When ABBR, and when Acronym?</h2><p>Some abbreviations like &#8220;URL&#8221; and &#8220;SQL&#8221; are pronounced letter by letter by some, and as a normal word by others. The ABBR property should be used in these cases. Other abbreviations are just normal &#8216;words&#8217; like &#8220;NAVO&#8221; or &#8220;ASAP&#8221;. Those should be surrounded by the acronym property.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
</pre><pre><span class="html"><span class="html-anchor-element">&lt;abbr title=<span class="html-attribute">&quot;Structured Query Language&quot;</span>&gt;</span>SQL<span class="html-anchor-element">&lt;/abbr&gt;</span>
<span class="html-anchor-element">&lt;acronym title=<span class="html-attribute">&quot;Naval Oceanographic Office&quot;</span>&gt;</span>NAVO<span class="html-anchor-element">&lt;/acronym&gt;</span></span></pre></div><h2>Disadvantages?</h2><p>Everything has its disadvantages. The use on a blog or website has a major problem. Internet Explorer will not play along as it simply doesn&#8217;t recognize the property.</p><p>But there is a solution for Internet Explorer. We can add something extra HTML to the original codes:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-anchor-element">&lt;abbr title=<span class="html-attribute">&quot;Structured Query Language&quot;</span>&gt;</span><span class="html-other-element">&lt;span class=<span class="html-attribute">&quot;abbr&quot;</span> title=<span class="html-attribute">&quot;Structured Query Language&quot;</span>&gt;</span>SQL<span class="html-other-element">&lt;/span&gt;</span><span class="html-anchor-element">&lt;/abbr&gt;</span></span></pre></div><p>In Internet Explorer, ABBR isn&#8217;t recognized and therefore not styled. The extra span is there to get this done in another way. Below are the style declarations you should use if you want your visitors to think they are dealing with the original ABBR property:</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
</pre><pre><span class="css">abbr, acronym, .abbr {
  <span class="css-property">cursor<span class="css-selector">:</span><span class="css-value"> help</span></span>;
  <span class="css-property">border-bottom<span class="css-selector">:</span><span class="css-value"> 1px dashed #ccc</span></span>;
}</span></pre></div><h2>Conclusion</h2><p>Internet Explorer is always bugging a webdesigner. All we can do is waiting until all IE users switch to a better browser. This is hard to achieve and in the meantime&#8230; We have to live with it.</p><p>I think the advantages of this property really are great, and the Internet Explorer problem is not that big. Thanks for your time.</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/html/html-abbr-property-to-explain-abbreviations/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Guide to HTML Emails</title><link>http://divitodesign.com/html/guide-to-html-emails/</link> <comments>http://divitodesign.com/html/guide-to-html-emails/#comments</comments> <pubDate>Fri, 16 May 2008 10:52:27 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[HTML]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Guide]]></category><guid isPermaLink="false">http://www.divitodesign.com/?p=95</guid> <description><![CDATA[This guide will tell you exactly what HTML emails are, how to make them and how to design your HTML emails. What are HTML emails? HTML emails are emails send with mark-up. Most of the time, an email just contains letters and words to bring over a message to the recipient. It doesn&#8217;t need any [...]]]></description> <content:encoded><![CDATA[<p><em>This guide will tell you exactly what HTML emails are, how to make them and how to design your HTML emails.</em></p><h2>What are HTML emails?</h2><p>HTML emails are emails send with mark-up. Most of the time, an email just contains letters and words to bring over a message to the recipient. It doesn&#8217;t need any fancy colors or tables. HTML emails can be used to make the user experience more entertaining and can be used to focus the visitors’ attention to the most important parts.</p><h2>Why should you use HTML emails?</h2><p>When you are in the blogging or publishing industry you might want to send a newsletter to inform your regular visitors of new articles, updates and/or news. Most of the time, to keep your subscribers entertained, a more professional look is required. Or you want to point visitors in the direction of a great headline. This all can be achieved by using HTML emails with CSS in a proper way.</p><h2>Do HTML emails always look good?</h2><p>To give your HTML email a proper look, we should watch out for a couple points. As you might know, <em>HTML</em> and <em>CSS</em> are rendered slightly different by different browsers. Email clients have this problem as well. All Web-based (Gmail, Hotmail) and standalone clients (Outlook, Thunderbird) will react different.</p><p>When you have designed a website, you have to check for browser-compability by simple checking your webpage in different browsers. What we are going to with HTML has the same principle. We will test the email in different clients.<br /> <span id="more-95"></span></p><h2>Designing HTML emails</h2><p>Designing emails has the same principles as designing websites. You should grab the users’ attention, without loosing accessibility and usability out of sight.</p><p>To make sure your email looks as good as possible in as many clients as possible, it is advised to use the simplest elements. <a href="http://www.anandgraves.com/html-email-validator/">Validating your email</a> is a good step in the right position!</p><h3>Simple elements</h3><p>Some elements are used for a longer time, and usually an email client will have a better support for those elements. For example, <em>Div</em>&#8216;s will not get supported by most clients, but <em>tables</em> are supported much better. The reason is simple; <em>div</em>&#8216;s are relative new compared to <em>tables</em>.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre><pre><span class="html"><span class="html-table-element">&lt;table border=<span class="html-attribute">&quot;0&quot;</span>&gt;</span>
<span class="html-table-element">&lt;tbody&gt;</span>
<span class="html-table-element">&lt;tr&gt;</span>
<span class="html-table-element">&lt;td&gt;</span><span class="html-table-element">&lt;/td&gt;</span>
<span class="html-table-element">&lt;/tr&gt;</span>
<span class="html-table-element">&lt;/tbody&gt;</span><span class="html-table-element">&lt;/table&gt;</span></span></pre></div><h3>Stylesheets</h3><p>Because we are using CSS to style our HTML elements, we have to add style declarations. Strangely, his is not possible in the regular way. Extern stylesheets are ignored by most of the email clients. Extern stylesheets are stylesheets called for via a tag in the HTML, or via the <em>@import</em> attribute. We have to use <strong>inline</strong> CSS to style our elements.</p><p>Styles can be declared as <em>&lt;style&gt;</em> in the <em>&lt;head&gt;&lt;/head&gt;</em> area as well. Some email clients doesn&#8217;t read those, so it is advised to use inline styles.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-anchor-element">&lt;a style=<span class="html-attribute">&quot;<span class="css"><span class="css"><span class="css-property">color<span class="css-selector">:</span><span class="css-value"> #333</span></span>; <span class="css-property">text-decoration<span class="css-selector">:</span><span class="css-value"> none</span></span>;</span></span>&quot;</span>&gt;</span><span class="html-anchor-element">&lt;/a&gt;</span></span></pre></div><h3>Images</h3><p>Images aren&#8217;t something that you should use to show important information in your email. Spammers abuse images to bring over the spam message and as a result, email clients usually give the recipient the choice to show images. Therefore, always add an ALT tag so people can recognize what the image is about, and so does the email client. Otherwise your email might get flagged as spam and will not get to your receiver.</p><h3>The fold</h3><p>The fold in websites is the area of that website you can view without scrolling. In email messages, a fold area is important as well, and you have to make sure the most important information and headlines are above the fold. Remember an email client (especially web-based) has a lot of buttons above your email, which makes the fold higher as a website. Remember to place the most important information as high as possible in your email to make sure people sees the important parts first by using contrast!</p><h2>All points in a list</h2><h3>You should&#8230;</h3><ol><li> Validate your email</li><li>Use inline styles</li><li>Use tables</li><li> Test your email in different email clients (Web-based + Standalone)</li><li>Place the most important information as high as possible.</li></ol><h3>You should not&#8230;</h3><ol><li>Use external or embedded stylesheets</li><li> Use to many images (Don&#8217;t display your whole email in images)</li><li>Make your email to hard to read (contrast should be alright)</li><li>Use div&#8217;s with style declaration &#8216;float&#8217;.</li><li>Put headlines and important information under the fold.</li></ol><h2>Questions?</h2><p>If you have any questions regarding this article or if you don&#8217;t understand a tip I gave, please let me know. I will answer your questions and help you out! Please post a comment or <a href="contact/" title="contact me">contact me</a></p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/html/guide-to-html-emails/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Z-Index : Overlap HTML Elements With CSS</title><link>http://divitodesign.com/css/z-index-overlap-html-elements-with-css/</link> <comments>http://divitodesign.com/css/z-index-overlap-html-elements-with-css/#comments</comments> <pubDate>Tue, 06 May 2008 11:25:04 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[CSS]]></category> <category><![CDATA[HTML]]></category> <category><![CDATA[Guide]]></category><guid isPermaLink="false">http://www.divitodesign.com/?p=91</guid> <description><![CDATA[Via this guide, you will learn what a Z-Index is and how to use this property to overlap HTML elements with CSS. What is a Z-Index Z-index is an property in CSS and has been included in CSS because people asked for an property with the possibility to make HTML elements overlap. Overlapping HTML elements [...]]]></description> <content:encoded><![CDATA[<p><em>Via this guide, you will learn what a Z-Index is and how to use this property to overlap HTML elements with CSS.</em></p><h2>What is a Z-Index</h2><p><strong>Z-index</strong> is an property in CSS and has been included in CSS because people asked for an property with the possibility to make HTML elements overlap. Overlapping HTML elements can have a lot of advantages. You can make the important parts of your website fall out from the background some more.</p><h2>How to use Z-Index?</h2><p>Z-index uses values to identify which element is more important then the other. The default value is <strong>0</strong>. Usually, I give the item that should be on top value <strong>20</strong>, the less important <strong>10 </strong> and the least important item <strong>1</strong>.</p><p>It doesn&#8217;t really matter which numbers you give to the Z-index. The only thing you should remember is that your top item should have to highest value. But adding Z-index to items isn&#8217;t enough to make things work.</p><p>For our example, we will use the following HTML structure. Those boxes should get &#8216;Z-indexed&#8217; later on!</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
</pre><pre><span class="html"><span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box1&quot;</span>&gt;</span>Blue = Div #1 <span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box2&quot;</span>&gt;</span>Pink = Div #2 <span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;div class=<span class="html-attribute">&quot;box3&quot;</span>&gt;</span>Yellow = Div #3 <span class="html-other-element">&lt;/div&gt;</span></span></pre></div><p><span id="more-91"></span><br /> <a title="Not-working Z-index example" href="http://divitodesign.com/dd-articles/z-index/not-working.html">Click here to take a look at an example I made</a>. The item that should be on top (because of the Z-index value) is not on top: the boxes are displayed <em>under</em> each other instead of <em>on top</em> of each other. It looks like the Z-index is not working in this example, right?</p><p>The codes I have used in this example. It should work was my first guess as well.</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
</pre><pre><span class="css">div.box1 {
<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 250px</span></span>;
<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 250px</span></span>;
<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> blue</span></span>;
<span class="css-property">z-index<span class="css-selector">:</span><span class="css-value"> 1</span></span>;
}
div.box2 {
<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 100px</span></span>;
<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 300px</span></span>;
<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> pink</span></span>;
<span class="css-property">z-index<span class="css-selector">:</span><span class="css-value"> 20</span></span>;
}
div.box3 {
<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 125px</span></span>;
<span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 125px</span></span>;
<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> yellow</span></span>;
<span class="css-property">z-index<span class="css-selector">:</span><span class="css-value"> 10</span></span>;
}</span></pre></div><h2>What&#8217;s up?</h2><p>The Z-index requires an other property to style the elements that should get &#8216;Z-indexed&#8217;. Our element requires the position property is set to absolute to make things works. Otherwise our Z-index won&#8217;t work, as can be seen in the example above.</p><p>It&#8217;s now time for an example that works. The boxes has been styled with the right properties and is ready to be used. <a title="Working Z-index Example" href="http://www.divitodesign.com/dd-articles/z-index/working.html">A working Z-index example can be found here</a>.</p><p>These are the codes I used here. I simply added an <em>position:absolute;</em> and a couple placement values (top, left) to the boxes. It works!</p><div class="fvch-code"><pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre><pre><span class="css">div.box1 {
	<span class="css-property">position<span class="css-selector">:</span><span class="css-value"> absolute</span></span>;
 	<span class="css-property">top<span class="css-selector">:</span><span class="css-value"> 20px</span></span>; <span class="css-property">left<span class="css-selector">:</span><span class="css-value"> 20px</span></span>;
 	<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 250px</span></span>; <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 250px</span></span>;
 	<span class="css-property">color<span class="css-selector">:</span><span class="css-value"> white</span></span>;
 	<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> blue</span></span>;
 	<span class="css-property">z-index<span class="css-selector">:</span><span class="css-value"> 1</span></span>;
}
div.box2 {
	<span class="css-property">position<span class="css-selector">:</span><span class="css-value"> absolute</span></span>;
 	<span class="css-property">top<span class="css-selector">:</span><span class="css-value"> 150px</span></span>; <span class="css-property">left<span class="css-selector">:</span><span class="css-value"> 10px</span></span>;
 	<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 100px</span></span>; <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 300px</span></span>;
 	<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> pink</span></span>;
 	<span class="css-property">z-index<span class="css-selector">:</span><span class="css-value"> 20</span></span>;
}
div.box3 {
	<span class="css-property">position<span class="css-selector">:</span><span class="css-value"> absolute</span></span>;
	 <span class="css-property">top<span class="css-selector">:</span><span class="css-value"> 15px</span></span>; <span class="css-property">left<span class="css-selector">:</span><span class="css-value"> 175px</span></span>;
 	<span class="css-property">height<span class="css-selector">:</span><span class="css-value"> 125px</span></span>; <span class="css-property">width<span class="css-selector">:</span><span class="css-value"> 125px</span></span>;
 	<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> yellow</span></span>;
 	<span class="css-property">z-index<span class="css-selector">:</span><span class="css-value"> 10</span></span>;
}</span></pre></div><h2>We are done</h2><p>I hope you now have fully understood the Z-index principle. You should always remember to add a <em>position:absolute;</em> property, or your Z-index will not work! If you have any questions regarding this subject, <a href="/contact/" title="contact">contact me</a> or leave a comment.</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/css/z-index-overlap-html-elements-with-css/feed/</wfw:commentRss> <slash:comments>52</slash:comments> </item> <item><title>How To Use HTML Heading Tags with SEO Purpose</title><link>http://divitodesign.com/seo/html-heading-tags-seo/</link> <comments>http://divitodesign.com/seo/html-heading-tags-seo/#comments</comments> <pubDate>Wed, 19 Mar 2008 16:12:47 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[HTML]]></category> <category><![CDATA[Search Engine Optimizing]]></category> <category><![CDATA[Guide]]></category><guid isPermaLink="false">http://www.divitodesign.com/2008/03/how-to-properly-use-htmls-heading-tags/</guid> <description><![CDATA[This article is a beginners guide to heading tags in HTML and their search engine purpose. This time we are going to talk about the heading tags you can use in HTML. To give you an example: h1, h2, h3, h4, h5, h6. These tags are used in HTML to define a heading or title. [...]]]></description> <content:encoded><![CDATA[<p><em>This article is <strong>a beginners guide</strong> to heading tags in HTML and their search engine purpose. </em></p><p>This time we are going to talk about the heading tags you can use in HTML. To give you an example: <em>h1</em>, <em>h2</em>, <em>h3</em>, <em>h4</em>, <em>h5</em>, <em>h6</em>. These tags are used in HTML to define a heading or title.</p><h2>The advantages of using heading tags?</h2><p>Heading tags are used to create split content in parts to make things easier to read. It gets easier for the visitor to scan the document for the more important points of the article. A article with great use of heading tags could keep users reading on.</p><p>But there is more. Another great advantage of headings is the power it has in search engine optimizing. The search engines have accepted the use of headings and will give more value to this text in an article.  A keyword-rich heading will significant improve your search engine visibility.<span id="more-69"></span></p><h2>Which heading tag to choose from when looking from the SEO-aspect?</h2><p>You have the choice between <em>h1</em>, <em>h2</em> and all the way up to <em>h6</em>.  The standard font-sizes vary between large and very small. <em>h1</em> is the largest, and <em>h6</em> is the smallest. The largest is the most important one and should be used only once in a single article or website. Using only one keyword-rich <em>h1</em> tag will tell the search engine what your article or page is about.</p><p>The <em>h2</em> tags should be used for sub-headings. To give you an example, this tag should be used to redivide the content described in the <em>h1</em> tag. The content split by the <em>h2</em> tag should be redivided by the <em>h3</em> tag and so all the way down to <em>h6</em>.</p><p>Of course, a <em>h1</em> is more important than <em>h2</em> or <em>h6</em>. But a proper use of <em>h2</em> and <em>h3</em> tags will definitely improve the search engine visibility of your web page as well as a using <em>h1</em>.</p><h2>A real example, please?</h2><p>I have created <a title="Example: HTML Heading tags" href="http://www.divitodesign.com/dd-articles/headings/headings.html">an example</a> which explains where to use what heading tag. And I&#8217;ve added some information behind it, to make sure you <span style="text-decoration: underline;">understand</span> the meaning of each tags and what their purpose is in websites and articles.</p><p>In my opinion, it is the best to use the tags in the way of the example, when you want to make your website a bit search engine friendly.</p><h4>Questions?</h4><p>Shoot your questions at me via the contact page or drop your comment below.</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/seo/html-heading-tags-seo/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>What is a DOCTYPE and What Does it do?</title><link>http://divitodesign.com/html/what-is-a-doctype-and-what-does-it-do/</link> <comments>http://divitodesign.com/html/what-is-a-doctype-and-what-does-it-do/#comments</comments> <pubDate>Sat, 19 May 2007 05:06:56 +0000</pubDate> <dc:creator>Stefan Vervoort</dc:creator> <category><![CDATA[HTML]]></category><guid isPermaLink="false">http://www.divitodesign.com/blog/2007/05/what%e2%80%99s-a-doctype-and-what-does-it-do/</guid> <description><![CDATA[When a browser scans your website, the first thing it looks for is its DOCTYPE. It helps render your website the proper way. Ever realized that a browser isn&#8217;t a real life guy that can guess in what language and type it is written? Well, a browser is just a tool for people to view [...]]]></description> <content:encoded><![CDATA[<p>When a browser scans your website, the first thing it looks for is its DOCTYPE. It helps render your website the proper way. Ever realized that a browser isn&#8217;t a real life guy that can guess in what language and type it is written? Well, a browser is just a tool for people to view your website and if it doesn&#8217;t know what and how it has to show a page, there can be some problems in layout. So when there&#8217;s a wrong, outdated or no DOCTYPE at all, your HTML, CSS or DOM codes are rendered as they where designed in the late 90&#8242;s. That&#8217;s not something a web developer like you want, right?<br /> <span id="more-4"></span><br /> Most new, major browsers render the page the way the DOCTYPE says them to do. With major browsers I mean Internet Explorer 5.0 and up and of course Mozilla&#8217;s Firefox 1.0 and up. It is very logical new upcoming browsers will be using DOCTYPES as well. Only Opera doesn&#8217;t use DOCTYPEs, they always render a webpage a standard-compliant way.</p><p>So, you know why to use a DOCTYPE, but what is a DOCTYPE really. A DOCTYPE describes a <strong>document type definition</strong> (DTD). This is a machine-readable document that gives the browser the information it needs to display the right way as defined in the DOCTYPE. Example; if the DOCTYPE refers to <em>XHTML 1.0 transitional</em>, it get the information the <em>XHTML 1.0 transitional</em> DTD provides to proper render the webpage.</p><p>I hope you understand now what a DOCTYPE is. As a web developer you have to make choices and you might not know how you can use a DOCTYPE and when. In the next topic, I&#8217;ll show you the DOCTYPES you can use. You can also visit the W3C&#8217;s site for more information.</p><h2>Different types of DOCTYPES</h2><p>Of course, there are differences between HTML 4.01, XHTML 1.0 and XHTML 1.1. The DOCTYPE you have to choose depends on the language you have chosen.</p><p><strong>HTML 4.01</strong></p><h4>Strict</h4><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE HTML PUBLIC <span class="html-attribute">&quot;-//W3C//DTD HTML 4.01//EN&quot;</span>  <span class="html-attribute">&quot;http://www.w3.org/TR/html4/strict.dtd&quot;</span>&gt;</span></span></pre></div><h4>Transitional</h4><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE HTML PUBLIC <span class="html-attribute">&quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/html4/loose.dtd&quot;</span>&gt;</span></span></pre></div><h4>Frameset</h4><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE HTML PUBLIC <span class="html-attribute">&quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/html4/frameset.dtd&quot;</span>&gt;</span></span></pre></div><p><strong>XHTML 1.0</strong></p><h4>Strict</h4><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span>&gt;</span></span></pre></div><h4>Transitional</h4><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;</span>&gt;</span></span></pre></div><h4>Frameset</h4><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;</span>&gt;</span></span></pre></div><p><strong>XHTML 1.1</strong></p><div class="fvch-code"><pre class="fvch-line-numbers">1
</pre><pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.1//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;</span>&gt;</span></span></pre></div><h2>Conclusion</h2><p>Now, do you understand why you need to add a DOCTYPE? If not, please read my article again or leave a comment on this blog. In my opinion, this is a code everyone should use, especially if you think standards are important for the development of the web!</p><p>Thanks for reading this article. Please send me an <a href="mailto:info@divitodesign.com">email</a> or leave a comment.</p> ]]></content:encoded> <wfw:commentRss>http://divitodesign.com/html/what-is-a-doctype-and-what-does-it-do/feed/</wfw:commentRss> <slash:comments>39</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 10/44 queries in 0.382 seconds using disk: basic
Object Caching 921/999 objects using disk: basic

Served from: divitodesign.com @ 2012-05-21 07:30:23 -->
