<?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>HTMLCenter Web Development Blog &#187; CSS Tutorials</title>
	<atom:link href="http://www.htmlcenter.com/blog/category/css-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.htmlcenter.com</link>
	<description>Web Development Help and Tutorials</description>
	<lastBuildDate>Sat, 04 Feb 2012 02:56:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>CSS: Fluid-Width Dropdown Menus</title>
		<link>http://www.htmlcenter.com/blog/css-fluid-width-dropdown-menus/</link>
		<comments>http://www.htmlcenter.com/blog/css-fluid-width-dropdown-menus/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 21:40:05 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[dropdown]]></category>
		<category><![CDATA[fluid width]]></category>
		<category><![CDATA[flyout]]></category>
		<category><![CDATA[son of suckerfish]]></category>
		<category><![CDATA[suckerfish]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1893</guid>
		<description><![CDATA[More than seven years ago, a fantastic article was posted on A List Apart explaining how to create dropdown menus with pure CSS. Up until that point, most (if not all) Web developers and designers were using javascript in some way to make their dropdown and fly-out menus function. The concept, for whatever reason, was [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/creating-custom-menus-in-wordpress-3/' rel='bookmark' title='Creating Custom Menus in WordPress 3'>Creating Custom Menus in WordPress 3</a></li>
<li><a href='http://www.htmlcenter.com/blog/creating-accessible-quick-link-menus/' rel='bookmark' title='Creating Accessible &#8220;Quick Link&#8221; Menus'>Creating Accessible &#8220;Quick Link&#8221; Menus</a></li>
<li><a href='http://www.htmlcenter.com/blog/adding-custom-menus-to-your-wordpress-3-theme/' rel='bookmark' title='Adding Custom Menus to Your WordPress 3 Theme'>Adding Custom Menus to Your WordPress 3 Theme</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>More than seven years ago, a fantastic article was posted on A List Apart explaining how to create dropdown menus with pure CSS. Up until that point, most (if not all) Web developers and designers were using javascript in some way to make their dropdown and fly-out menus function. The concept, for whatever reason, was referred to as the &#8220;<a href="http://www.alistapart.com/articles/dropdowns">Suckerfish menu</a>&#8220;.</p>
<p>Shortly after that article was published, someone else came along and published information about the <a href="http://htmldog.com/articles/suckerfish/dropdowns/">Son of Suckerfish menus</a>. Other concepts based on the Suckerfish menu came along as well. The major issue with all of those articles and examples, though, is that they seem to require fixed-width menus for some reason. If you don&#8217;t set your top-level menu items to be a fixed width, by default the dropdown menu items will either wrap onto multiple or will force the top-level item to expand to fit the dropdown menu.<span id="more-1893"></span></p>
<p>What if you want your top-level menu items to be fluid-width (for instance, the width of the actual text in those items with a little padding on each side) rather than setting them all to a fixed width? What if, in addition, you wanted the dropdown menus to expand appropriately to the width of their children without expanding the width of the top-level parent item? With the concepts shown in most Suckerfish variations, it&#8217;s not really possible.</p>
<p>However, while doing some research into the subject the other day, I came across an interesting solution to the issue.</p>
<p>The idea came from a <a href="http://www.pmob.co.uk/">website called pmob</a> and was linked from a <a href="http://www.sitepoint.com/forums/showthread.php?t=479933">SitePoint forum post on the subject</a>. <a href="http://www.pmob.co.uk/temp/dropdown-all-fluid.htm">The demo can be found on pmob&#8217;s website</a>, but I don&#8217;t see it linked anywhere from their home page.</p>
<p>From what I was able to ascertain, the important differences between the pmob demo and the Son of Suckerfish demo are:</p>
<ol>
<li>Set the width of the #nav ul, #nav li and #nav a elements to &#8220;auto&#8221;</li>
<li>The position property for the #nav li elements should be set to &#8220;relative&#8221;</li>
<li>The white-space property for the #nav li li elements should be set to &#8220;nowrap&#8221; to keep the dropdown menu items from breaking onto multiple lines</li>
</ol>
<p>In my case, I also chose to set the min-width property to 100% to ensure that my dropdown menus were at least as wide as my top-level menu items.</p>
<p>Below is the modified CSS, based on the Son of Suckerfish demo.</p>
<pre><code>/* Original Son of Suckerfish Styles */
#nav, #nav ul {
	padding: 0;
	margin: 0;
	list-style: none;
}

#nav a {
	display: block;
	width: 10em;
}

#nav li {
	float: left;
	width: 10em;
}
#nav li ul {
	position: absolute;
	width: 10em;
	left: -999em;
}

#nav li:hover ul {
	left: auto;
}

