<?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>JackKozik.com &#187; html5boilerplate</title> <atom:link href="http://jackkozik.com/tag/html5boilerplate/feed" rel="self" type="application/rss+xml" /><link>http://jackkozik.com</link> <description>Web Programming, Home Networking and Personal Travel</description> <lastBuildDate>Mon, 04 Sep 2023 14:26:56 +0000</lastBuildDate> <language>en-US</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.9.2</generator> <item><title>Add Normalize to my HTML5 CSS</title><link>http://jackkozik.com/add-normalize-to-my-html5-css/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-normalize-to-my-html5-css</link> <comments>http://jackkozik.com/add-normalize-to-my-html5-css/#comments</comments> <pubDate>Fri, 02 Aug 2013 17:49:11 +0000</pubDate> <dc:creator><![CDATA[Jack Kozik]]></dc:creator> <category><![CDATA[Web Programming]]></category> <category><![CDATA[2013]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[H5BP]]></category> <category><![CDATA[html5boilerplate]]></category> <category><![CDATA[Normalize]]></category><guid isPermaLink="false">http://jackkozik.com/?p=4551</guid> <description><![CDATA[<p>As part of updating my website to HTML5 boilerplate 4.2, I am finally converting my CSS to use normalize.css. My original index.html file used the following where style.css borrowed heavily from a prior version of H5BP and most of my custom styles were in screen.css. To me, all of this worked, but I was delighted [&#8230;]</p><p>The post <a rel="nofollow" href="http://jackkozik.com/add-normalize-to-my-html5-css/">Add Normalize to my HTML5 CSS</a> appeared first on <a rel="nofollow" href="http://jackkozik.com">JackKozik.com</a>.</p> ]]></description> <content:encoded><![CDATA[<p><a href="http://jackkozik.com/wp-content/uploads/2013/08/H5BPLogo.png"><img class="alignleft  wp-image-4565" title="H5BPLogo" src="http://jackkozik.com/wp-content/uploads/2013/08/H5BPLogo.png" alt="" width="151" height="151" /></a>As part of updating my website to <a href="http://html5boilerplate.com/">HTML5 boilerplate</a> 4.2, I am finally converting my CSS to use <a href="http://necolas.github.io/normalize.css/">normalize.css</a>.</p><p>My original <code>index.html</code> file used the following</p><pre class="brush: jscript; title: ; notranslate">
&lt;head&gt;
...
    &lt;link rel="stylesheet" href="css/smoothness/jquery-ui-1.8.16.custom.css"&gt;
    &lt;link rel="stylesheet" href="css/style.css"&gt;
    &lt;link rel="stylesheet" href="css/screen.css"&gt;
...
&lt;/head&gt;
</pre><p>where <code>style.css</code> borrowed heavily from a prior version of H5BP and most of my custom styles were in <code>screen.css</code>. To me, all of this worked, but I was delighted to follow H5BP&#8217;s lead and refactor my CSS to use <code>normalize.css</code>.</p><p>My new <code>index.html</code> file looks like this:</p><pre class="brush: jscript; title: ; notranslate">
&lt;head&gt;
...
    &lt;link rel="stylesheet" href="css/smoothness/jquery-ui-1.8.16.custom.css"&gt;
    &lt;link rel="stylesheet" href="css/normalize.css"&gt;
    &lt;link rel="stylesheet" href="css/main.css"&gt;
...
&lt;/head&gt;

</pre><p>where <code>normalize.css</code> is version v1.1.1 taken from the H5BP github repository. The <code>main.css</code> is the H5BP file with my custom CSS inserted at the designated spot (&#8220;Author&#8217;s custom styles&#8221; section).</p><p>So I didn&#8217;t trust that this work work very well. I have always been kludgy and I mostly hack together my CSS; I am happy to align with a framework like H5BP, but I wasn&#8217;t optimistic that this would be easy.</p><p>So, I took an intermediate step to Add Normalize to my HTML5 CSS by creating a temporary file called <code>indexnormalize.html</code>. In Chrome, I setup two tabs, one with my <code>index.html</code> and the other with my <code>indexnormalize.html</code> and I did side by side comparisons, liberally using the &#8220;Inspect Element&#8221; developer tool built into Chrome.</p><p>After about an hour, I was done. It wasn&#8217;t that bad. Here&#8217;s a summary of the tweaks that I had to make to my CSS:</p><p><strong>Background color</strong>. My web page has a black background. I have been setting it using the body tag, and I should have been using the html tag. The comments in normalize explain why this is better and there&#8217;s a whole series of blog postings explaining why my prior design was clueless (at best). Reference: <a href="http://phrogz.net/css/htmlvsbody.html">Understanding the HTML versus BODY Element in CSS </a></p><pre class="brush: css; title: ; notranslate">
/* Part of file main.css */
/* old: */
body {
 ...
 background-color: black;
}
---
/* new: */
body {
 ...
}
html {
 background: black;
}
</pre><p><strong>Drop down menu padding.</strong> The way my drop down menus were defined, the <code>normalize.css</code> margin and padding mucked things up. Rather than redesigning my menus, I added some CSS to compensate.</p><p>In <code>normalize.css</code> the following tripped me up:</p><pre class="brush: css; title: ; notranslate">
/* Part of file normalize.css */
ul {
 margin: 1em 0;
}
ul {
 padding: 0 0 0 40px;
}
</pre><p>To fix this, in my custom css I added:</p><pre class="brush: css; title: ; notranslate">
/* Part of file main.css */
#page-bar {
 padding: 0 0 0 0px;
 margin: 0 0;
}
</pre><p><strong>Nav tag</strong>. My menus use the nav tag and so does <code>normalize.css</code>. I had to also fix the margin and padding there, too</p><pre class="brush: css; title: ; notranslate">
/* Part of file main.css */
nav ul {
 margin: 0;
 padding: 0;
}
</pre><p><strong>Printing styles</strong>. Also, I had to go into a different section of <code>main.css</code> to edit in my print styles. In the section titled &#8220;Print Styles&#8221; I put the following at the very end:</p><pre class="brush: css; title: ; notranslate">/* Part of file main.css */
...
 tbody, tr, img { page-break-inside: avoid; }
 tbody { border: 1px solid #999; }
 #head, #foot { display: none; }
}</pre><p>The post <a rel="nofollow" href="http://jackkozik.com/add-normalize-to-my-html5-css/">Add Normalize to my HTML5 CSS</a> appeared first on <a rel="nofollow" href="http://jackkozik.com">JackKozik.com</a>.</p> ]]></content:encoded> <wfw:commentRss>http://jackkozik.com/add-normalize-to-my-html5-css/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>