<?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>raphael haefeli &#124; portland, oregon freelance web design and development &#187; CSS</title>
	<atom:link href="http://www.raphaelhaefeli.com/archives/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.raphaelhaefeli.com</link>
	<description>Home of Raphael Haefeli</description>
	<lastBuildDate>Wed, 11 Aug 2010 22:56:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CSS Fixed Menu – Pinned-Down Style</title>
		<link>http://www.raphaelhaefeli.com/css/css-fixed-menu-pinned-down/</link>
		<comments>http://www.raphaelhaefeli.com/css/css-fixed-menu-pinned-down/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 07:10:56 +0000</pubDate>
		<dc:creator>Raphael</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.raphaelhaefeli.com/?p=217</guid>
		<description><![CDATA[CSS is such a simple, but powerful mechanism for adding style to websites which makes your design options infinite. One of the most common uses of CSS is to create nice looking and useful menus for websites. We can create all kinds of different styles for menus: Horizontal, vertical, with drop down boxes, etc.

Pinned-Down Style

There&#8217;s [...]]]></description>
			<content:encoded><![CDATA[CSS is such a simple, but powerful mechanism for adding style to websites which makes your design options infinite. One of the most common uses of CSS is to create nice looking and useful menus for websites. We can create all kinds of different styles for menus: Horizontal, vertical, with drop down boxes, etc.

<h3>Pinned-Down Style</h3>

There&#8217;s another technique that I found to be very interesting and pretty cool to apply to our menus. It&#8217;s called Pinned-Down Style. Our menu is going to be in a fixed position on the page and when the user scrolls up and down the menu will float over the page at the position we defined.

<h3>The XHTML Code:</h3>

<pre><code >
...
&lt;body&gt;

&lt;div class="banner"&gt;
    &lt;p&gt;
        &lt;a href="#"&gt;Home&lt;/a&gt;
        &lt;a href="#"&gt;About Us&lt;/a&gt;
        &lt;a href="#"&gt;Our Activities&lt;/a&gt;
        &lt;a href="#"&gt;Contact Us&lt;/a&gt;
        &lt;a href="#/"&gt;Site Map&lt;/a&gt;
        &lt;a href="#"&gt;Privacy&lt;/a&gt;
        &lt;a href="#"&gt;Links&lt;/a&gt;
        &lt;a href="#"&gt;Our Partners&lt;/a&gt;
        &lt;a href="#"&gt;Articles&lt;/a&gt;
    &lt;/p&gt;
&lt;/div&gt;
...

&lt;/body&gt;</code></pre>

This is just a paragraph with links that we are going to style with CSS. We can see the final result after we apply the following CSS code:

<h3>The CSS Code:</h3>

<pre><code >
div.banner {
	margin: 0;
	font-size: 100% /*adjust to make the menu larger or smaller*/;
	font-weight: bold;
	line-height: 1.1;
	text-align: center;
	position: fixed;
	top: 2em;
	left: auto;
	width: 8.5em;
	right: 2em;
}

div.banner p {
	margin: 0;
	padding: 0.3em 0.4em;
	font-family: Arial, sans-serif;
	background: #990000;
	border: thin outset #000;
	color: white;
}

div.banner a, div.banner em { display: block; margin: 0 0.5em }
div.banner a, div.banner em { border-top: 2px groove #CCC }
div.banner a:first-child { border-top: none }
div.banner em { color: #CFC }

div.banner a:link { text-decoration: none; color: white }
div.banner a:visited { text-decoration: none; color: #CCC }
div.banner a:hover { background: black; color: white }
</code></pre>

<h3>Summary</h3>

This is a good technique for a website that has a lot of content. It enables the user to access the menu quickly instead of having to scroll up the page to access the menu in order to navigate the site. What makes this work are the the 2 following rules: <span class="simplecode">position: fixed;</span> which causes the menu to be in a fixed position, and the <span class="simplecode">display: block;</span> that makes the <span class="simplecode">a</span> elements inside the menu to be displayed as block elements causing them to display one below the other.

It would be a good idea to place the XHTML code for the menu at the top of all the content, right below the opening <span class="simplecode">body</span> tag for organization purposes.

That&#8217;s it. Pretty simple. Play around with these settings and find the best design for your needs!

<h3>Examples:</h3>

<a href="/demos/examples/fixed_menu/">Click here see an example.</a>


<h3>Credits:</h3>


<a href="http://www.w3.org/Style/Examples/007/menus" target="_blank">W3C: CSS Fixed Menus</a>]]></content:encoded>
			<wfw:commentRss>http://www.raphaelhaefeli.com/css/css-fixed-menu-pinned-down/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Image Preloader</title>
		<link>http://www.raphaelhaefeli.com/images/css-image-preloader/</link>
		<comments>http://www.raphaelhaefeli.com/images/css-image-preloader/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 09:05:45 +0000</pubDate>
		<dc:creator>Raphael</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Tricks]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://cssmarvels.com/archives/17</guid>
		<description><![CDATA[In today&#8217;s age of high-speed internet, the last thing that users want to do is to wait for a website to load even if it is for a few seconds. One of the &#8220;musts&#8221; for today&#8217;s web design is to create a website that loads quickly enough so users don&#8217;t leave your site before the [...]]]></description>
			<content:encoded><![CDATA[<p>In today&#8217;s age of high-speed internet, the last thing that users want to do is to wait for a website to load even if it is for a few seconds. One of the &#8220;musts&#8221; for today&#8217;s web design is to create a website that loads quickly enough so users don&#8217;t leave your site before the whole page is displayed.</p>

<p>To minimize this problem, many sites are designed to preload images in order to speed up page display. JavaScript is the most common way to preload images but it is not the only option available. An alternative to JavaScript is to use the CSS <span class="simplecode">display: none;</span> property. This technique may be more reliable and it requires less complex code. Easy!</p>

<p>Preloading images using JavaScript is a good technique, however, browsers must be JavaScript-enabled and have JavaScript turned on. Without JavaScript, the images won&#8217;t preload.</p>

<h3>CSS: Our Best Preloading Friend!</h3>

<p>CSS offers us a simple and reliable option. By using <span class="simplecode">display: none;</span>, we tell the browser to request an image from the server, but not to display it on the page. The browser just requests the image from the server and <a href="http://en.wikipedia.org/wiki/Cache" target="_blank">caches</a> it for future use.</p>

<h3>Common Uses:</h3>

<ul>
<li>Use in the home page to load images that will be used on the rest of the website</li>
<li><a href="http://en.wikipedia.org/wiki/Cache" target="_blank">Cache</a> all the hover images in your site for menus, slide shows, etc.</li>
</ul>

<h3>The CSS Code:</h3>

<p>This is a very simple technique. All we need to do is to place the <span class="simplecode">img</span> tags at the beginning, right under the opening <span class="simplecode">body</span> tag and insert CSS style directly within the <span class="simplecode">img</span> tag:</p>

<pre><code >...

&lt;/head&gt;

&lt;body&gt;

&lt;!--preloaders--&gt;
&lt;img src="image_1.jpg" style="display:none;" alt=""/&gt;
&lt;img src="image_2.jpg" style="display:none;" alt=""/&gt;
&lt;img src="image_3.jpg" style="display:none;" alt=""/&gt;
&lt;!--end preloaders--&gt;

...
</code></pre>

<ul>
<li>Very Important: The empty <span class="simplecode">alt</span> tag is important because screen readers will simply ignore the image. You <strong>MUST</strong> insert the empty <span class="simplecode">alt</span> tag otherwise your website will fail the <a href="http://www.w3c.org">W3C</a>&#8217;s accessibility standards!</li>
<li>A good idea is to insert comments like in the example above just to separate and locate your rollover images</li>
</ul>

<h3>Summary:</h3>

<p>That&#8217;s it for this technique! Very simple, almost no code and same results as JavaScript.</p>]]></content:encoded>
			<wfw:commentRss>http://www.raphaelhaefeli.com/images/css-image-preloader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