/* Style Overrides for Fluid-width Dropdowns */
#nav a, #nav li, #nav li ul {
	width: auto;
}
#nav li {
	position: relative;
}
#nav li li {
	white-space: nowrap;
}
#nav li ul {
	min-width: 100%;
}</code></pre>
<p>I did not modify the Son of Suckerfish HTML at all, so you can use that tutorial as the basis for the HTML elements. As with Suckerfish and Son of Suckerfish, this implementation can be purely CSS, depending on how far back you need to support Internet Explorer (older versions of IE did not support the :hover pseudo-class on any HTML elements other than anchors).</p>
<p>I&#8217;ve also uploaded a <a href="http://www.htmlcenter.com/wp-content/uploads/2010/12/fluid-suckerfish.html">demo of my fluid-width Suckerfish menu</a> for you to check out, download and pick apart. I hope this helps.</p>
<p><strong>Accessibility Note:</strong> This should not be your only method of presenting your menus. Unfortunately, because the menus only appear when you hover over the parent list items these menus are inaccessible. List items are still incapable of receiving focus, so there is no way to keep the dropdown menus open with keyboard movements (unless you use javascript to do so). Therefore, this method of creating menus won&#8217;t work for users using anything but a mouse.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/creating-custom-menus-in-wordpress-3/' rel='bookmark' title='Creating Custom Menus in WordPress 3'>Creating Custom Menus in WordPress 3</a></li>
<li><a href='http://www.htmlcenter.com/blog/creating-accessible-quick-link-menus/' rel='bookmark' title='Creating Accessible &#8220;Quick Link&#8221; Menus'>Creating Accessible &#8220;Quick Link&#8221; Menus</a></li>
<li><a href='http://www.htmlcenter.com/blog/adding-custom-menus-to-your-wordpress-3-theme/' rel='bookmark' title='Adding Custom Menus to Your WordPress 3 Theme'>Adding Custom Menus to Your WordPress 3 Theme</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/css-fluid-width-dropdown-menus/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Can We Even Use CSS2, Yet?</title>
		<link>http://www.htmlcenter.com/blog/can-we-even-use-css2-yet/</link>
		<comments>http://www.htmlcenter.com/blog/can-we-even-use-css2-yet/#comments</comments>
		<pubDate>Wed, 18 Aug 2010 03:29:06 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css2]]></category>
		<category><![CDATA[ie7]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1783</guid>
		<description><![CDATA[With all of this talk lately about CSS3 and how amazing the Web will be once it gains wide browser support, it got me thinking about how well CSS2 is supported. Sadly, there are still a lot of really cool features that were introduced in the CSS2 spec that we can&#8217;t use yet, thanks to [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/css-selectors/' rel='bookmark' title='CSS Selectors'>CSS Selectors</a></li>
<li><a href='http://www.htmlcenter.com/blog/internet-explorer-9/' rel='bookmark' title='Internet Explorer 9'>Internet Explorer 9</a></li>
<li><a href='http://www.htmlcenter.com/blog/css-fluid-width-dropdown-menus/' rel='bookmark' title='CSS: Fluid-Width Dropdown Menus'>CSS: Fluid-Width Dropdown Menus</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>With all of this talk lately about CSS3 and how amazing the Web will be once it gains wide browser support, it got me thinking about how well CSS2 is supported. Sadly, there are still a lot of really cool features that were introduced in the CSS2 spec that we can&#8217;t use yet, thanks to the overwhelming market share held by Internet Explorer 6 and 7.</p>
<p>In this article, I&#8217;ll take a quick look at some under-used CSS2 features and examine whether or not they are supported in IE7.<span id="more-1783"></span></p>
<h2>Before and After Pseudo-Elements</h2>
<p>CSS2 introduced the idea of <a href="http://www.w3.org/TR/CSS21/selector.html#before-and-after">the <code>:before</code> and <code>:after</code> pseudo-elements.</a> Essentially, these pseudo-elements were created to allow you to insert non-semantic content into your pages with pure CSS. In some instances, people use these classes to insert images or bullets before or after HTML elements. In other cases, they&#8217;re used for things like adding quotes before and after your &lt;blockquote&gt; or &lt;quote&gt; elements. Some coders are even using these pseudo-classes to add indicators to their links, letting visitors know when a link leads to an external resource, a PDF file, etc.</p>
<p>Sadly, these two pseudo-elements are <strong>not supported by IE7</strong>, so there&#8217;s not much point in trying to use these widely.</p>
<h2>First-___ Pseudo-Classes and Pseudo-Elements</h2>
<p>Another cool feature (expanded quite a bit with CSS3) are the <code><a href="http://www.w3.org/TR/CSS21/selector.html#first-child">:first-child</a></code><a href="http://www.w3.org/TR/CSS21/selector.html#first-child"> pseudo-class</a> and the <code><a href="http://www.w3.org/TR/CSS21/selector.html#first-line-pseudo">:first-line</a></code> and <code><a href="http://www.w3.org/TR/CSS21/selector.html#first-letter">:first-letter</a></code> pseudo-elements.</p>
<p>The :first-child pseudo-class allows you to locate the first child element of a DOM element and style it differently than the rest of the same type of elements. Be aware that this pseudo-class only searches for the first child, not the first matching child. Therefore, if you were to use the following HTML, you could use <code>body h1:first-child</code> to find the <code>&lt;h1&gt;</code> element, but using <code>p:first-child</code> would have no effect, since the <code>&lt;p&gt;</code> element is not the first child of anything in the page.</p>
<p><code>&lt;body&gt;<br />
&lt;h1&gt;Test Header One&lt;/h1&gt;<br />
&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec tellus neque, porta aliquam congue scelerisque, tristique et risus. Etiam placerat scelerisque leo in hendrerit. In at risus sed purus malesuada vulputate. Nullam gravida magna malesuada nisi convallis eget egestas nulla iaculis. &lt;q&gt;Vivamus id nulla turpis.&lt;/q&gt; Cras vitae ante a eros semper imperdiet. Aenean posuere eros eu felis convallis ultricies non at nibh. Fusce pharetra augue eu lorem feugiat accumsan. Proin odio nisl, interdum eget auctor sed, tristique et libero. Duis risus elit, viverra et facilisis id, euismod quis lectus. Praesent lobortis adipiscing mi, nec mollis diam cursus eu. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec varius, ante sed dapibus vehicula, mi ipsum ultrices ante, vel sodales dolor turpis et risus. Donec felis lectus, rhoncus quis suscipit sit amet, elementum vel ante. Maecenas nec rutrum risus. Maecenas interdum tristique massa, vel elementum nisl posuere ut. Donec quis lectus diam. Sed id tortor massa, nec eleifend sem.&lt;/p&gt;<br />
&lt;/body&gt;</code></p>
<p>The :first-letter and :first-line pseudo-elements will search for the first character and the first full line of the DOM elements, respectively. For instance, if you were to use the HTML code above and use the CSS shown below, the first letter of the paragraph would be 50px and <span style="color: #f00;">red</span>, while the rest of the first full line would be <span style="color: #00f;">blue</span>.</p>
<p><code>p:first-letter { font-size: 50px; color: #f00; }<br />
p:first-line { color: #00f; }</code></p>
<p>All three of these CSS properties are <strong>fully supported in Internet Explorer 7</strong>, so it&#8217;s probably safe to use them on your current websites. However, just as an FYI, if you use the :first-letter pseudo-element in conjunction with the :before pseudo-element mentioned above, any browser that supports the :before pseudo-element will include the content added by the :before pseudo-element (so, if you use text in the :before pseudo-element, the first letter of that text will be styled by :first-letter and :first-line elements; if you use an image for the content of your :before element, no styles will be applied at all).</p>
<h2>Attribute Selectors</h2>
<p>CSS2 also introduced the idea of <a href="http://www.w3.org/TR/CSS21/selector.html#attribute-selectors">finding DOM elements based on specific HTML/XML attributes.</a> For instance, if you use the HTML tag <code>&lt;p rel="excerpt"&gt;</code>, you can use the following CSS to style that paragraph.</p>
<p><code>p[rel] { color: #666; } /* will style all paragraph elements in which the "rel" attribute is specified */<br />
p[rel="excerpt"] { color: #666; } /* will only style paragraph elements in which the "rel" attribute is specified and the value of that attribute is set to "excerpt" */</code></p>
<p>In addition to the two methods shown above, you can also precede the equal sign (=) with a tilde (~) to find a specific word within a space-separated list of words in the value of the specified attribute (contains) or you can precede the equal sign with a bar (|) to find any elements where the attribute value exactly equals the characters you specified or <em>starts with</em> those characters, followed immediately by a hyphen (-).</p>
<p>These can be helpful for things like styling excerpts differently than the rest of an article (though, the semantics of using the rel attribute versus using a CSS class is a debate for a different day), styling external links differently than internal links and more.</p>
<p>These CSS2 properties also appear to be <strong>fully supported in IE7</strong>, so it&#8217;s probably safe to use them, as well.</p>
<h2>Child and Sibling Selectors</h2>
<p>These are two of my favorite things introduced by CSS2. Using the child selector (a simple right angle bracket/greater than symbol), you can specify that you only want DOM elements that are direct descendants of the specified parent to use the style you define. For instance, if you create a nested set of HTML lists, interchanging unordered lists and ordered lists throughout, it can be difficult to style them properly without these child selectors. Take a look at the two CSS examples shown below and note the differences.</p>
<p><code>ul li { list-style: disc; }<br />
ul ul li { list-style: circle; }<br />
ol li { list-style: decimal; }</code></p>
<p><code>ul&gt;li { list-style: disc; }<br />
ul ul&gt;li { list-style: circle; }<br />
ol&gt;li { list-style: decimal; }</code></p>
<p>The first two lines of CSS will probably not have the effect you&#8217;d expect. Let&#8217;s take a look at the example HTML:<br />
<code>&lt;ul&gt;<br />
&lt;li&gt;Disc?<br />
&lt;ol&gt;<br />
&lt;li&gt;Decimal?<br />
&lt;ul&gt;<br />
&lt;li&gt;Circle?&lt;/li&gt;<br />
&lt;li&gt;Circle?&lt;/li&gt;<br />
&lt;li&gt;Circle?&lt;ol&gt;<br />
&lt;li&gt;Decimal?&lt;/li&gt;<br />
&lt;li&gt;<br />
Decimal?<br />
&lt;ol&gt;<br />
&lt;li&gt;Circle? Disc? Decimal?&lt;/li&gt;<br />
&lt;/ol&gt;<br />
&lt;/li&gt;<br />
&lt;/ol&gt;&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/li&gt;<br />
&lt;li&gt;Decimal?<br />
&lt;ul&gt;<br />
&lt;li&gt;Circle?&lt;/li&gt;<br />
&lt;li&gt;Circle?&lt;/li&gt;<br />
&lt;li&gt;Circle?&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/li&gt;<br />
&lt;/ol&gt;<br />
&lt;/li&gt;<br />
&lt;li&gt;Disc?<br />
&lt;ol&gt;<br />
&lt;li&gt;Decimal?&lt;/li&gt;<br />
&lt;li&gt;Decimal?&lt;/li&gt;<br />
&lt;/ol&gt;<br />
&lt;/li&gt;<br />
&lt;/ul&gt;</code></p>
<p>Using the first block of CSS shown above, you would probably expect your first level of unordered list items to have a disc bullet and your second level of unordered list items to have a circle bullet; while you&#8217;d probably expect your first, second and third levels of ordered list items to use incrementing decimal numbers as bullets.</p>
<p>However, your second and third levels of ordered list items will actually have a circle bullet, because they are <code>li</code> elements inside of second-level <code>ul</code> elements (as specified by the <code>ul ul li</code> selector).</p>
<p>If you use the second block of CSS, though, you will get exactly what you expect. The child selector makes the CSS selectors more specific, causing them to only interact with the <code>li</code> items that are direct descendants of the <code>ol</code> or <code>ul</code> element specified.</p>
<p>The sibling selector is represented by a simple plus sign (+). This selector works similarly to the way the child selector works, but instead of selecting direct descendants, it selects direct siblings. For instance, if you were to create an HTML table, and you wanted to style the first column differently from the other columns, you could use the following CSS to do so.</p>
<p><code>td { background: #ff0; text-align: right; font-weight: bold; }<br />
td+td { background: #f00; text-align: left; font-weight: normal; }</code></p>
<p>The CSS above will cause the first column of the table to have a yellow background with right-aligned, bold text. The rest of the columns in the table will have a red background with left-aligned normal-weight text.</p>
<p>These two selectors are <strong>fully supported in IE7</strong>, as well.</p>
<h2>Conclusion</h2>
<p>While there are still a handful of CSS2 items that aren&#8217;t implemented in IE7, most of them have been, and can be extremely useful for creating more specific and targeted CSS definitions. Therefore, I would say absolutely (with the exception of the :before and :after pseudo-elements, unfortunately) we can <strong>and should be</strong> using CSS2 within our websites.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/css-selectors/' rel='bookmark' title='CSS Selectors'>CSS Selectors</a></li>
<li><a href='http://www.htmlcenter.com/blog/internet-explorer-9/' rel='bookmark' title='Internet Explorer 9'>Internet Explorer 9</a></li>
<li><a href='http://www.htmlcenter.com/blog/css-fluid-width-dropdown-menus/' rel='bookmark' title='CSS: Fluid-Width Dropdown Menus'>CSS: Fluid-Width Dropdown Menus</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/can-we-even-use-css2-yet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cross-Browser Gradient Backgrounds</title>
		<link>http://www.htmlcenter.com/blog/cross-browser-gradient-backgrounds/</link>
		<comments>http://www.htmlcenter.com/blog/cross-browser-gradient-backgrounds/#comments</comments>
		<pubDate>Sun, 25 Jul 2010 23:42:36 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[cross-browser]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[gradient]]></category>
		<category><![CDATA[internet explorer]]></category>
		<category><![CDATA[mozilla]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1758</guid>
		<description><![CDATA[One of the great new features coming with CSS3 is the ability to use native gradient backgrounds. In addition to saving server resources (no need to call an external image), the gradients tend to be more vibrant and faithful to the original colors than any external images. So far, none of the modern browsers have [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/cross-browser-semi-transparent-backgrounds/' rel='bookmark' title='Cross-Browser Semi-Transparent Backgrounds'>Cross-Browser Semi-Transparent Backgrounds</a></li>
<li><a href='http://www.htmlcenter.com/blog/css3-will-include-rounded-corners/' rel='bookmark' title='CSS3 Will Include Rounded Corners'>CSS3 Will Include Rounded Corners</a></li>
<li><a href='http://www.htmlcenter.com/blog/cross-browser-add-to-favorites/' rel='bookmark' title='cross-browser add to favorites'>cross-browser add to favorites</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of the great new features coming with CSS3 is the ability to use native gradient backgrounds. In addition to saving server resources (no need to call an external image), the gradients tend to be more vibrant and faithful to the original colors than any external images.</p>
<p>So far, none of the modern browsers have agreed on which method to use to implement the gradients, so you will need to utilize a few different methods in order to get it to work in multiple browsers.<span id="more-1758"></span></p>
<p>Chrome and Safari (and, as far as I know, all other modern Webkit-based browsers) currently utilize the proprietary method <code>-webkit-gradient()</code>, while Firefox uses the proprietary method <code>-moz-[type]-gradient()</code>. No versions of Internet Explorer (except possibly the IE9 platform preview) support CSS3 gradients, but IE does support a proprietary <code>filter()</code> method that is capable of implementing native gradients. Unfortunately, Opera still has no native support for gradients, but using a background color, you can allow your page to degrade gracefully in that browser.</p>
<h2>Webkit Gradients</h2>
<p>The <code>-webkit-gradient()</code> method accepts five arguments, in the following order:</p>
<ol>
<li>Gradient type (linear or radial)</li>
<li>Gradient starting point (top left, top right, bottom left, bottom right, etc.) &#8211; I believe you can also use integers for the starting and ending points, but I&#8217;ve not tested this</li>
<li>Gradient ending point (top left, top right, bottom left, bottom right, etc.)</li>
<li>Gradient starting color</li>
<li>Gradient ending color</li>
</ol>
<p>Therefore, to create a straight, vertical linear gradient that goes from black to white, you would use code like:</p>
<p><code>-webkit-gradient(linear, top left, bottom left, from(#000), to(#fff));</code></p>
<p>To create a straight, horizontal linear gradient that goes from black to white, you would use:</p>
<p><code>-webkit-gradient(linear, top left, top right, from(#000), to(#fff));</code></p>
<p>To create a diagonal linear gradient from black to white, you would use:</p>
<p><code>-webkit-gradient(linear, top left, bottom right, from(#000), to(#fff));</code></p>
<p><a href="http://webkit.org/blog/175/introducing-css-gradients/">More information about Webkit gradients</a> can be found on the Surfin&#8217; Safari website.</p>
<h2>Firefox Gradients</h2>
<p>Firefox (and potentially other modern Mozilla-based browsers) use a slightly different method to generate CSS gradients. Instead of using a property within the method to determine what type of gradient to generate, you use different methods to create different types of gradients in Firefox. To create a linear gradient, you would use <code>-moz-linear-gradient</code>, and to create a radial gradient, you would use <code>-moz-radial-gradient()</code>.</p>
<p>Firefox gradients are a little bit more flexible than Webkit gradients. With Mozilla, in addition to being able to indicate a starting and ending color, you can also indicate the angle at which you want the gradient created and you can specify stops within the gradient (rather than having a uniform gradient from one end to the other).</p>
<p>To create a vertical linear gradient from black to white within Mozilla, you would use some code similar to:</p>
<p><code>-moz-linear-gradient(top, #000, #fff)</code></p>
<p>To create a horizontal linear gradient from black to white, you would use:</p>
<p><code>-moz-linear-gradient(left, #000, #fff)</code></p>
<p>To create a diagonal linear gradient from black to white, you would use:</p>
<p><code>-moz-linear-gradient(left top, #000, #fff)</code></p>
<p>However, as mentioned above, you can also adjust the angle at which the gradient occurs. Therefore, if you wanted to skew the gradient at a 30 degree angle instead of a 90 degree angle, you could use something like:</p>
<p><code>-moz-linear-gradient(top 30deg, #000, #fff)</code></p>
<p>You can even add color stops to the gradient within Mozilla. <a href="http://hacks.mozilla.org/2009/11/css-gradients-firefox-36/">More in-depth information about Mozilla gradients</a>, including the color stops, can be found on the Mozilla Hacks website.</p>
<h2>Internet Explorer Gradients</h2>
<p>To implement gradients in Internet Explorer, you have to use the proprietary <code>filter</code> CSS property. To create a gradient within Internet Explorer, you would use code similar to:</p>
<p><code>filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#ff000000', endColorstr='#ffffffff' )</code></p>
<p>The gradient method accepts the following parameters:</p>
<ol>
<li>EndColor &#8211; I have never used this parameter before (I always use the EndColorStr parameter instead), but it appears that it accepts an integer value for the color, between 0 and 4294967295. It also appears that you can use a hexadecimal value (in ARGB format) for this parameter, but you need to prefix it with 0x to indicate that it is a hexadecimal value.</li>
<li>EndColorStr &#8211; Accepts a hexadecimal color string. You can also use an eight-character color value, with the opacity (from 00 to ff) as the first 2 characters, followed by the red value, green value and blue value, respectively. For instance, to create a gradient that ends with black at 50% opacity, you would use the color value <code>#77000000</code></li>
<li>StartColor &#8211; See the notes about EndColor</li>
<li>StartColorStr &#8211; See the notes about EndColorStr</li>
<li>GradientType &#8211; Set to 0 for a vertical gradient, set to 1 for a horizontal gradient. Defaults to 0</li>
</ol>
<p>You can find <a href="http://msdn.microsoft.com/en-us/library/ms532997(VS.85).aspx">the official documentation on Internet Explorer gradients</a> on the MSDN website.</p>
<h2>Putting it All Together</h2>
<p>To put all of this together and make your gradient work cross-browser, you would use some code similar to the following.<br />
<code> background: transparent;<br />
background-image: -webkit-gradient(linear, left top, left bottom, from(#000), to(#fff));<br />
background-image: -moz-linear-gradient(left, #000, #fff);<br />
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#ff000000', endColorstr='#ffffffff' );</code><br />
It is important to note that the Webkit and Mozilla implementations of the <code>gradient()</code> method actually generate images, so they will replace any background image you&#8217;ve already specified. To keep things simple, I usually use the <code>background-image</code> CSS property rather than just the <code>background</code> property. The Internet Explorer filter property is a completely separate CSS property, so it will not replace any others. Therefore, you may want to preface it with &#8220;<code>background: transparent;</code>&#8221; to ensure no other background colors or images interfere with the filter.</p>
<p>Therefore, if you want a fallback background color for Opera and other unsupported browsers, you will probably want to declare the background color first, then the Webkit and Mozilla gradient methods, then insert the <code>filter</code> property inside of IE conditional comments, preceded by the transparent background call.</p>
<p>All together, that might look more like:<br />
<code>&lt;style&gt;<br />
background: #000;<br />
background-image: -webkit-gradient(linear, left top, left bottom, from(#000), to(#fff));<br />
background-image: -moz-linear-gradient(left, #000, #fff);<br />
&lt;/style&gt;<br />
&lt;!--[if IE]&gt;<br />
&lt;style&gt;<br />
background: transparent;<br />
filter: progid: DXImageTransform.Microsoft.gradient( startColorstr='#ff000000', endColorstr='#ffffffff' );<br />
&lt;/style&gt;<br />
&lt;![endif]--&gt;</code></p>
<p>For <a href="http://www.webdesignerwall.com/tutorials/cross-browser-css-gradient/">more information about using cross-browser gradients</a>, you can check out the WebDesignerWall.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/cross-browser-semi-transparent-backgrounds/' rel='bookmark' title='Cross-Browser Semi-Transparent Backgrounds'>Cross-Browser Semi-Transparent Backgrounds</a></li>
<li><a href='http://www.htmlcenter.com/blog/css3-will-include-rounded-corners/' rel='bookmark' title='CSS3 Will Include Rounded Corners'>CSS3 Will Include Rounded Corners</a></li>
<li><a href='http://www.htmlcenter.com/blog/cross-browser-add-to-favorites/' rel='bookmark' title='cross-browser add to favorites'>cross-browser add to favorites</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/cross-browser-gradient-backgrounds/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Reset Stylesheets</title>
		<link>http://www.htmlcenter.com/blog/reset-stylesheets/</link>
		<comments>http://www.htmlcenter.com/blog/reset-stylesheets/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 01:02:36 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[eric meyer]]></category>
		<category><![CDATA[reset style]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1686</guid>
		<description><![CDATA[Whenever I begin slicing up a new website design to turn it into a template, one of the first things I do is to implement a reset stylesheet. The ideal reset stylesheet will essentially turn off all of the proprietary default CSS properties that browsers impose on various HTML elements. At the very least, padding and [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/firefox-and-html5/' rel='bookmark' title='Firefox and HTML5'>Firefox and HTML5</a></li>
<li><a href='http://www.htmlcenter.com/blog/the-definitive-guide-to-stylesheet-planning/' rel='bookmark' title='The Definitive Guide To Stylesheet Planning'>The Definitive Guide To Stylesheet Planning</a></li>
<li><a href='http://www.htmlcenter.com/blog/styling-a-definition-list-nicely/' rel='bookmark' title='Styling a Definition List Nicely'>Styling a Definition List Nicely</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Whenever I begin slicing up a new website design to turn it into a template, one of the first things I do is to implement a <a href="http://meyerweb.com/eric/thoughts/2007/04/18/reset-reasoning/">reset stylesheet</a>. The ideal reset stylesheet will essentially turn off all of the proprietary default CSS properties that browsers impose on various HTML elements. At the very least, padding and margins need to be reset, as each of the major browsers tend to implement those in completely different manners.<span id="more-1686"></span></p>
<p>The first reset stylesheet I heard of (and quite possibly the first reset stylesheet created) came from Eric Meyer. He has <a href="http://meyerweb.com/eric/tools/css/reset/">discussed the concept of reset stylesheets</a> at length on his blog, and provided multiple examples of reset sheets.</p>
<p>My favorite place to go for reset styles, however, is the <a href="http://developer.yahoo.com/">Yahoo! Developer Network</a>. Yahoo! provides a really well-built reset stylesheet on its content delivery network (CDN), making it easy to implement and giving you a higher probability that the stylesheet has already been cached on the user&#8217;s computer than you would have if you hosted your own.</p>
<p>The <a href="http://developer.yahoo.com/yui/reset/">Yahoo! reset stylesheet</a> does a really good job of resetting the margins and padding for all elements to 0 and eliminating the default styles for lists and more. I highly recommend adding Yahoo!&#8217;s reset stylesheet to any new designs you are developing; allowing you to start basically from scratch when you begin adding your own style definitions.</p>
<p>After implementing the reset stylesheet, though, it&#8217;s very important to remember that all of the default styles have been reset, including some things that many of us tend to take for granted; such as &lt;strong&gt; and &lt;em&gt;, bullet styles for unordered lists, incrementing numbers for ordered lists, etc.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/firefox-and-html5/' rel='bookmark' title='Firefox and HTML5'>Firefox and HTML5</a></li>
<li><a href='http://www.htmlcenter.com/blog/the-definitive-guide-to-stylesheet-planning/' rel='bookmark' title='The Definitive Guide To Stylesheet Planning'>The Definitive Guide To Stylesheet Planning</a></li>
<li><a href='http://www.htmlcenter.com/blog/styling-a-definition-list-nicely/' rel='bookmark' title='Styling a Definition List Nicely'>Styling a Definition List Nicely</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/reset-stylesheets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three-Column Layouts</title>
		<link>http://www.htmlcenter.com/blog/three-column-layouts/</link>
		<comments>http://www.htmlcenter.com/blog/three-column-layouts/#comments</comments>
		<pubDate>Sat, 29 May 2010 14:44:08 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[a list apart]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fixed-width]]></category>
		<category><![CDATA[fluid width]]></category>
		<category><![CDATA[holy grail]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[multi column]]></category>
		<category><![CDATA[three column]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1681</guid>
		<description><![CDATA[For me, it&#8217;s pretty rare that I develop fluid website layouts, so I&#8217;ve not played much with them. However, as part of a recent project, I needed a way to create a fixed-width sidebar and a fluid second column. I started searching around, and came across an old (January 2006) article from A List Apart [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/css-fluid-width-dropdown-menus/' rel='bookmark' title='CSS: Fluid-Width Dropdown Menus'>CSS: Fluid-Width Dropdown Menus</a></li>
<li><a href='http://www.htmlcenter.com/blog/tables-in-html/' rel='bookmark' title='Tables in HTML'>Tables in HTML</a></li>
<li><a href='http://www.htmlcenter.com/blog/how-css-is-implemented-in-e-mail-clients/' rel='bookmark' title='How CSS is Implemented in E-mail Clients'>How CSS is Implemented in E-mail Clients</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For me, it&#8217;s pretty rare that I develop fluid website layouts, so I&#8217;ve not played much with them. However, as part of a recent project, I needed a way to create a fixed-width sidebar and a fluid second column. I started searching around, and came across an old (January 2006) article from A List Apart (ALA). Although it&#8217;s old, it&#8217;s still extremely useful. It&#8217;s fairly aptly titled &#8220;<a href="http://www.alistapart.com/articles/holygrail/">The Holy Grail</a>.&#8221;</p>
<p>The article explains how to create a three-column layout with fixed-width side columns and a fluid center column. For this particular application, I modified it slightly to use a two-column layout, but I&#8217;ve since realized just how powerful and useful the techniques described in the article are.<span id="more-1681"></span></p>
<p>You can use these techniques to create multi-column fluid layouts or multi-column fixed-width layouts. I haven&#8217;t tested to see how much extra work it would take to create four or more columns, but it works beautifully for two columns and three columns.</p>
<p>Why would you want to use these techniques for a fixed-width layout when you could simply use floats? You probably wouldn&#8217;t for a two-column layout, as you can just use float: left if you want a right sidebar or float: right if you want a left sidebar. However, for three-column layouts, floats will not allow you to place your content column above your sidebars in the source.</p>
<p>The techniques described in the article allow you to place your content column at the top of your source, then layer both sidebars below your content div within the source of your page. The CSS then pulls the various columns into the correct places.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/css-fluid-width-dropdown-menus/' rel='bookmark' title='CSS: Fluid-Width Dropdown Menus'>CSS: Fluid-Width Dropdown Menus</a></li>
<li><a href='http://www.htmlcenter.com/blog/tables-in-html/' rel='bookmark' title='Tables in HTML'>Tables in HTML</a></li>
<li><a href='http://www.htmlcenter.com/blog/how-css-is-implemented-in-e-mail-clients/' rel='bookmark' title='How CSS is Implemented in E-mail Clients'>How CSS is Implemented in E-mail Clients</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/three-column-layouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS Hanging Indents</title>
		<link>http://www.htmlcenter.com/blog/css-hanging-indents/</link>
		<comments>http://www.htmlcenter.com/blog/css-hanging-indents/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 23:06:23 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[hanging indent]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[padding]]></category>
		<category><![CDATA[text-indent]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1517</guid>
		<description><![CDATA[Every once in a while, you may find yourself in a position where you need to create a hanging indent on a paragraph or set of paragraphs on one of your pages. There isn&#8217;t really an out-of-the-box way to do so with CSS, but you can accomplish it pretty easily by combining two CSS properties. [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/can-we-even-use-css2-yet/' rel='bookmark' title='Can We Even Use CSS2, Yet?'>Can We Even Use CSS2, Yet?</a></li>
<li><a href='http://www.htmlcenter.com/blog/css-text/' rel='bookmark' title='CSS Text'>CSS Text</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Every once in a while, you may find yourself in a position where you need to create a hanging indent on a paragraph or set of paragraphs on one of your pages. There isn&#8217;t really an out-of-the-box way to do so with CSS, but you can accomplish it pretty easily by combining two CSS properties.</p>
<p>In case you aren&#8217;t sure what a hanging indent is, it&#8217;s basically when the first line of a paragraph is flush with the left margin, but any subsequent lines in that paragraph are indented.<span id="more-1517"></span> Following is an example of a hanging indent:</p>
<p style="text-indent: -2em; padding-left: 2em; font-family: serif;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras egestas aliquam nisi, non euismod nisi ultricies non. Suspendisse potenti. Morbi suscipit ante sit amet diam egestas et molestie elit lobortis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris metus arcu, scelerisque eu aliquet scelerisque, interdum faucibus odio.</p>
<p>To accomplish this, you simply need to combine the <code>text-indent</code> property, which indents the first line of a block-level HTML element, with the <code>padding</code> property. If you apply a negative text-indent to the paragraph, the first line will be indented (well, the opposite of indented, really) to the left rather than being indented to the right. Doing that will cause all of the subsequent lines to be flush with the left margin, while the first line will be shifted to the left of the margin.</p>
<p>Then, apply an equal, positive left padding to that paragraph. That will cause the first line to end up flush with the left margin again, and will push all subsequent lines that far in from the margin.</p>
<p>Your code might look something like the following.</p>
<p><code>&lt;p style="text-indent: -2em; padding-left: 2em;"&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras egestas aliquam nisi, non euismod nisi ultricies non. Suspendisse potenti. Morbi suscipit ante sit amet diam egestas et molestie elit lobortis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris metus arcu, scelerisque eu aliquet scelerisque, interdum faucibus odio.&lt;/p&gt;</code></p>
<p>That&#8217;s really all there is to it. I hope that comes in handy for you somewhere down the road.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/can-we-even-use-css2-yet/' rel='bookmark' title='Can We Even Use CSS2, Yet?'>Can We Even Use CSS2, Yet?</a></li>
<li><a href='http://www.htmlcenter.com/blog/css-text/' rel='bookmark' title='CSS Text'>CSS Text</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/css-hanging-indents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Styling a Definition List Nicely</title>
		<link>http://www.htmlcenter.com/blog/styling-a-definition-list-nicely/</link>
		<comments>http://www.htmlcenter.com/blog/styling-a-definition-list-nicely/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 04:31:15 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[definition list]]></category>
		<category><![CDATA[dl]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[lists]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1436</guid>
		<description><![CDATA[Definition lists (dl) can be somewhat of a bear when trying to style them nicely. Because of the fact that the term/definition sets don&#8217;t have any kind of wrappers, you can&#8217;t successfully and reliably float them to place the terms on the left and the definitions on the right (however, once CSS2 and CSS3 selectors [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/tables-in-html/' rel='bookmark' title='Tables in HTML'>Tables in HTML</a></li>
<li><a href='http://www.htmlcenter.com/blog/wii-tops-list-of-most-sought-after-gifts/' rel='bookmark' title='Wii Tops List of Most Sought-After Gifts'>Wii Tops List of Most Sought-After Gifts</a></li>
<li><a href='http://www.htmlcenter.com/blog/seesmic-desktop-adds-support-for-twitter-lists/' rel='bookmark' title='Seesmic Desktop Adds Support for Twitter Lists'>Seesmic Desktop Adds Support for Twitter Lists</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Definition lists (dl) can be somewhat of a bear when trying to style them nicely. Because of the fact that the term/definition sets don&#8217;t have any kind of wrappers, you can&#8217;t successfully and reliably float them to place the terms on the left and the definitions on the right (however, once CSS2 and CSS3 selectors become more widely supported, you should be able to get more control).</p>
<p>However, you can do some nice things with definition lists. This article will show two examples of how definition lists could be used on your site and how to style them nicely.<span id="more-1436"></span></p>
<h2>Navigation</h2>
<p><a href="http://www.htmlcenter.com/wp-content/uploads/2010/01/dl-navigation-example.png"><img style="float: right; margin: 0 0 1em 1em; border: none;" src="http://www.htmlcenter.com/wp-content/uploads/2010/01/dl-navigation-example-150x150.png" alt="" title="DL Navigation Example" width="150" height="150" class="alignnone size-thumbnail wp-image-1437" /></a>One thing you can do with a definition list is create your navigation menu. For the most part, coders seem to rely heavily on unordered lists for navigation menus, but a definition list might make more sense. Think about a typical WordPress sidebar. It includes a header and a list of items that relate to that header. Doesn&#8217;t it make sense to think of the header as a definition and the list of items as the definitions for that term?</p>
<p>This makes even more sense when you have specific sets of navigation items. For instance, if you have a &#8220;quick links&#8221; menu, a task-based navigation menu (link titles that describe tasks or goals that will be accomplished by clicking the link) or an audience-based navigation menu (link titles that relate to the specific type of visitor being targeted by the content being linked).</p>
<p>For a sidebar, you would simply use some CSS to style the definition term (dt) the way a header would be styled and some different CSS to style the definition (dd). Using a definition list in this instance will produce much cleaner HTML than the nested unordered lists generally found in WordPress (though, to implement this in WordPress, you might actually have to modify some base functions in WP itself). In fact, if you want to hide the header altogether, you can do so more easily with a definition list than with an unordered list. Simply use CSS to set the &#8220;display&#8221; property of all dt items in the sidebar to &#8220;none.&#8221;</p>
<p>Your sidebar menu might look something like:</p>
<pre><code>&lt;div id="sidebar"&gt;
&lt;dl&gt;
&lt;dt&gt;Categories&lt;/dt&gt;
&lt;dd&gt;Products&lt;/dd&gt;
&lt;dd&gt;Services&lt;/dd&gt;
&lt;dd&gt;News&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl style="border-bottom: 0;"&gt;
&lt;dt&gt;Archives&lt;/dt&gt;
&lt;dd&gt;December 2009&lt;/dd&gt;
&lt;dd&gt;November 2009&lt;/dd&gt;
&lt;dd&gt;October 2009&lt;/dd&gt;
&lt;dd&gt;Older&lt;/dd&gt;
&lt;/dl&gt;
&lt;/div&gt;</code></pre>
<p>and your CSS for that might look like:</p>
<pre><code>#sidebar {
width: 200px;
background: #eee;
border: 1px solid #00f;
}
#sidebar dl {
margin: -1em 0 0 0;
padding: 0;
border-bottom: 1px solid #00f;
}
#sidebar dt {
font-size: 1.5em;
font-weight: bold;
margin: 0;
padding: 1em .25em .25em .25em;
}
#sidebar dd {
margin: 0;
padding: .5em 0 .5em 1em;
background: #e2e2e2;
border-top: 1px solid #0ee;
}</code></pre>
<h2>Timelines and Date Lists</h2>
<p><a href="http://www.htmlcenter.com/wp-content/uploads/2010/01/dl-timeline-example.png"><img style="margin: 0 0 1em 1em; float: right; border: none;" src="http://www.htmlcenter.com/wp-content/uploads/2010/01/dl-timeline-example-150x150.png" alt="" title="DL Timeline Example" width="150" height="150" class="alignnone size-thumbnail wp-image-1438" /></a>Another practical use for definition lists would be to use one for a timeline or a list of items organized by date. For instance, going back to the WordPress example, you could use a definition list to display a list of posts according to the date on which they were published. The dates themselves would be represented as definition terms (dt) and the post titles and excerpts would be represented as definitions (dd). You could then apply some fancy styling to the dates and format the titles and excerpts however you choose.</p>
<p>When creating a timeline recently, I used a definition list and added some CSS to make it look rather nice. Following is an example of the code I used.</p>
<pre><code>&lt;dl&gt;
&lt;dt&gt;1979&lt;/dt&gt;
&lt;dd&gt;I was born&lt;/dd&gt;
&lt;dd&gt;I was baptized&lt;/dd&gt;
&lt;dt&gt;1981&lt;/dt&gt;
&lt;dd&gt;I started preschool&lt;/dd&gt;
&lt;dt&gt;1984&lt;/dt&gt;
&lt;dd&gt;I started kindergarten&lt;/dd&gt;
&lt;dt&gt;1996&lt;/dt&gt;
&lt;dd&gt;I graduated high school&lt;/dd&gt;
&lt;dd&gt;I started college&lt;/dd&gt;
&lt;dt&gt;2002&lt;/dt&gt;
&lt;dd&gt;I got married&lt;/dd&gt;
&lt;dt&gt;2003&lt;/dt&gt;
&lt;dd&gt;My daughter was born&lt;/dd&gt;
&lt;/dl&gt;</code></pre>
<p>I then used CSS similar to the following to make the years really stand out and to make the milestones look like bullet items.</p>
<pre><code>dl {
margin: 0;
padding: 0;
}
dt {
font-size: 1.5em;
font-family: serif;
font-weight: bold;
margin: .5em 0 0 0;
padding: 0;
}
dd {
display: list-item;
list-style: square;
list-style-image: url(bullet.gif);
margin: 0 0 0 2em;
padding: .5em;
}</code></pre>
<p>These are some very quick, dirty, simple examples. With a little extra effort, I&#8217;m sure you could come up with something much nicer and better designed. Give it a shot the next time you&#8217;re working on a project.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/tables-in-html/' rel='bookmark' title='Tables in HTML'>Tables in HTML</a></li>
<li><a href='http://www.htmlcenter.com/blog/wii-tops-list-of-most-sought-after-gifts/' rel='bookmark' title='Wii Tops List of Most Sought-After Gifts'>Wii Tops List of Most Sought-After Gifts</a></li>
<li><a href='http://www.htmlcenter.com/blog/seesmic-desktop-adds-support-for-twitter-lists/' rel='bookmark' title='Seesmic Desktop Adds Support for Twitter Lists'>Seesmic Desktop Adds Support for Twitter Lists</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/styling-a-definition-list-nicely/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using CSS Sprites to Reduce Load Time</title>
		<link>http://www.htmlcenter.com/blog/using-css-sprites-to-reduce-load-time/</link>
		<comments>http://www.htmlcenter.com/blog/using-css-sprites-to-reduce-load-time/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 02:06:42 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[css sprites]]></category>
		<category><![CDATA[Design Topics]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1314</guid>
		<description><![CDATA[I&#8217;ve found quite a few articles and tutorials explaining how CSS sprites are basically the be-all end-all of Web development, going on and on about the idea that all of the icons you use on your Web site should be stored in a single file, reducing the amount of time it takes to load them [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/reduce-the-size-of-your-javascript/' rel='bookmark' title='Reduce the Size of Your Javascript'>Reduce the Size of Your Javascript</a></li>
<li><a href='http://www.htmlcenter.com/blog/php-date-and-time-functions/' rel='bookmark' title='PHP Date and Time Functions'>PHP Date and Time Functions</a></li>
<li><a href='http://www.htmlcenter.com/blog/reduce-the-size-of-your-css-file-with-this-new-tool/' rel='bookmark' title='Reduce the size of your CSS file with this new tool'>Reduce the size of your CSS file with this new tool</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found quite a few articles and tutorials explaining how CSS sprites are basically the be-all end-all of Web development, going on and on about the idea that all of the icons you use on your Web site should be stored in a single file, reducing the amount of time it takes to load them individually and reducing the number of times a browser has to request something from your Web server.</p>
<p>It&#8217;s a great idea, in theory, but it&#8217;s not always practical. CSS sprites are extremely useful when you are working with fixed-size (height or width) elements on your site. However, they can be extremely tricky to implement (and generally not worth the effort) when you&#8217;re dealing with items that have dynamic heights and widths.</p>
<p>When you are dealing with fixed widths or heights, though, CSS sprites can be fantastic, especially if you have a slower Web server or if a large number of your users have slower Internet connections.<span id="more-1314"></span></p>
<p>The idea behind CSS sprites is to basically create a single image file that contains multiple icons or multiple background tiles. They are especially useful when implementing mouse over changes. For instance, let&#8217;s say you are using a background tile on your navigation menu. When users place their mouse pointers over an item in the navigation menu, you switch to a different background tile to change the appearance of the navigation item. The CSS might initially look something like:</p>
<pre>#navitem {
height: 50px;
width: auto;
background: url(bg1.jpg) repeat-x;
}
#navitem:hover {
background: url(bg2.jpg) repeat-x;
}</pre>
<div style="float: right; margin: 0 0 1em 1em; border: 1px solid #666; width: 100px; padding: 5px;"><img class="alignnone size-full wp-image-1315" style="display:block;" title="bg1" src="http://www.htmlcenter.com/wp-content/uploads/2009/11/bg1.jpg" alt="bg1" width="100" height="50" />bg1.jpg</p>
<p><img class="alignnone size-full wp-image-1316" style="display: block;" title="bg2" src="http://www.htmlcenter.com/wp-content/uploads/2009/11/bg2.jpg" alt="bg2" width="100" height="50" /></p>
<p>bg2.jpg</p></div>
<p>The CSS above will automatically switch the background image from bg1.jpg to bg2.jpg when the user places the mouse pointer over the navigation item. Unfortunately, the first time you mouse over the navigation item, the browser needs to make another request of the Web server, and the user has to wait for the image to load.</p>
<p>However, if we implement a CSS sprite for the background change, there is no waiting when you mouse over the item. It immediately displays the new background image. The image does not need to reload, it simply moves. To implement it, you would create a new image that combines the two previous images. Since this particular item is a fixed height, we will stack them on top of each other vertically. If we were dealing with something that was a fixed width, instead, we would stack them horizontally.</p>
<p>Our new CSS will look something like:</p>
<pre>#navitem {
height: 50px;
width: auto;
background: url(bg-sprite.jpg) repeat-x 0 0;
}
#navitem2 {
background-position: 0 -120px;
}</pre>
<p><img class="alignnone size-full wp-image-1318" style="float: right; margin: 0 0 1em 1em; border: none;" title="bg-sprite" src="http://www.htmlcenter.com/wp-content/uploads/2009/11/bg-sprite.jpg" alt="bg-sprite" width="100" height="120" />This CSS uses the same background image for the normal item and for the hover state. All we are doing is moving the background image.</p>
<p>For illustrative purposes, I have made all of the images I&#8217;ve used in this post 100px wide. However, in reality, when using a repeating gradient, you really only need it to be a single pixel wide.</p>
<p>The use of CSS sprites is also extremely useful when you are displaying icons on your Web site. However, you still need to keep in mind that those items need to be basically a fixed height or width (or, at the very least, a maximum height or width). For instance, on one of my Web sites, I use different icons to indicate what type of page or document is located at the end of each link (external links, e-mail links, Word documents, PDF files, etc.). Because the links can be any length (sometimes spanning up to two or three lines, other times using enlarged text, etc.), CSS sprites are not extremely useful for those circumstances.</p>
<p>However, if, instead, you are using icons for fairly consistently sized items, CSS sprites are great. You might even want to experiment with using CSS sprites for dynamic buttons, using a different button for the standard appearance, the hover appearance and the active appearance. Good luck, and let us know when you come across good examples of CSS sprite usage.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/reduce-the-size-of-your-javascript/' rel='bookmark' title='Reduce the Size of Your Javascript'>Reduce the Size of Your Javascript</a></li>
<li><a href='http://www.htmlcenter.com/blog/php-date-and-time-functions/' rel='bookmark' title='PHP Date and Time Functions'>PHP Date and Time Functions</a></li>
<li><a href='http://www.htmlcenter.com/blog/reduce-the-size-of-your-css-file-with-this-new-tool/' rel='bookmark' title='Reduce the size of your CSS file with this new tool'>Reduce the size of your CSS file with this new tool</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/using-css-sprites-to-reduce-load-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Look Into HTML5 and CSS3</title>
		<link>http://www.htmlcenter.com/blog/a-look-into-html5-and-css3/</link>
		<comments>http://www.htmlcenter.com/blog/a-look-into-html5-and-css3/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 02:15:20 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[Web News]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[w3c]]></category>
		<category><![CDATA[whatwg]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1189</guid>
		<description><![CDATA[I spent most of the day today in a conference session dealing with the new elements that will be coming with the future of HTML5 and CSS3, presented by Molly Holzschlag. The session was extremely informative, and we discussed some really interesting topics. In addition to our discussion on HTML5 and CSS3, we discussed quite [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/whats-new-with-html5-css3-and-javascript/' rel='bookmark' title='What&#8217;s New With HTML5, CSS3 and JavaScript?'>What&#8217;s New With HTML5, CSS3 and JavaScript?</a></li>
<li><a href='http://www.htmlcenter.com/blog/free-html5-training/' rel='bookmark' title='Free HTML5 Mobile Training From O&#8217;Reilly'>Free HTML5 Mobile Training From O&#8217;Reilly</a></li>
<li><a href='http://www.htmlcenter.com/blog/captions-in-html5/' rel='bookmark' title='Captions in HTML5'>Captions in HTML5</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I spent most of the day today in a conference session dealing with the new elements that will be coming with the future of HTML5 and CSS3, presented by <a href="http://molly.com/about.php">Molly Holzschlag.</a> The session was extremely informative, and we discussed some really interesting topics. In addition to our discussion on HTML5 and CSS3, we discussed quite a bit about accessibility, browser limitations, the reasons that things are the way they are (doctype declarations, for instance) and how things might be in the future.</p>
<p>Molly made it very clear throughout the session that she does not own a crystal ball, so she obviously can&#8217;t tell us exactly how or when the final CSS3 or HTML5 specs will be completed and approved. However, she did give us some insight into the elements that have already been implemented and the elements that are in the process of being implemented in specific browsers. In this article, I will try to give a quick overview of some of the things she mentioned. Most likely, you&#8217;ve heard of most, if not all of these. However, I just wanted to put some of them together in one place.<span id="more-1189"></span></p>
<p>Another thing Molly repeated is that &#8220;implementation trumps specification.&#8221; In other words, even if the spec is not finalized until 2022 (which is the current estimated date for HTML5), that doesn&#8217;t mean we can&#8217;t start using the new features in the near future. All of the major browsers have already begun to implement some of the items proposed for HTML5, even Internet Explorer 8. However, due to the huge marketshare still held by IE6 and 7, it wouldn&#8217;t be a good idea to begin implementing too many of these features on a large production site.</p>
<h2>HTML5</h2>
<ul>
<li><strong>Aside, section and article</strong> &#8211; These three elements are basically new implementations of the div.
<ul>
<li>The aside is intended to be a call-out, sidebar or aside from the topic-at-hand.</li>
<li>The section element is intended to break a page into multiple areas. For instance, if you happen to have two or three separate topics all included on a single page, you might want to place each topic in a separate &#8220;section.&#8221;</li>
<li>The article element will be helpful to separate different articles or summaries on a page. This will be extremely helpful for things like blogs, where multiple summaries or excerpts are all posted together on a page. Rather than using a specific class to separate the articles or posts, you will be able to simply use the article tag.</li>
</ul>
</li>
<li><strong>Audio and Video</strong> &#8211; A lot of work is being done (particularly with Theora) to secure the appropriate licensing to implement OGG codecs within the browser software, making it possible to embed audio and video files in a page without requiring external plug-ins. You will do so with the audio and video tags.</li>
<li><strong>Figures</strong> &#8211; HTML5 also proposes implementing the legend tag with images, audio and video (by wrapping them in the figure tag), allowing you to easily and consistently add captions to your media files.</li>
<li><strong>Dialog</strong> &#8211; The dialog element is a new, special type of definition list (dl) intended specifically for dialog between two (or more) people. The definition term (dt) is used for the speaker&#8217;s name, while the definition item (dd) is used for the quote itself.</li>
<li><strong>Header and footer</strong> &#8211; Just as they sound, the header and footer elements are intended to represent the header and footer of your pages. These are going to be instrumental in improving accessibility, implementing a consistent method of creating headers and footers.</li>
</ul>
<h3>Form Elements</h3>
<p>A lot of new features are also being added to HTML forms. With the HTML5 implementation, you will be able to specify which form elements are<strong> required</strong> and which are not. The browser will perform the validation without the need for any script (client-side or server-side).</p>
<p>Quite a few new types of form inputs are also being added, including URL and e-mail. Presumably, the browser will also perform some sort of validation on these elements, though we did not discuss that in detail.</p>
<h3>Page Features</h3>
<p>HTML5 also implements quite a few new interactive features on the pages themselves. Drag and drop is already implemented in some browsers, as is the ability to edit content inline (though, to actually save the edits, you will have to use script). You will also be able to hint as to whether or not the browser should use spellchecking. HTML5 also implements a &#8220;canvas&#8221; to be used to draw elements on the page and adds support for SVG (scalable vector graphics) images (which, if you are not aware, can be displayed at any size without distortion, as they are vectors).</p>
<p>Molly also told us that <a href="http://remysharp.com/about/">Remy Sharp</a> is in the process of developing a <a href="http://remysharp.com/2009/01/07/html5-enabling-script/">javascript implementation of the HTML5 spec</a>, so you can begin using some of the HTML5 elements even in IE6 and 7.</p>
<h2>CSS3</h2>
<p>CSS3 is also going to introduce all kinds of nice new features, as well. Following are some of my favorites. You can check out previews of all of these features (as well as a list of many more) by <a href="http://www.css3.info/preview/">visiting CSS3.info.</a></p>
<ul>
<li><strong>Rounded corners</strong> &#8211; CSS3 implements a new property called border-radius that allows you to easily implement rounded corners on any bordered element.</li>
<li><strong>Text shadow</strong> &#8211; You will also be able to add a drop shadow to your text using CSS. This has been implemented in Opera 10, Chrome, Safari and Firefox 3.5. However, each browser renders it slightly differently, which might be very frustrating.</li>
<li><strong>Multiple backgrounds</strong> &#8211; CSS3 will allow you to add multiple background images to a single element. This should significantly reduce the amount of wrapper and container divs that are created simply to add an extra background.</li>
<li><strong>RGBA, HSL and HSLA</strong> &#8211; CSS3 implements three new methods for declaring an element&#8217;s color. They are RGBA (red, green, blue, alpha), which allows you to specify the color in RGB and specify its opacity; HSL, which allows you to specify your color in hue, saturation and lightness; and HSLA (hue, saturation, lightness, alpha), which allows you to specify an HSL color and its opacity.</li>
<li><strong>Attribute Selectors</strong> &#8211; You will be able to use a great deal of nice attribute selectors with CSS3, including being able to select specific child nodes of an element (including the ability to implement styles on every other child &#8211; particularly useful for alternating table rows), and being able to style your form elements more easily (for instance, you can assign a specific style to any form inputs with the new &#8220;required&#8221; attribute).</li>
<li><strong>Multi-column layout</strong> &#8211; This is a huge new addition. With CSS3, you will be able to specify a specific width of columns or a specific number of columns and have your content automatically overflow properly into the columns.</li>
</ul>
<p>You can find more information about the new <a href="http://html5doctor.com/">HTML5 proposals and implementations</a> at HTML5 Doctor and <a href="http://www.css3.info/">more information about CSS3</a> at CSS3 Info.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/whats-new-with-html5-css3-and-javascript/' rel='bookmark' title='What&#8217;s New With HTML5, CSS3 and JavaScript?'>What&#8217;s New With HTML5, CSS3 and JavaScript?</a></li>
<li><a href='http://www.htmlcenter.com/blog/free-html5-training/' rel='bookmark' title='Free HTML5 Mobile Training From O&#8217;Reilly'>Free HTML5 Mobile Training From O&#8217;Reilly</a></li>
<li><a href='http://www.htmlcenter.com/blog/captions-in-html5/' rel='bookmark' title='Captions in HTML5'>Captions in HTML5</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/a-look-into-html5-and-css3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How CSS is Implemented in E-mail Clients</title>
		<link>http://www.htmlcenter.com/blog/how-css-is-implemented-in-e-mail-clients/</link>
		<comments>http://www.htmlcenter.com/blog/how-css-is-implemented-in-e-mail-clients/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 16:50:57 +0000</pubDate>
		<dc:creator>Curtiss</dc:creator>
				<category><![CDATA[CSS Tutorials]]></category>
		<category><![CDATA[compatibility]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[html message]]></category>
		<category><![CDATA[outlook]]></category>

		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1160</guid>
		<description><![CDATA[The other day, Smashing Magazine tweeted about an updated guide to CSS implementation in e-mail clients. The guide is extremely helpful, as it shows you exactly what CSS techniques and features you can use within your HTML e-mail messages and which e-mail clients will display them correctly. The chart displayed in the original blog post shows [...]
Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/e-mail-client-survey-what-are-people-using/' rel='bookmark' title='E-mail Client Survey &#8211; What Are People Using?'>E-mail Client Survey &#8211; What Are People Using?</a></li>
<li><a href='http://www.htmlcenter.com/blog/google-hosted-apps-and-sending-mail-from-a-web-server/' rel='bookmark' title='Google Hosted Apps and Sending Mail From a Web Server'>Google Hosted Apps and Sending Mail From a Web Server</a></li>
<li><a href='http://www.htmlcenter.com/blog/yahoo-updates-mail-terms-and-conditions/' rel='bookmark' title='Yahoo! Updates Mail Terms and Conditions'>Yahoo! Updates Mail Terms and Conditions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>The other day, <a href="http://twitter.com/smashingmag/status/3711741197">Smashing Magazine tweeted</a> about an updated guide to CSS implementation in e-mail clients. The guide is extremely helpful, as it shows you exactly what CSS techniques and features you can use within your HTML e-mail messages and which e-mail clients will display them correctly.</p>
<p>The chart displayed in the <a href="http://www.campaignmonitor.com/css/">original blog post</a> shows over 50 different CSS techniques and elements are evaluated for 11 different e-mail/Webmail clients. Apparently the PDF and Excel versions of the chart that are linked from the post include more than 23 different mail clients. Unfortunately, looking at the chart, it appears that the safest way to create an attractive e-mail message that looks the way you intend in multiple e-mail clients is to code with tables and inline styles.</p>
<p>Related posts:<ol>
<li><a href='http://www.htmlcenter.com/blog/e-mail-client-survey-what-are-people-using/' rel='bookmark' title='E-mail Client Survey &#8211; What Are People Using?'>E-mail Client Survey &#8211; What Are People Using?</a></li>
<li><a href='http://www.htmlcenter.com/blog/google-hosted-apps-and-sending-mail-from-a-web-server/' rel='bookmark' title='Google Hosted Apps and Sending Mail From a Web Server'>Google Hosted Apps and Sending Mail From a Web Server</a></li>
<li><a href='http://www.htmlcenter.com/blog/yahoo-updates-mail-terms-and-conditions/' rel='bookmark' title='Yahoo! Updates Mail Terms and Conditions'>Yahoo! Updates Mail Terms and Conditions</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.htmlcenter.com/blog/how-css-is-implemented-in-e-mail-clients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

