<?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>Web Cash &#187; tooltip</title>
	<atom:link href="http://www.earn-web-cash.com/tag/tooltip/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.earn-web-cash.com</link>
	<description>Writing, Designing, and Making Money Online</description>
	<lastBuildDate>Sun, 04 Dec 2011 22:52:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>How to Add a Gradient Background to a CSS Tooltip</title>
		<link>http://www.earn-web-cash.com/2008/01/21/tooltip-gradient/</link>
		<comments>http://www.earn-web-cash.com/2008/01/21/tooltip-gradient/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 02:13:18 +0000</pubDate>
		<dc:creator>Walkere</dc:creator>
				<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[gradient]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[tooltip]]></category>

		<guid isPermaLink="false">http://www.earn-web-cash.com/2008/01/21/tooltip-gradient/</guid>
		<description><![CDATA[In an earlier post, we learned how to create a tooltipKind of like this boring, gray tooltip. using CSS. I walked you through the mechanics of creating the tooltip and left the actual css styling up to you. Today, we&#8217;ll take a look at how to make this tooltip look a bit nicer &#8211; using [...]]]></description>
			<content:encoded><![CDATA[<p>In an <a href="http://www.earn-web-cash.com/2008/01/19/create-css-tooltips/">earlier post</a>, we learned how to create a <a class="tooltip">tooltip<span>Kind of like this boring, gray tooltip.</span></a> using CSS.  I walked you through the mechanics of creating the tooltip and left the actual css styling up to you.</p>

<p>Today, we&#8217;ll take a look at how to make this tooltip look a bit nicer &#8211; using a gradient background and some extra styling.</p>
<span id="more-56"></span>
<p>To review, here&#8217;s the basic styling to create the tooltip.  Refer to the <a href="http://www.earn-web-cash.com/2008/01/19/create-css-tooltips/">original post for an explanation of the CSS/HTML</a>.</p>

<pre><code>a.info span {
    display: none; }

a.info:hover {
    position: relative; }

a.info:hover span {
    display: block;
    position: absolute;
    top: 0;
    left: 0; }
</code></pre>

<p>In order to make this look a bit nicer, kind of like <a class="tooltip">this tooltip<span class="gradient">This tooltip has a gradient background, some bold-face font, and a nice border on top and bottom.</span></a>, we&#8217;re going have to add some more style to <code>a.info:hover span</code>.</p>

<p>First, let&#8217;s change the colors a bit, add a nicer border, add some padding, and move the tooltip down about one line.</p>

<pre><code>a.info hover span {
   top: 1.5em;
   padding: 1em;
   border-top: 3px solid #d58700;
   border-bottom: 3px solid #d58700;
   border-left: none;
   border-right: none;
   color: white;
   background: #516898; }</code></pre>

<p>Adding that styling would leave us with <a class="tooltip">this tooltip<span class="gradient" style="background: #516898;">This looks a lot nicer, but we still need a gradient background.</span></a>.</p>

<p>I created a <a href="http://www.earn-web-cash.com/wp-content/themes/webcash/images/tooltip-gradient.png" alt="Gradient image for the background of the tooltip">gradient image</a> in GIMP.  You should be able to do this in your favorite image editing program.</p>

<p>I made the gradient image 120px tall.  I figured that&#8217;s high enough for the average tooltip, and longer ones will be covered by the standard background color.  This background color should be the same as the bottom color of the gradient.  That way when the gradient ends&#8230; it blends in nicely.</p>

<p>To add the gradient, we&#8217;ll change one line in the css declaration for <code>a.info:hover span</code> &#8211; the <code>background</code> line.</p>

<pre><code>background: #516898 url
  (images/tooltip-gradient.png) repeat-x top;</code></pre>

<p>Now we&#8217;ve got our <a class="tooltip">final tooltip<span class="gradient">This should be nicely styled.  Looks good to me anyway.</span></a>.</p>

<p>You&#8217;ll notice a few things in the <code>background</code> declaration &#8211; and these hold true for any time you use a gradient background.  I included a color &#8211; which is equal to the bottom end of the gradient.  This way it can blend in if the tooltip becomes longer than the gradient image.</p>

<p>I included <code>repeat-x</code> &#8211; which means that the gradient image will be repeated every 1 px along the x-axis.  This let&#8217;s you expand the image to the full width of the block, but only have to load a nicely small 1px wide image.  I also included <code>top</code> to make sure that the gradient appears all the way to the top of the tooltip&#8217;s box.</p>

<p>Well there you have it.  Once you get the mechanics of the tooltip down, it&#8217;s pretty simple to add extra styling like a gradient background image.  All you need to do is create your own gradient and tailor the colors to your own needs.</p>

<p>Happy tool-tipping.</p>]]></content:encoded>
			<wfw:commentRss>http://www.earn-web-cash.com/2008/01/21/tooltip-gradient/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Five Non-Traditional Ways to Use Tooltips</title>
		<link>http://www.earn-web-cash.com/2008/01/20/five-ways-tooltips/</link>
		<comments>http://www.earn-web-cash.com/2008/01/20/five-ways-tooltips/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 12:01:53 +0000</pubDate>
		<dc:creator>Walkere</dc:creator>
				<category><![CDATA[Sundry Musings]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[tooltip]]></category>

		<guid isPermaLink="false">http://www.earn-web-cash.com/2008/01/20/five-ways-tooltips/</guid>
		<description><![CDATA[In standard HTML, tooltips seem to be reserved for anchor tags &#8211; i.e. links. They get the all-powerful &#8220;title&#8221; attribute which is turned into a tooltip. There are plenty of other times that you&#8217;d want to use a tooltip, though. If you&#8217;re wondering how, check out this previous post on how to create a custom [...]]]></description>
			<content:encoded><![CDATA[<p>In standard HTML, tooltips seem to be reserved for anchor tags &#8211; i.e. links.  They get the all-powerful &#8220;title&#8221; attribute which is turned into a tooltip.</p>
<p>There are plenty of other times that you&#8217;d want to use a tooltip, though.  If you&#8217;re wondering how, check out this previous post on <a href="http://www.earn-web-cash.com/2008/01/19/create-css-tooltips/">how to create a custom tooltip with css</a>.</p>
<p>Otherwise, read on for some thoughts on <em>when</em> to use these tooltips.<br />
<span id="more-47"></span></p>
<h5>5. Definitions of Words</h5>
<p>One interesting way to use custom tooltips is to show the definition of a word.  This would be great for educational sites that aim to teach their users about a given subject.  Rather than link to a new page with information on a word, just include a brief explanation in a tooltip.</p>
<p>Likewise, this could be used on coding tutorial sites to pop-up information on built-in functions and such.  Hmm&#8230; do I smell a useful WordPress plug-in?</p>
<h5>4. Movie/Book/Television Spoilers</h5>
<p>Do you write about movies, books, or tv shows?  Well, I don&#8217;t.  But if you did&#8230; you might want to share spoilers and other information with your users.</p>
<p>The problem is that not all users <em>want</em> to have the ending spoiled for them.  I saw a similar thing used in a forum &#8211; all spoilers had to be wrapped in a bb-code tag that made them invisible until you moused-over them.</p>
<p>This way users can choose whether or not to learn the ending of the story.  If you leave it out on the screen, they might read it by accident and blame you for ruining the whole thing.</p>
<h5>3. Citations and Source Quotes</h5>
<p>Do you find yourself quoting other sources often?  Maybe your blog is a bit on the literary or academic side?</p>
<p>You could use these tooltips to contain footnoting and citation information.  Rather than clicking a link to go to the bottom of the screen (i.e. Wikipedia style), have the information pop-up on a tooltip.</p>
<p>I know that when I&#8217;m reading a book I&#8217;m far more likely to pay attention to footnotes that are on the same page than footnotes at the end of the chapter or book.  Convenience is key.</p>
<h5>2.  Puzzle or Logic Game Tips</h5>
<p>Do you have some kind of puzzle, quiz, or game on your website?  People love a challenge&#8230; but they hate a game that&#8217;s too hard.</p>
<p>The solution, of course, is to offer the user hints.  These can&#8217;t be readily visible, though, or it&#8217;ll spoil the game.</p>
<p>With the tooltip, the user can easily mouse-over some text that says &#8220;First Tip,&#8221; to get a little hint without opening up a new window.  Convenient indeed.</p>
<h5>1.  Instructions and Information for Forms</h5>
<p>I&#8217;m not a big fan of extra text hanging out on a form telling a user what to do.  It seems to get in the way and detract from the look of the form.</p>
<p>Instead, use a tooltip over the label (or add a &#8220;?&#8221; for the tooltip) to tell the user what to enter in a field.  That way you can include lots of information &#8211; so much that you might find it to be over-simplifying &#8211; and the user won&#8217;t have to read this &#8220;help&#8221; unless they actually need it.</p>
<p>You help the confused users without turning off the savvy ones.</p>
<h5>What Else?</h5>
<p>I&#8217;m sure there are dozens of other ways to use custom tooltips.  Got some ideas?</p>
<p>Then leave a comment.  I&#8217;d love to hear how you&#8217;d use them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.earn-web-cash.com/2008/01/20/five-ways-tooltips/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Create Tooltips You Can Style with CSS</title>
		<link>http://www.earn-web-cash.com/2008/01/19/create-css-tooltips/</link>
		<comments>http://www.earn-web-cash.com/2008/01/19/create-css-tooltips/#comments</comments>
		<pubDate>Sat, 19 Jan 2008 22:07:48 +0000</pubDate>
		<dc:creator>Walkere</dc:creator>
				<category><![CDATA[HTML Tutorials]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[anchor]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tooltip]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.earn-web-cash.com/2008/01/19/how-to-create-tooltips-you-can-style-with-css/</guid>
		<description><![CDATA[Hover your mouse over this link to Web Cash. Notice the tooltip? You can achieve a tooltip like that on any anchor text by defining a &#8220;title&#8221; attribute. However, it will also be bland, yellow, and un-styled. You can&#8217;t control the size of the box, style of the font, or the general appearance of the [...]]]></description>
			<content:encoded><![CDATA[<p>Hover your mouse over this <a href="http://www.earn-web-cash.com" title="This link will take you to the front page of Web Cash">link to Web Cash</a>.  Notice the tooltip?</p>

<p>You can achieve a tooltip like that on any anchor text by defining a &#8220;title&#8221; attribute.  However, it will also be bland, yellow, and un-styled.  You can&#8217;t control the size of the box, style of the font, or the general appearance of the tooltip at all.</p>

<p>But there&#8217;s a better way.  This tutorial will show you how to create custom tooltips using simple, valid HTML and CSS.  Once you&#8217;ve created the basic tooltip, you can style it to your heart&#8217;s content.</p>
<span id="more-44"></span>
<p>Before diving into the code, we should take a look at the CSS/HTML mechanics that we&#8217;ll need to build this thing.  If you feel confident that you know everything&#8230; then feel free to skip ahead.  Otherwise, read along.</p>

<p>First, let&#8217;s take a look at our goal.  We need to&#8230;</p>
<ul>
	<li>Create a box to hold the tooltip.</li>
	<li>Make the box invisible.</li>
	<li>Make the box visible once we mouse over our target text.</li>
	<li>Make the box appear &#8220;above&#8221; the page, instead of inline with the page.</li>
</ul>

<h5>Now It&#8217;s Here, Now It&#8217;s Not &#8211; Pseudo Classes</h5>

<p>In order to make our box appear and disappear, we need to use a little html/css magic called pseudo-classes.  Without these, we&#8217;d have to use javascript to detect when we mouse-over the target text.</p>

<p>Anchors (&lt;a&gt;) tags have a few built in pseudo classes &#8211; a:visited, a:active, and a:hover.  This allows you to style different types of anchors differently.  For example, an anchor tag will usually change color when you hover over it.</p>

<p>We&#8217;re going to use this to make our box appear and disappear.  The box will initially be invisible.  Then, using the a:hover pseudo-class, when we hover over the anchor tag the box will become visible.</p>

<h5>Creating a Box &#8211; Holding the Tooltip</h5>

<p>In order to display our tooltip and make it appear and re-appear, we need to create a container for it.  Then we need to position it.</p>

<p>What&#8217;s the natural container tag?  A <code>&lt;div&gt;</code>.  Unfortunately, Internet Explorer doesn&#8217;t like the <code>&lt;div&gt;</code> tag, so we&#8217;ll use a <code>&lt;span&gt;</code> tag instead.  To hell with semantics.  It&#8217;s still valid html.</p>

<p>Initially, this <code>&lt;span&gt;</code> is going to be styled with <code>display:none</code>.  Then, when the a:hover becomes active, it will switch to <code>display:block</code>.</p>

<p>We also need to position the span so that it appears &#8220;above&#8221; the rest of the page.  We&#8217;ll need two css attributes to do this.  First, we&#8217;ll give the anchor a <code>position:relative</code> declaration.  Then, we give our span a <code>position:absolute</code> declaration.</p>

<p>This will make the tooltip hover above the rest of the page &#8211; and it&#8217;s position will be based on the relative position of the anchor text.</p>

<h5>Building the HTML and CSS</h5>

<p>Now that we know the basic building blocks, let&#8217;s look at the actual markup.</p>

<p>Here&#8217;s the HTML you would use to create the tooltip.</p>


<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">p</span>&gt;</span>Here’s some more sample text.  This 
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">'info'</span>&gt;</span>anchor<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">span</span>&gt;</span>CSS tooltip.  We 
  can style this!<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">span</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span> has a css-based tooltip
  that we can style to our liking.<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">p</span>&gt;</span></pre></div></div>




<p>There&#8217;s three basic elements here.  The regular text &#8211; enclosed in a p tag.  Our target text is enclosed in an anchor tag with class &#8220;info.&#8221;  The actual tooltip is in a <code>&lt;span&gt;</code> tag <strong>inside</strong> the anchor tag.</p>

<p>Now, let&#8217;s look at the css necessary to make the tooltip magic work.  This is the <strong>barebones</strong> version &#8211; we&#8217;ll style it a bit later.</p>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #6666ff;">.info</span> span <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #6666ff;">.info</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #6666ff;">.info</span><span style="color: #3333ff;">:hover </span>span <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>




<p>This sets up what we discussed before.  The tooltip <code>&lt;span&gt;</code> is initially invisible.  Since it&#8217;s inside the anchor tag, we can use the <code>a.info:hover span</code> declaration to style the <code>&lt;span&gt;</code> differently when the anchor is hovered over &#8211; and then we make the <code>&lt;span&gt;</code> appear.</p>

<p>Voila!  Tooltip.</p>

<p>Mouse over <a class="basic-info">this text<span>This is the barebones tooltip.</span></a> to see what we&#8217;ve built so far.</p>

<p>At this point, you&#8217;ll probably see a blur of text appearing on top of some other text.  Not very readable&#8230; but that&#8217;s because we haven&#8217;t styled it yet.</p>

<p>Mouse over <a class="tooltip">this text<span>Now this has a bit of styling.</span></a> to see a slightly styled tooltip.</p>

<p>We added a few things here &#8211; I styled the basic a.info so that it had a different color and no text-decoration.  Then I styled the span with a bunch of stuff &#8211; background color, border, text color, width, and padding.</p>

<p>I also used <code>position:top</code> to offset it 1.5em from the top-left of our anchor, and <code>position:left</code> to offset it 1.5em from the top-left of our anchor.</p>

<p>Here&#8217;s the new css&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">a<span style="color: #6666ff;">.tooltip</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">gray</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #6666ff;">.info</span> span <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #6666ff;">.info</span><span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
a<span style="color: #6666ff;">.info</span><span style="color: #3333ff;">:hover </span>span <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#eeeeee</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">thin</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">.5em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>




<p>And that&#8217;s about all there is to it.  With the html and css you built in this tutorial, you&#8217;ve got the mechanics needed to build your own tooltip.</p>

<p>It&#8217;s up to you to style it according to your site&#8217;s theme and make it pretty.  You could add a gradient background, style the font for some extra spacing and/or size, set the width to the way you want, and more.</p>]]></content:encoded>
			<wfw:commentRss>http://www.earn-web-cash.com/2008/01/19/create-css-tooltips/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

