<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<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/"
	>

<channel>
	<title>CSS Marvels</title>
	<link>http://cssmarvels.com</link>
	<description>CSS Resources &#124; CSS Library &#124; CSS Techniques &#124; CSS Tips and Tricks</description>
	<pubDate>Sun, 15 Jun 2008 04:05:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>CSS Fixed Menu - Pinned-Down Style</title>
		<link>http://cssmarvels.com/archives/19</link>
		<comments>http://cssmarvels.com/archives/19#comments</comments>
		<pubDate>Tue, 29 Jan 2008 20:47:33 +0000</pubDate>
		<dc:creator>raphael</dc:creator>
		
		<category><![CDATA[Menus]]></category>

		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://cssmarvels.com/archives/19</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 [...]]]></description>
			<content:encoded><![CDATA[<p>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. </p>
<h3>Pinned-Down Style</h3>
<p>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.</p>
<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;
...
</code></pre>
<p>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:</p>
<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>
<p>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.</p>
<p>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.</p>
<p>That&#8217;s it. Pretty simple. Play around with these settings and find the best design for your needs!</p>
<h3>Examples:</h3>
<p><a href="http://cssmarvels.com/examples/fixed_menu/">Click here see an example.</a></p>
<h3>Credits:</h3>
<p><a href="http://www.w3.org/Style/Examples/007/menus" target="_blank">W3C: CSS Fixed Menus</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cssmarvels.com/archives/19/feed</wfw:commentRss>
		</item>
		<item>
		<title>A Few Updates and Happy Holidays!</title>
		<link>http://cssmarvels.com/archives/18</link>
		<comments>http://cssmarvels.com/archives/18#comments</comments>
		<pubDate>Wed, 19 Dec 2007 10:52:23 +0000</pubDate>
		<dc:creator>raphael</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://cssmarvels.com/archives/18</guid>
		<description><![CDATA[I just did some minor updates to the site which includes more socializing tools like Technorati  and Reddit. Also, to make things a little spicier I added different page banners to the site rotation which can be seen randomly on each page.
I want also to wish everyone a Happy Holiday! I will be out [...]]]></description>
			<content:encoded><![CDATA[<p>I just did some minor updates to the site which includes more socializing tools like <a href="http://technorati.com/" target="_blank">Technorati </a> and <a href="http://reddit.com/" target="_blank">Reddit</a>. Also, to make things a little spicier I added different page banners to the site rotation which can be seen randomly on each page.</p>
<p>I want also to wish everyone a Happy Holiday! I will be out of town to visit some family and friends down south and I&#8217;ll be back in a couple of weeks. I can&#8217;t say now that I&#8217;ll be able to post stuff for you guys, but I&#8217;ll try my best to do it while I&#8217;m gone. </p>
<p>Happy Holidays!</p>
<p>R.</p>
]]></content:encoded>
			<wfw:commentRss>http://cssmarvels.com/archives/18/feed</wfw:commentRss>
		</item>
		<item>
		<title>CSS Image Preloader</title>
		<link>http://cssmarvels.com/archives/17</link>
		<comments>http://cssmarvels.com/archives/17#comments</comments>
		<pubDate>Mon, 17 Dec 2007 10:05:45 +0000</pubDate>
		<dc:creator>raphael</dc:creator>
		
		<category><![CDATA[Images]]></category>

		<category><![CDATA[Rollover Buttons]]></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://cssmarvels.com/archives/17/feed</wfw:commentRss>
		</item>
		<item>
		<title>Replacing Text With Images in CSS</title>
		<link>http://cssmarvels.com/archives/15</link>
		<comments>http://cssmarvels.com/archives/15#comments</comments>
		<pubDate>Tue, 11 Dec 2007 08:24:42 +0000</pubDate>
		<dc:creator>raphael</dc:creator>
		
		<category><![CDATA[Images]]></category>

		<category><![CDATA[Rollover Buttons]]></category>

		<category><![CDATA[Techniques]]></category>

		<guid isPermaLink="false">http://cssmarvels.com/archives/15</guid>
		<description><![CDATA[Sometimes we want to decorate our site with nice looking text but can&#8217;t achieve it by just formatting the text to a different font. Why not? Because not all users have the same fonts installed in their systems. 
With CSS we can replace a piece of text with an image containing the graphical presentation of [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes we want to decorate our site with nice looking text but can&#8217;t achieve it by just formatting the text to a different font. Why not? Because not all users have the same fonts installed in their systems. </p>
<p>With CSS we can replace a piece of text with an image containing the graphical presentation of the text. These images will only serve the purpose of decorating the page with a fancier font because they don&#8217;t carry any value to the content of the page.</p>
<h3>How Can We Achieve That?</h3>
<p>There are some CSS techniques in which you set the dimensions of the element to the image&#8217;s dimensions and define the image to be the element&#8217;s background image. Also, to prevent the text from overlaying the image we have to enclose this text in a span tag and hide it in the CSS using <span class="simplecode">display: none;</span> </p>
<p>There is a problem with this technique: If the image cannot be displayed (broken link, corrupted file, etc) nothing will be visible to the user because the only available text is hidden. This is a no-no in today&#8217;s accessibility standards!</p>
<p>There&#8217;s a very simple way to replace your text with an image file. We will still use our image and text, but this time we are going to place an empty span tag next to the text that we are going to hide. Then we are going to position that image absolutely, causing the image to overlay the text.  Let&#8217;s get to it!</p>
<h3>The Image:</h3>
<p><img src='http://cssmarvels.com/wp-content/uploads/2007/12/chapter_1.jpg' alt='Chapter 1 Sample Image' class="noborder" /></p>
<h3>The CSS Code:</h3>
<pre><code>
h2{
	margin-bottom: 40px;
        font-size: 14px;
}

h2 #chapter1{
	position: absolute;
	width: 240px;
	height: 46px;
	background: url(chapter_1.jpg) no-repeat;
        display: block;
        margin: 0;
        padding: 0;
}
</code></pre>
<h3>The XHTML Code:</h3>
<pre><code >
&lt;h2&gt;&lt;span id="chapter1"&gt;&lt;/span&gt;Chapter 1&lt;/h2&gt;
</code></pre>
<ul>
<li>Note that I added 40 pixels of bottom margin to the <span class="simplecode">h2</span> element in order to push the paragraph down causing it to clear the image. You can experience with this value depending on the height of your image.</li>
</ul>
<h3>Summary:</h3>
<p>With this technique the text will always display even if the image doesn&#8217;t load. Also,  screen readers will ignore the image and read the piece of text under it - this helps your site&#8217;s accessibility. Lastly, this is search engine friendly! Images have no value to search engines but because you have text below them, search engines can read that text. This is a technique that I use abundantly throughout <a href="http://raphaelhaefeli.com" target="_blank">my site</a>. </p>
<p>You can also use this technique with links and also add different images for a rollover state!</p>
<h3>Examples:</h3>
<p><a href="http://cssmarvels.com/examples/image_replacement" target="_blank"> Click here to see an example.</a><br />
<a href="http://raphaelhaefeli.com" target="_blank">Click to see a link example with rollover image.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cssmarvels.com/archives/15/feed</wfw:commentRss>
		</item>
		<item>
		<title>Creating CSS Rollover Buttons</title>
		<link>http://cssmarvels.com/archives/14</link>
		<comments>http://cssmarvels.com/archives/14#comments</comments>
		<pubDate>Thu, 06 Dec 2007 22:06:15 +0000</pubDate>
		<dc:creator>raphael</dc:creator>
		
		<category><![CDATA[Menus]]></category>

		<category><![CDATA[Rollover Buttons]]></category>

		<guid isPermaLink="false">http://cssmarvels.com/archives/14</guid>
		<description><![CDATA[There are many different alternatives when it comes to creating rollover buttons for the web with the most popular method being JavaScript. This presents many obstacles: You need to write a script in order to preload the image into the browsers cache, the images will flicker in some browser versions (Internet Explorer in particular due [...]]]></description>
			<content:encoded><![CDATA[<p>There are many different alternatives when it comes to creating rollover buttons for the web with the most popular method being JavaScript. This presents many obstacles: You need to write a script in order to preload the image into the browsers cache, the images will flicker in some browser versions (Internet Explorer in particular due to not being able to cache images) and the most important: using images as text replacement is not search engine friendly.</p>
<p>Now there&#8217;s an alternative solution with CSS that eliminates all of these problems!</p>
<p>With this particular technique we will combine the power of images (user friendly and eye candy) and text (search engine friendly) to create a nice looking CSS rollover button with no flickering and preloading necessary.</p>
<p>In this example I used only 2 images for the background, one for the normal state of the button and one for the rollover state:</p>
<p><img src="http://cssmarvels.com/wp-content/uploads/2007/12/tab_ro.jpg" alt="tab_ro.jpg" class="noborder" /> <img src="http://cssmarvels.com/wp-content/uploads/2007/12/tab_up.jpg" alt="tab_up.jpg" class="noborder" /></p>
<p>What we will do is change the background by replacing the image every time the user hovers the link and to make a nice contrast we will also change the color of the text.</p>
<h3>The CSS Code:</h3>
<pre><code >

#nav {
  padding: 0;
  list-style-type: none;
  float: right;
  font-weight: bold;
}

#nav li {
  float: left;
}

#nav a {
  float: left;
  width: 97px;
  height: 60px;
  text-align: center;
  color: #FFFFFF;
  text-decoration: none;
  background: url(image_rested_state.jpg) no-repeat;
  border-right-width: 1px;
  padding-top: 10px;
}

#nav a:hover {
 background: url(image_rollover.jpg) no-repeat;
 color: #000000;
}
</code></pre>
<h3>The XHTML Code:</h3>
<pre><code >
&lt;ul id="nav"&gt;
	&lt;li&gt;&lt;a href="page1.html"&gt;PAGE 1&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="page2.html"&gt;PAGE 2&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="page3.html"&gt;PAGE 3&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href="page4.html"&gt;PAGE 4&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href="page5.html"&gt;PAGE 5&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>
<h3>Summary:</h3>
<p> This CSS technique allows us to swap images while still keeping text in our link, giving us the advantage of having graphics for human viewers and text for <a href="http://en.wikipedia.org/wiki/Web_crawler" target="_blank">Web Crawlers</a>.</p>
<h3>Examples:</h3>
<p>You can see a working example at <a href="http://www.ithelps.org" target="_blank">www.ithelps.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cssmarvels.com/archives/14/feed</wfw:commentRss>
		</item>
		<item>
		<title>CSS Marvels is Launched!</title>
		<link>http://cssmarvels.com/archives/9</link>
		<comments>http://cssmarvels.com/archives/9#comments</comments>
		<pubDate>Thu, 06 Dec 2007 05:14:42 +0000</pubDate>
		<dc:creator>raphael</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://cssmarvels.com/archives/9</guid>
		<description><![CDATA[I am happy to announce that CSS Marvels has been launched! This is the birth on one of my personal projects and it great to see it come online.
This site will gather CSS resources from all over the web to fulfill everyone&#8217;s CSS needs. It will include CSS techniques, tips, tricks and hacks which will [...]]]></description>
			<content:encoded><![CDATA[<p>I am happy to announce that CSS Marvels has been launched! This is the birth on one of my personal projects and it great to see it come online.</p>
<p>This site will gather CSS resources from all over the web to fulfill everyone&#8217;s CSS needs. It will include CSS techniques, tips, tricks and hacks which will make your CSS code work on a wide variety of browsers.</p>
<p>Users have the option to register to this site and become part of CSS Marvel&#8217;s online community. Also, you can use a feed reader of your choice to keep track of new postings and updates to CSS Marvels or by subscribing directly to the <a href="http://cssmarvels.com/feed" title="Article Feed">Article RSS Feeds</a> or to the <a href="http://cssmarvels.com/comments/feed" title="Comment Feed">Comments RSS Feeds</a>.</p>
<p>Hope to see you all here quenching your CSS thirst! New articles are coming soon!</p>
<p>Raphael</p>
]]></content:encoded>
			<wfw:commentRss>http://cssmarvels.com/archives/9/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
